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

            Bug ID: 83921
           Summary: GCC rejects constexpr initialization of empty
                    aggregate.
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric at efcs dot ca
  Target Milestone: ---

Reproducer:
// g++ -std=c++14
struct Foo {};
constexpr void test() {
  Foo f; // error: uninitialized variable 'f' in 'constexpr' function
}


This error is obviously correct for non-empty types, however surely an empty
struct doesn't need an initializer?

If we agree this is a bug, it is a regression from the 6x release series, which
doesn't diagnose this code.

Reply via email to