Re: [PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-03-06 Thread Jason Merrill
On 2/16/24 17:15, Jakub Jelinek wrote: On Fri, Feb 16, 2024 at 10:47:47PM +0100, Jakub Jelinek wrote: The following patch works. Or yet another option would be instead of (sometimes) clearing declarator->parameter_pack_p when we diagnose this bug for error recovery ignore the this specifier.

Re: [PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-02-16 Thread Jakub Jelinek
On Fri, Feb 16, 2024 at 10:47:47PM +0100, Jakub Jelinek wrote: > The following patch works. Or yet another option would be instead of (sometimes) clearing declarator->parameter_pack_p when we diagnose this bug for error recovery ignore the this specifier. With the following patch (testsuite patch

Re: [PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-02-16 Thread Jakub Jelinek
On Fri, Feb 16, 2024 at 10:20:26PM +0100, Jakub Jelinek wrote: > I've tried that (see below), but am getting > Excess errors: > /usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:33:29: > error: parameter packs not expanded with '...': And the reason for those is that e.g. on

Re: [PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-02-16 Thread Jakub Jelinek
On Fri, Feb 16, 2024 at 03:47:41PM -0500, Jason Merrill wrote: > Can we move all the xobj handling down here (where we can trust > declarator->parameter_pack_p) instead of adding a new variable? I've tried that (see below), but am getting Excess errors:

Re: [PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-02-16 Thread Jason Merrill
On 2/16/24 04:03, Jakub Jelinek wrote: Hi! The simple presence of ellipsis as next token after the parameter declaration doesn't imply it is a parameter pack, it sometimes is, e.g. if its type is a pack, but sometimes is not and in that case it acts the same as if the next tokens were , ...

[PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-02-16 Thread Jakub Jelinek
Hi! The simple presence of ellipsis as next token after the parameter declaration doesn't imply it is a parameter pack, it sometimes is, e.g. if its type is a pack, but sometimes is not and in that case it acts the same as if the next tokens were , ... instead of just ... The xobj param cannot be