[Bug c++/55809] New: Doesn't differentiate elaborated type specifier and typename specifier in dependent types
schaub.johannes at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Wed Dec 26 01:48:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55809
Bug #: 55809
Summary: Doesn't differentiate elaborated type specifier and
typename specifier in dependent types
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
The following looks well-formed
template<typename T, typename T::X *> void f() { }
template<typename T, class T::X *> void f() { }
struct A { typedef int X; };
struct B { void X(); class X { }; };
class B::X x1;
int x2;
int main() { f<A, &x2>(); f<B, &x1>(); }
But GCC shouts:
prog.cpp:1:94: error: redefinition of 'template<class T, class T::X*
<anonymous> > void f()'
prog.cpp:1:46: error: 'template<class T, typename T::X* <anonymous> > void
f()' previously declared here
Related Bugreport (responsible for accepting the above testcase too, when it's
fixed): http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48920 .
Clang accepts the above code, so my statement in PR48920 that the Itanium ABI
does not allow to distiguish between the different signatures appears to be
wrong and GCC should support this code.
More information about the Gcc-bugs
mailing list