You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/03/21 23:52:32 UTC

[jira] Assigned: (STDCXX-351) [gcc 3.4.6] error on static const int expression as an array dimension in template code

     [ https://issues.apache.org/jira/browse/STDCXX-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor reassigned STDCXX-351:
-----------------------------------

    Assignee: Martin Sebor

> [gcc 3.4.6] error on static const int expression as an array dimension in template code
> ---------------------------------------------------------------------------------------
>
>                 Key: STDCXX-351
>                 URL: https://issues.apache.org/jira/browse/STDCXX-351
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: External
>         Environment: gcc 3.4.6
>            Reporter: Martin Sebor
>         Assigned To: Martin Sebor
>
> The well-formed program below fails to compile with gcc 3.4.6 (gcc 4.1 does fine):
> $ cat t.cpp && gcc --version && gcc -pedantic t.cpp
> template <class> struct S { static const int N = 1; };
> template <class>
> void foo () {
>     static const int N = S<int>::N;
>     static int a [S<int>::N];
>     static int b [N];
> }
> int main () { foo<int>(); }
> gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> t.cpp: In function `void foo()':
> t.cpp:7: error: ISO C++ forbids variable-size array `b'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.