[Bug c++/92058] New: constinit disregards non-constexpr constructor

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 10 20:07:00 GMT 2019


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

            Bug ID: 92058
           Summary: constinit disregards non-constexpr constructor
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

struct B {
    B() {}
};

struct A {
    constexpr static inline B b2{};
    constinit static inline B b1{};
};

int main() {
    A a;
}

Here b2 fails but b1 succeeds.


More information about the Gcc-bugs mailing list