[all-commits] [llvm/llvm-project] bc713f: PR48763: Better handling for classes that inherit ...

Richard Smith via All-commits all-commits at lists.llvm.org
Mon Jan 18 18:54:41 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc713f6a004723d1325bc16e1efc32d0ac82f939
      https://github.com/llvm/llvm-project/commit/bc713f6a004723d1325bc16e1efc32d0ac82f939
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-01-18 (Mon, 18 Jan 2021)

  Changed paths:
    M clang/include/clang/AST/CXXRecordDeclDefinitionBits.def
    M clang/include/clang/AST/DeclCXX.h
    M clang/lib/AST/DeclCXX.cpp
    M clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp
    M clang/test/CXX/special/class.ctor/p6-0x.cpp
    M clang/test/CXX/special/class.inhctor/p1.cpp
    M clang/test/CXX/special/class.inhctor/p2.cpp

  Log Message:
  -----------
  PR48763: Better handling for classes that inherit a default constructor.

The C++ standard wording doesn't appear to properly handle the case
where a class inherits a default constructor from a base class. Various
properties of classes are defined in terms of the corresponding property
of the default constructor, and in this case, the class does not have a
default constructor despite being default-constructible, which the
wording doesn't handle properly.

This change implements a tentative fix for these problems, which has
also been proposed to the C++ committee: if a class would inherit a
default constructor, and does not explicitly declare one, then one is
implicitly declared.




More information about the All-commits mailing list