This code snippet struct V { V(int) { } }; struct B : virtual V { B() { } // does not mention constructor of V }; struct D : B { D() : V(0) { } }; D d; // most derived object of type D should be valid according to the C++ standard 12.6.2 paragraph 6 (note that B is not a most derived class). However, gcc complains about the definition of the constructor for B, which is wrong, because the constructor for B is not used to initialize a most derived object (it only initializes the B subobject of D): 257-demo.cc: In constructor 'B::B()': 257-demo.cc:7: error: no matching function for call to 'V::V()' 257-demo.cc:2: note: candidates are: V::V(int) 257-demo.cc:1: note: V::V(const V&)
I think is really a dup of bug 19249. Though the problem here is slightly different as B() is fully defined and calls the default constructor which is not defined. Comeau C/C++ 4.3.8 (Aug 19 2006 13:36:48) for ONLINE_EVALUATION_Alpha1 Copyright 1988-2006 Comeau Computing. All rights reserved. MODE:strict errors C++ "ComeauTest.c", line 7: error: no default constructor exists for class "V" B() { } // does not mention constructor of V ^ That is what comeau online gives.
I agree it's a duplicate of bug 19249, but I would not limit the discussion to abstract classes. *** This bug has been marked as a duplicate of 19249 ***