This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26404] g++ seems to substitute template parameter too early
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2007 03:52:32 -0000
- Subject: [Bug c++/26404] g++ seems to substitute template parameter too early
- References: <bug-26404-2491@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from bangerth at dealii dot org 2007-09-24 03:52 -------
It's only a diagnostic problem: the template type 'int' in Tag<int>::type
is non-deductible, so the compiler can't find the primary template. The
code in therefore in fact invalid. You can make it valid by explicitly
specifying the template argument as in
template <>
void
foo<int>(Tag<int>::type t) {}
Once one knows what the problem is, the error message even makes some sense.
I don't know how to improve it, since the compiler certainly can't tell
that the primary template uses a template parameter in a non-deducible context
here.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26404