This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9236: Initializing enum values with template arguments does not work


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]