[Bug c++/107945] static constexpr incomplete (depedent) data member of a class template and in-member initialized accepted

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


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|static incomplete           |static constexpr incomplete
                   |(depedent) data member of a |(depedent) data member of a
                   |class template accepted     |class template and
                   |                            |in-member initialized
                   |                            |accepted
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-12-01

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
If we make the field not depedent then GCC rejects it:
```
struct incomplete;
template<typename T>
struct C
{
    static constexpr incomplete t{};
};
```

Confirmed.


More information about the Gcc-bugs mailing list