From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13511 invoked by alias); 17 Jul 2004 07:56:42 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13503 invoked by uid 48); 17 Jul 2004 07:56:42 -0000 Date: Sat, 17 Jul 2004 07:56:00 -0000 From: "gccbugs at contacts dot eelis dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040717075640.16603.gccbugs@contacts.eelis.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16603] New: Incorrect enumerator type before enumeration's closing brace X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg02116.txt.bz2 List-Id: In 7.2 [dcl.enum] paragraph 4 the standard states "Prior to the closing brace, the type of each enumerator is the type of its initializing value." In the example below y is defined prior to the enum-specifier's closing brace, where the type of x is the type of its initializing value, which in this case is char. Therefore, I would think that the value of y should be sizeof(char). However, when run the program displays the "hmm" message indicating that this is not the case.. char const c = 'q'; enum { x = c, y = sizeof(x) }; #include int main () { if (y != sizeof(char)) std::cout << "hmm" << std::endl; } -- Summary: Incorrect enumerator type before enumeration's closing brace Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: minor Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gccbugs at contacts dot eelis dot net CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16603