summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-06-23 23:42:10 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-06-23 23:42:10 +0000
commita83edb0cc1f3e0f191ec88526db7c777e93072d4 (patch)
tree11befee265cb51f21d873785b5d4e60ff51a0d1a
parentbadeace84afce32089a747de201b9d48c5c780c3 (diff)
downloadbcm5719-llvm-a83edb0cc1f3e0f191ec88526db7c777e93072d4.tar.gz
bcm5719-llvm-a83edb0cc1f3e0f191ec88526db7c777e93072d4.zip
Some changes to accomodate Doug's comment for
implicit copy constructor definition determination. llvm-svn: 74025
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index c9c662671c1..f417cdfb9bc 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -1890,10 +1890,8 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(Base->getType()->getAsRecordType()->getDecl());
if (!BaseClassDecl->hasTrivialConstructor()) {
if (CXXConstructorDecl *BaseCtor =
- BaseClassDecl->getDefaultConstructor(Context)) {
- if (BaseCtor->isImplicit() && !BaseCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, BaseCtor);
- }
+ BaseClassDecl->getDefaultConstructor(Context))
+ MarkDeclarationReferenced(CurrentLocation, BaseCtor);
else {
Diag(CurrentLocation, diag::err_defining_default_ctor)
<< Context.getTagDeclType(ClassDecl) << 1
@@ -1915,10 +1913,8 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(FieldClassType->getDecl());
if (!FieldClassDecl->hasTrivialConstructor())
if (CXXConstructorDecl *FieldCtor =
- FieldClassDecl->getDefaultConstructor(Context)) {
- if (FieldCtor->isImplicit() && !FieldCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, FieldCtor);
- }
+ FieldClassDecl->getDefaultConstructor(Context))
+ MarkDeclarationReferenced(CurrentLocation, FieldCtor);
else {
Diag(CurrentLocation, diag::err_defining_default_ctor)
<< Context.getTagDeclType(ClassDecl) << 0 <<
@@ -1956,6 +1952,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
CXXRecordDecl *ClassDecl
= cast<CXXRecordDecl>(CopyConstructor->getDeclContext());
assert(ClassDecl && "DefineImplicitCopyConstructor - invalid constructor");
+ // C++ [class.copy] p209
// Before the implicitly-declared copy constructor for a class is
// implicitly defined, all the implicitly-declared copy constructors
// for its base class and its non-static data members shall have been
@@ -1966,8 +1963,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(Base->getType()->getAsRecordType()->getDecl());
if (CXXConstructorDecl *BaseCopyCtor =
BaseClassDecl->getCopyConstructor(Context, TypeQuals))
- if (BaseCopyCtor->isImplicit() && !BaseCopyCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, BaseCopyCtor);
+ MarkDeclarationReferenced(CurrentLocation, BaseCopyCtor);
}
for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context);
Field != ClassDecl->field_end(Context);
@@ -1980,8 +1976,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(FieldClassType->getDecl());
if (CXXConstructorDecl *FieldCopyCtor =
FieldClassDecl->getCopyConstructor(Context, TypeQuals))
- if (FieldCopyCtor->isImplicit() && !FieldCopyCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, FieldCopyCtor);
+ MarkDeclarationReferenced(CurrentLocation, FieldCopyCtor);
}
}
CopyConstructor->setUsed();
OpenPOWER on IntegriCloud