This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52529] Compiler rejects template code inconsistently
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Mar 2012 08:31:16 +0000
- Subject: [Bug c++/52529] Compiler rejects template code inconsistently
- Auto-submitted: auto-generated
- References: <bug-52529-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52529
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-08 08:31:16 UTC ---
All error messages seems correct to me.
template <typename T> long foo(typename T::X *x);
1/3) A<M>().foo(x);
Where x is of some type. T cannot be deduced from T::X where T::X would be
some type.
2) I already explained in comment #1. You are missing a template keyword.
>all four variants compile under 4.5.3.
Yes and it looks like GCC is actually better at rejecting invalid code.