Open
Description
The following code is pretty correct, but Clang emits warning. I consider it a bug.
struct X {
int x_field{};
};
struct Y {
template <class>
Y() : y_field(x.x_field) {}
X x;
int y_field;
};
https://godbolt.org/z/GM3Yjs93a
x86-64 clang (trunk) -O3 -std=c++20 -Wall -Wextra :
<source>:7:19: warning: field 'x' is uninitialized when used here [-Wuninitialized]
7 | Y() : y_field(x.x_field) {}