[Bug c++/16226] New: fails to accept explicit "template" qualification

igodard at pacbell dot net gcc-bugzilla@gcc.gnu.org
Sun Jun 27 08:14:00 GMT 2004


template<typename T, template<typename> class D>
struct A{};
template<typename T>
struct B : A<T, B> {
        B() : A<T, template B>() {}
        };
int main() { B<int> b; return 0; }


gets you:


~/ootbc/common/test/src$ g++ foo.cc
foo.cc: In constructor `B<T>::B()':
foo.cc:5: error: missing `>' to terminate the template argument list
foo.cc:5: error: template argument 2 is invalid
foo.cc:5: error: expected `(' before "template"

If you leave out the "template" qualification then it complains that "B<T>" is not a template. 

I'm don't know whether the compiler is supposed to be able to disambiguate "B" without explicit qualification (as it does in the base-class list), or to accept explicit qualification, but surely one or the other is required.

Ivan

-- 
           Summary: fails to accept explicit "template" qualification
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list