stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Brown (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-351) [gcc 3.4.6] error on static const int expression as an array dimension in template code
Date Thu, 22 Mar 2007 04:49:32 GMT

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

Mark Brown commented on STDCXX-351:
-----------------------------------

The test compiles now so your change must have fixed 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.


Mime
View raw message