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

            Bug ID: 123095
           Summary: GCC accepts invalid program with template struct
                    having a member with a wrong default initializer
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following ill-formed program(afaik) is accepted by gcc but rejected by
clang.

```
struct Wrapper
{
    explicit Wrapper(int) {}
};

template <int N = 0>
struct Test
{
    Test() : w(0) {}

    Wrapper w{};
};

Test t;
```
Demo link: https://godbolt.org/z/KrcMcMePe

Reply via email to