This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40639] New: Cannot parse dependant type for enum-base in C++0x
- From: "public at alisdairm dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jul 2009 14:15:12 -0000
- Subject: [Bug c++/40639] New: Cannot parse dependant type for enum-base in C++0x
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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