gcc bug? constinit does not require constexpr ctor
Klaus Doldinger
klaus.doldinger64@gmail.com
Thu Oct 10 12:37:00 GMT 2019
To answer my question myself: actually fixed in gcc-trunk.
Am 10.10.19 um 06:53 schrieb Klaus Doldinger:
> Hi all,
>
> simple question: should in the following example the constinit case be
> also impossible if the required ctor is not constexpr?
>
> struct B {
> /*constexpr*/ B() {}
> };
>
> struct A {
> constexpr static inline B b2{}; // not possible
> constinit static inline B b1{}; // should this NOT possible either?
> };
>
> int main() {
> A a;
> }
>
More information about the Gcc-help
mailing list