defaulted default constructors.
As it happens, making sure that we handle out-of-line defaulted
functions properly will involved making sure that we actually parse them
correctly, so that's coming after.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131224
91177308-0d34-0410-b5e6-
96231b3b80d8
/*isInline=*/true,
/*isImplicitlyDeclared=*/true);
DefaultCon->setAccess(AS_public);
+ DefaultCon->setDefaulted();
DefaultCon->setImplicit();
DefaultCon->setTrivial(ClassDecl->hasTrivialDefaultConstructor());
void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
CXXConstructorDecl *Constructor) {
- assert((Constructor->isImplicit() && Constructor->isDefaultConstructor() &&
+ assert((Constructor->isDefaulted() && Constructor->isDefaultConstructor() &&
!Constructor->isUsed(false) && !Constructor->isDeleted()) &&
"DefineImplicitDefaultConstructor - call it for implicit default ctor");
// Note that this declaration has been used.
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(D)) {
unsigned TypeQuals;
- if (Constructor->isImplicit() && Constructor->isDefaultConstructor()) {
- if (Constructor->getParent()->hasTrivialDefaultConstructor())
+ if (Constructor->isDefaulted() && Constructor->isDefaultConstructor()) {
+ if (Constructor->isTrivial())
return;
if (!Constructor->isUsed(false))
DefineImplicitDefaultConstructor(Loc, Constructor);
// the definition for completely trivial constructors.
CXXRecordDecl *ClassDecl = Constructor->getParent();
assert(ClassDecl && "No parent class for constructor.");
- if (Constructor->isImplicit() && Constructor->isDefaultConstructor() &&
+ if (Constructor->isDefaulted() && Constructor->isDefaultConstructor() &&
ClassDecl->hasTrivialDefaultConstructor() &&
!Constructor->isUsed(false))
S.DefineImplicitDefaultConstructor(Loc, Constructor);