[PATCH C/C++] Fix some diagnostics problems

Jason Merrill jason@redhat.com
Wed Jun 9 13:00:00 GMT 2010


On 06/09/2010 04:13 AM, Shujing Zhao wrote:
> On 06/09/2010 03:06 AM, Jason Merrill wrote:
>>
>>> + case ICR_DEFAULT_ARGUMENT:
>>> + error ("cannot convert %qT to %qT in default argument",
>>> + rhstype, type);
>>> + case ICR_ARGPASS:
>>> + error ("cannot convert %qT to %qT in argument passing",
>>> + rhstype, type);
>>> + break;
>>
>> These cases are unreachable, as they are covered by the previous if
>> (fndecl) test. Either remove the if (fndecl) message and use
>> parmnum/fndecl in these cases, or just use gcc_unreachable() in these
>> cases.
>
> At the test case testsuite/g++.old-deja/g++.mike/p10769b.C, the 'fndecl'
> is NULL, while the errtype is ICR_ARGPASS (argument passing).

Ah, of course, when you're calling a function pointer you don't have a 
declaration.  Is parmnum still set?

Jason



More information about the Gcc-patches mailing list