Re: [PATCH] c++: Fix parsing of abstract-declarator starting with ... followed by [ or ( [PR115012]

2024-05-24 Thread Jason Merrill
On 5/9/24 14:12, Jakub Jelinek wrote: The C++26 P2662R3 Pack indexing paper mentions that both GCC and MSVC don't handle T...[10] parameter declaration when T is a pack. While that will change meaning in C++26, in C++11 .. C++23 this ought to be valid. Sure, but I don't think it does anyone a

C++ Patch ping - Re: [PATCH] c++: Fix parsing of abstract-declarator starting with ... followed by [ or ( [PR115012]

2024-05-16 Thread Jakub Jelinek
Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651199.html patch. Thanks. On Thu, May 09, 2024 at 08:12:30PM +0200, Jakub Jelinek wrote: > The C++26 P2662R3 Pack indexing paper mentions that both GCC > and MSVC don't handle T...[10] parameter declaration when T > is

[PATCH] c++: Fix parsing of abstract-declarator starting with ... followed by [ or ( [PR115012]

2024-05-09 Thread Jakub Jelinek
Hi! The C++26 P2662R3 Pack indexing paper mentions that both GCC and MSVC don't handle T...[10] parameter declaration when T is a pack. While that will change meaning in C++26, in C++11 .. C++23 this ought to be valid. Also, T...(args) as well. The following patch handles those in cp_parser_dir

Re: [PATCH] c++: fix parsing with auto(x) at block scope [PR112482]

2023-12-14 Thread Jason Merrill
On 12/14/23 16:02, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. -- >8 -- This is sort of like r14-5514, but at block scope. Consider struct A { A(int, int); }; void g (int a) { A bar(auto(a), 42); // not a fn decl } where we emit

[PATCH] c++: fix parsing with auto(x) at block scope [PR112482]

2023-12-14 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This is sort of like r14-5514, but at block scope. Consider struct A { A(int, int); }; void g (int a) { A bar(auto(a), 42); // not a fn decl } where we emit error: 'auto' parameter not permitted in this context

Re: [PATCH] c++: Fix parsing [[]][[]];

2023-12-05 Thread Marek Polacek
On Tue, Dec 05, 2023 at 08:51:51AM +0100, Jakub Jelinek wrote: > Hi! > > When working on the previous patch I put [[]] [[]] asm (""); into a > testcase, but was surprised it wasn't parsed. By wasn't parsed you mean we gave an error, right? I only see an error with block-scope [[]] [[]];. > The

[PATCH] c++: Fix parsing [[]][[]];

2023-12-04 Thread Jakub Jelinek
Hi! When working on the previous patch I put [[]] [[]] asm (""); into a testcase, but was surprised it wasn't parsed. The problem is that when cp_parser_std_attribute_spec returns NULL, it can mean 2 different things, one is that the next token(s) are neither [[ nor alignas (in that case the calle

Re: [PATCH] c++: fix parsing with auto(x) [PR112410]

2023-11-09 Thread Jason Merrill
On 11/9/23 14:58, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we are wrongly parsing int y(auto(42)); which uses the C++23 cast-to-prvalue feature, and initializes y to 42. However, we were treating the auto as an implicit template paramet

[PATCH] c++: fix parsing with auto(x) [PR112410]

2023-11-09 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we are wrongly parsing int y(auto(42)); which uses the C++23 cast-to-prvalue feature, and initializes y to 42. However, we were treating the auto as an implicit template parameter. Fixing the auto{42} case is easy, but

Re: [PATCH] c++: Fix parsing of invalid enum specifiers [PR90995]

2020-03-15 Thread Jason Merrill via Gcc-patches
On 3/14/20 4:06 AM, Jakub Jelinek wrote: Hi! The testcase shows some accepts-invalid (the ones without alignas) and ice-on-invalid-code (the ones with alignas) cases. If the enum doesn't have an underlying type and is not a definition, the caller retries to parse it as elaborated type specifier.

[PATCH] c++: Fix parsing of invalid enum specifiers [PR90995]

2020-03-14 Thread Jakub Jelinek via Gcc-patches
Hi! The testcase shows some accepts-invalid (the ones without alignas) and ice-on-invalid-code (the ones with alignas) cases. If the enum doesn't have an underlying type and is not a definition, the caller retries to parse it as elaborated type specifier. E.g. for enum struct S s it will then pedw