This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22621] [3.4/4.0/4.1 Regression] Member function overloading introduces syntax errors
- From: "squell at alumina dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2005 00:56:23 -0000
- Subject: [Bug c++/22621] [3.4/4.0/4.1 Regression] Member function overloading introduces syntax errors
- References: <20050722203733.22621.squell@alumina.nl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From squell at alumina dot nl 2005-07-24 00:56 -------
(In reply to comment #4)
> > bar< ptr->f > a; // ERROR: `->' cannot appear in constant expression
> > bar< &ptr->f > b; // ERROR: '>' missing in template argument
> No, both of those are invalid as -> cannot be in constant expression.
Correction: You're absolutely right! :) C++ simply disallows this
syntax because the template non-type argument must be of the form
"id-expression" or "&id-expression".
It follows logically that the transformation I described shouldn't apply,
since it would produce ill-formed code anyway.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22621