Open kparzysz-quic opened 2 years ago
struct NT { NT(); // non-trivial constructor }; union U { U() = default; NT x; int y = 0; // default member initializer };
$ clang++ -c union1.cc -std=c++17 union1.cc:6:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted] U() = default; ^ union1.cc:7:6: note: default constructor of 'U' is implicitly deleted because variant field 'x' has a non-trivial default constructor NT x; ^ 1 warning generated.
This seems to contravene 15.1.5:
15.1 Constructors [...]
[...]
This issue may be related to https://github.com/llvm/llvm-project/issues/56313.
@llvm/issue-subscribers-clang-frontend
This seems to contravene 15.1.5:
15.1 Constructors [...]
[...]
This issue may be related to https://github.com/llvm/llvm-project/issues/56313.