[Bug c++/68903] New: missing default initialization of member when combined with virtual imheritance

2015-12-14 Thread spam at trzeci dot pl
: blocker Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: spam at trzeci dot pl Target Milestone: --- B::b is not constructed at all in the following code: struct Attribute { int i; Attribute( int _i ) :i(_i) {} }; struct

[Bug c++/68903] missing default initialization of member when combined with virtual inheritance

2016-12-09 Thread spam at trzeci dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68903 --- Comment #1 from trzeci --- Created attachment 40290 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40290=edit simpler testcase should output: 3 3 3 usually outputs: 3 3 0 C::c remains uninitialized after construction

[Bug c++/68903] missing default initialization of member when combined with virtual inheritance

2020-03-12 Thread spam at trzeci dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68903 --- Comment #2 from trzeci --- Simpler test: struct A { int a = 3; }; struct B : public A {}; struct C : public virtual B { int c = a; }; #include int main() { C c; std::cout << c.a << " " << c.c << std::endl; return 0; }