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

            Bug ID: 97328
           Summary: [ICE] internal compiler error: in verify_ctor_sanity,
                    at cp/constexpr.c:3995
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldalessandro at gmail dot com
  Target Milestone: ---

Following code causes ICE, but *ONLY* when explicitly passing `-std=c++20`.

```
template <typename T, int N>
struct vector {
    union storage { 
        T t; 
        constexpr  storage() {}
    } data[N];
};

constexpr auto foo() {
    vector<char, 8> i;
    return i;
}
auto f = foo();
```

See https://godbolt.org/z/hYYeq8.

Reply via email to