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++/45964] The compiler does not complain about a required template keyword.


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.


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