http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48536

           Summary: C++0x Automatic Enumerator Incrementation is not
                    compliant with Clause 7.2/5
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: shaw.joh...@gmail.com


The enumerations defined below are well-formed C++0x, but g++, with C++0x
extensions enabled, still treats #1 as an overflow error.

Note: Comeau C/C++ 4.3.10.1 with C++0x extensions enabled reports no errors.

#include <climits>
//
// g++ version 4.5.2 and below
//
// Compiler options:
//    -std=c++0x
//    -std=gnu++0x
// non-compliant error message:
//    "error: overflow in enumeration values"
//
// According to C++ draft N1905 (2005) and above / Clause 7.2/5
// The following enumeration is well-formed.
//
enum Enum_Inc  { EI_1=UINT_MAX, EI_2 }; // #1

// The above should be equivalent to the following
enum Enum_Inc2 { FI_1=UINT_MAX, FI_2=FI_1+1 }; // #2

Reply via email to