[Bug c++/91159] Compilation error on explicitly defaulting default constructor of an abstract class with virtual base class

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jul 13 20:15:00 GMT 2019


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-07-13
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think [class.default.ctor] p2 bullet (2.7) says that A()=default; should get
defined as deleted, because Base has no default constructor.

That seems like a defect in the standard because as you say, it doesn't need to
construct Base. This seems related to https://wg21.link/cwg257 but the =default
case seems to not have been fixed. Clang apparently does the "right" thing, in
violation of the standard.


More information about the Gcc-bugs mailing list