This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55922] brace initializing parent cause bogus virtual base constructor calls
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Jun 2015 10:16:15 +0000
- Subject: [Bug c++/55922] brace initializing parent cause bogus virtual base constructor calls
- Auto-submitted: auto-generated
- References: <bug-55922-4 at http dot gcc dot gnu dot org/bugzilla/>
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;
}