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]

[Bug c++/40639] New: Cannot parse dependant type for enum-base in C++0x


In C++0x mode, enums are allowed to specify an integral type for the base
representation.  If the enum is inside a class template, it may be a
type-dependant expression that should not evaluate and potentially error until
instantiation time.

Example code:

//========================================
template< typename T >
struct wrap {
   enum E : T { val };
};

template< typename T >
struct dependant {
   enum E : typename T::type { val };
};

template<typename T>
struct identity {
   typedef T type;
};

wrap<int> x;
dependant<identity<int>> y;
//========================================


-- 
           Summary: Cannot parse dependant type for enum-base in C++0x
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: public at alisdairm dot net


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


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