https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121
Manuel López-Ibáñez changed:
What|Removed |Added
Depends on||19808
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121
--- Comment #5 from Marc Glisse ---
Yes, then we are back to the fact that it works for A=int but not for A a class
containing an int.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121
--- Comment #4 from Antony Polukhin ---
Adding members and usage does not make a difference
https://godbolt.org/z/VommHu
struct A {
A();
int i;
};
struct B {
B(A);
int i;
};
struct composed2 {
B b_;
A a_;
composed2() : b_(a_) {}
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121
--- Comment #3 from Marc Glisse ---
And this translation unit doesn't actually generate any code at all, so the way
the warning is currently implemented has no chance of even looking at it.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121
--- Comment #2 from Marc Glisse ---
gcc warns for this at the level of actual instructions, not user code. Since A
is empty, nothing uninitialized is getting copied.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96121
Jonathan Wakely changed:
What|Removed |Added
Ever confirmed|0 |1
Status|UNCONFIRMED