[Bug c++/107945] GCC accepts invalid program involving constexpr static data member of class template

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 1 20:09:31 GMT 2022


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced:
```
struct incomplete;
template<typename T> struct C
{
    static constexpr T t{};
};


int main() {
    C<incomplete> t;
   // t.t;
}
```
If we uncomment t.t, then GCC will reject it.


More information about the Gcc-bugs mailing list