incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-351) [gcc 3.4.6] error on static const int expression as an array dimension in template code
Date Fri, 09 Mar 2007 00:56:24 GMT
[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


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.


Mime
View raw message