[Bug c++/47144] New: Doesn't reject attempt to define type in template argument; results in weird parse

schaub.johannes at googlemail dot com gcc-bugzilla@gcc.gnu.org
Sat Jan 1 06:03:00 GMT 2011


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

           Summary: Doesn't reject attempt to define type in template
                    argument; results in weird parse
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


GCC accepts the following:

template<typename> struct A { }; A< struct B { } >::SomeNonSense int y;

Seems like internally it creates the specialization for "A< ::B >", but its
parser goes mad at some part. It's not allowed to define types in template
arguments. C++03 seems to have missed to explicitly state that, but n3225 says
so explicitly.



More information about the Gcc-bugs mailing list