This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51664] comparison incorrectly treated as template instantiation
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Dec 2011 14:41:17 +0000
- Subject: [Bug c++/51664] comparison incorrectly treated as template instantiation
- Auto-submitted: auto-generated
- References: <bug-51664-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51664
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-23 14:41:17 UTC ---
Richard: yes.
[temp.names] p3 says
-3- After name lookup (3.4) ïnds that a name is a template-name or that an
operator-function-id or a literal-operator-id refers to a set of overloaded
functions any member of which is a function template if this is followed by a
<, the < is always taken as the delimiter of a template-argument-list and never
as the less-than operator. [...]
but then p4 should apply in this case:
-4- When the name of a member template specialization appears after . or -> in
a postïx-expression or after a nested-name-speciïer in a qualiïed-id, and the
object expression of the postïx-expression is type-dependent or the
nested-name-speciïer in the qualiïed-id refers to a dependent type, but the
name is not a member of the current instantiation (14.6.2.1), the member
template name must be preïxed by the keyword template. Otherwise the name is
assumed to name a non-template.
Let's see what Jason says