This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53405] New: Enum-dependent class template instantiations not recognized
- From: "ibugs at qult dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 May 2012 17:02:01 +0000
- Subject: [Bug c++/53405] New: Enum-dependent class template instantiations not recognized
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53405
Bug #: 53405
Summary: Enum-dependent class template instantiations not
recognized
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ibugs@qult.net
The following code compiles with GCC 4.4.6, doesn't with GCC 4.5.4 and 4.6.0,
but does again with 4.7.0. I'm reporting this just in case the maintainers
aren't aware of it.
enum Tags { some_tag };
template <bool> struct BoolValue {};
template <Tags T>
struct Foo {
BoolValue<T == some_tag> meth();
};
template <Tags T>
BoolValue<T == some_tag> Foo<T>::meth() {}
The compiler complains about the return type of the method's definition being
BoolValue<(T == (Tags)0u)>
and not
BoolValue<(T == some_tag)>
which is clearly nonsense.