This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]