This is the mail archive of the gcc-patches@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]

Re: [C++ PATCH] [PR8856] A conversion-function-id cannot be atemplate-name (regression on trunk)


> In other words, there is no way to provide an explicit argument list for a
> template conversion function. This is stated in 14.5.2/5: "because the explicit
> template argument list follows the function template name, and because
> conversion member function templates and constructor member function templates
> are called without using a function name, there is no way to provide an
> explicit template argument list for these function templates.". Because of this
> bug, we were accepting illegal code such as #1, or the even funnier "a.operator
> double<int>();". This is a regression on the trunk.

The EDG front end does accept explicit83.C, even in its strict mode,
which is interesting, given the fact that DR 264 was filed by John
Spicer.

But, I think your analysis is very interesting -- and even correct. :-)

> Fixed thus. There is an additional hunk which checks for invalid template
> argument lists after built-in types, which allows a beautiful error message
> such as "'double' is not a template name" for the aforementioned line. Tested
> on i686-pc-linux-gnu, no new regressions. OK for mainline?

Yes!  Thanks.  I looked at this regression several times and could never
figure out how to fix it; I'm glad that you spotted that key bit in
14.5.2/5.

Would you please remove explicit83.C, or at least the invalid parts of
it?

Thanks!

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC


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