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