From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27959 invoked by alias); 9 Jan 2003 01:06:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 27937 invoked by uid 71); 9 Jan 2003 01:06:01 -0000 Resent-Date: 9 Jan 2003 01:06:01 -0000 Resent-Message-ID: <20030109010601.27936.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, bangerth@ticam.utexas.edu Received: (qmail 27189 invoked by uid 61); 9 Jan 2003 01:03:23 -0000 Message-Id: <20030109010323.27166.qmail@sources.redhat.com> Date: Thu, 09 Jan 2003 01:06:00 -0000 From: bangerth@ticam.utexas.edu Reply-To: bangerth@ticam.utexas.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9236: Initializing enum values with template arguments does not work X-SW-Source: 2003-01/txt/msg00574.txt.bz2 List-Id: >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 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: