This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26404] g++ seems to substitute template parameter too early



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]