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: [PATCH C/C++] Fix some diagnostics problems


On 9 June 2010 14:55, Jason Merrill <jason@redhat.com> wrote:
> 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?

Why not document that in the function comment? I would say that the comment

/* If FNDECL is non-NULL, we
   are doing the conversion in order to pass the PARMNUMth argument of
   FNDECL. */

is wrong.

In any case, I don't understand why we cannot pass down the name of
the pointer for diagnostics purposes since fndecl does not determine
anymore whether is a argument conversion.

Cheers,

Manuel


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