This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16226] New: fails to accept explicit "template" qualification
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2004 08:11:43 -0000
- Subject: [Bug c++/16226] New: fails to accept explicit "template" qualification
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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