This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42356] confused compiler
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 22 Oct 2011 12:27:11 +0000
- Subject: [Bug c++/42356] confused compiler
- Auto-submitted: auto-generated
- References: <bug-42356-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42356
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-10-22
CC| |manu at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #7 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-10-22 12:27:11 UTC ---
Clang prints:
/tmp/webcompile/_26276_0.cc:17:19: error: no matching member function for call
to 'newNode'
bar* b = f.newNode<bar>();
~~^~~~~~~~~~~~
/tmp/webcompile/_26276_0.cc:6:13: note: candidate function template not viable:
requires 1 argument, but 0 were provided
T* newNode(U u) { return newNode()->init(u); }
^
/tmp/webcompile/_26276_0.cc:6:13: note: candidate function template not viable:
requires 1 argument, but 0 were provided
/tmp/webcompile/_26276_0.cc:8:13: note: candidate function template not viable:
requires 2 arguments, but 0 were provided
T* newNode(U u, V v) { return newNode()->init(u, v); }
^
/tmp/webcompile/_26276_0.cc:8:13: note: candidate function template not viable:
requires 2 arguments, but 0 were provided
which is nicer except for the duplicated messages.
The first thing that should go away is the "expected primary-expression" stuff.