This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9236: Initializing enum values with template arguments does not work
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 9 Jan 2003 01:03:23 -0000
- Subject: c++/9236: Initializing enum values with template arguments does not work
- Reply-to: bangerth at ticam dot utexas dot edu
>Number: 9236
>Category: c++
>Synopsis: Initializing enum values with template arguments does not work
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 08 17:06:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
all gcc versions since at least 2.95
>Description:
Based on the assumption that initializers for local
static member variables and enums should have to fulfil
the same requirements (const-expr), I tried this:
--------------------------
template <int N> struct X {
static const int j=N;
enum I { i=N; };
};
--------------------------
However, while the static variable is ok, the enum member
is not:
tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:3: error: expected `}'
x.cc:4: error: expected declaration
Is my understanding wrong, or is it gcc?
W.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: