: 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
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
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;
}