https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107945
Bug ID: 107945
Summary: GCC accepts invalid program involving constexpr static
data member of class template
Product: gcc
Version: 13.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 invalid program is accepted by gcc but rejected by clang and
msvc. https://godbolt.org/z/WGz3f75da
```
struct incomplete;
template<typename T> struct C
{
static constexpr T t{};
};
template<class T>
struct myClass {
C<T> new_t() { return {}; }
};
int main() {
myClass<incomplete> d;
d.new_t();
}
```