https://bugs.llvm.org/show_bug.cgi?id=51560

            Bug ID: 51560
           Summary: Defaulted consteval default constructor that performs
                    no initialization is not rejected
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: johel...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    johel...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

See https://godbolt.org/z/Gc4MTfdr7.
```C++
struct X{
  int i;
  consteval X() = default;
  // consteval X() {}
};
int main () {
    auto x = X();
    (void)x;
}
```

See also https://eel.is/c++draft/class.default.ctor#4, particularly
https://eel.is/c++draft/class.default.ctor#4.sentence-3:
> If that user-written default constructor would be ill-formed, the program is 
> ill-formed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to