public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115012] New: noptr-abstract-pack-declarator parsing bug with T... [N]
@ 2024-05-09 13:04 jakub at gcc dot gnu.org
  2024-05-09 13:23 ` [Bug c++/115012] " jakub at gcc dot gnu.org
  2024-05-09 14:53 ` jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-09 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115012

            Bug ID: 115012
           Summary: noptr-abstract-pack-declarator parsing bug with T...
                    [N]
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: daniel.kruegler at googlemail dot com, egor.pugin at gmail dot com,
                    mpolacek at gcc dot gnu.org, unassigned at gcc dot gnu.org,
                    webrown.cpp at gmail dot com
        Depends on: 113798
            Blocks: 110338
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #113798 +++

As mentioned in the https://wg21.link/P2662R3 paper, we aren't parsing
correctly T...[N] parameters.

template <int N, typename ...T>
void
foo (T... x[N])
{
}

template <int N, typename T>
void
bar (T [N])
{
}

template <int N, typename ...T>
void
baz (T... [N])
{
}

template <int N, typename ...T>
void
qux (T... [N][N])
{
}

void
corge (int a[10], double b[10], int c[5][5], float d[5][5])
{
  foo <10, int, double> (a, b);
  bar <10, int> (a);
  baz <10, int, double> (a, b);
  qux <5, int, float> (c, d);
}

is accepted by clang++ but not by GCC nor MSCV.
This is going to change in C++26 with pack indexing, but in C++11 .. C++23 it
should be valid.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
[Bug 110338] Implement C++26 language features
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113798
[Bug 113798] [C++26] P2662R3 - Pack indexing

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/115012] noptr-abstract-pack-declarator parsing bug with T... [N]
  2024-05-09 13:04 [Bug c++/115012] New: noptr-abstract-pack-declarator parsing bug with T... [N] jakub at gcc dot gnu.org
@ 2024-05-09 13:23 ` jakub at gcc dot gnu.org
  2024-05-09 14:53 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-09 13:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115012

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-05-09
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 58147
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58147&action=edit
gcc15-pr115012.patch

Untested fix.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/115012] noptr-abstract-pack-declarator parsing bug with T... [N]
  2024-05-09 13:04 [Bug c++/115012] New: noptr-abstract-pack-declarator parsing bug with T... [N] jakub at gcc dot gnu.org
  2024-05-09 13:23 ` [Bug c++/115012] " jakub at gcc dot gnu.org
@ 2024-05-09 14:53 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-09 14:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115012

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #58147|0                           |1
        is obsolete|                            |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 58148
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58148&action=edit
gcc15-pr115012.patch

Updated patch which also handles the T...(args) case.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-09 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-09 13:04 [Bug c++/115012] New: noptr-abstract-pack-declarator parsing bug with T... [N] jakub at gcc dot gnu.org
2024-05-09 13:23 ` [Bug c++/115012] " jakub at gcc dot gnu.org
2024-05-09 14:53 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).