This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45964] The compiler does not complain about a required template keyword.
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Oct 2010 15:20:50 +0000
- Subject: [Bug c++/45964] The compiler does not complain about a required template keyword.
- Auto-submitted: auto-generated
- References: <bug-45964-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45964
--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> 2010-10-11 15:20:47 UTC ---
(In reply to comment #10)
> Reduced form, Jason, are the "should be" comments below correct?
>
> // should be rejected, value is not a template
> template<int a>
> const int A<a>::template value = 0;
Yes.
> // should be accepted, B<b> is a template
> template<int a>
> template<int b>
> const int A<a>::template B<b>::value = 0;
Apparently so. I'm surprised by this; I didn't think you could use 'template'
in a declarator-id, but I can't find anything in the WP to back that up.