------- Comment #1 from bangerth at dealii dot org  2008-04-14 14:34 -------
You are asking for too much. The problem is that in your first example
the compiler knows that you want to call the grab() function and therefore
can give you an informative error message. But in the second example it
can't: there's a template, and the compiler tries to match your call's
argument types with the template types, but it can't find a set of
template types for which the call would match the signature of the function
template. In other words, it doesn't know which function you want to
call -- there doesn't appear to be one that would match what you want.

To implement what you suggest would require the compiler to speculate what
you wanted, for example by speculating that you wanted grab<int>. We've
found over the years that letting the compiler speculate sometimes produces
a better diagnostic, but most of the time leads to messages that really don't
have anything to do with what the user really wanted -- and then become
really confusing.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35904

Reply via email to