[ https://issues.apache.org/jira/browse/STDCXX-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor closed STDCXX-351. ------------------------------- Rats, this is a compiler bug, not a bug in the test as I thought. Oh well, it's also fixed in later versions of gcc, so I'll go ahead and close it. > [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 > Fix For: 4.2 > > > 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.