This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55922] brace initializing parent cause bogus virtual base constructor calls


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55922

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
bool called = false;

struct Base {
  Base() { if (called) throw 1; called = true; }
};

struct B1 : virtual Base {
  B1() { }
};

struct C : B1, virtual Base {
  C() :
#ifdef FIX
    B1()
#else
    B1{}
#endif
  { }
};

int main() {
  C c;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]