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

            Bug ID: 120174
           Summary: ICE (Segfault) in GCC when passing array of class to
                    generic lambda taking decltype of lambda with
                    -std=c++20
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mario.rodriguezb1 at um dot es
  Target Milestone: ---

Passing an array of a user-defined class to a generic lambda that captures by
value and takes a decltype of a lambda as its argument causes a segmentation
fault in GCC using -std=c++20.

```
#include <iostream>
class C{
};

int main(){

C fn[]{};
auto c = [=]
(decltype([](){})){};
c(fn)();
}

```

To quickly reproduce:

https://gcc.godbolt.org/z/GE7KExEGf

Reply via email to