[cfe-commits] r131114 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp
Sean Hunt
scshunt at csclub.uwaterloo.ca
Mon May 9 17:41:46 PDT 2011
Author: coppro
Date: Mon May 9 19:41:46 2011
New Revision: 131114
URL: http://llvm.org/viewvc/llvm-project?rev=131114&view=rev
Log:
The last of the trivial constructor changes, make CXXSpecialMember
reflect our new, more accurate AST.
Modified:
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=131114&r1=131113&r2=131114&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Mon May 9 19:41:46 2011
@@ -1105,7 +1105,7 @@
enum CXXSpecialMember {
CXXInvalid = -1,
- CXXConstructor = 0,
+ CXXDefaultConstructor = 0,
CXXCopyConstructor = 1,
CXXCopyAssignment = 2,
CXXDestructor = 3
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=131114&r1=131113&r2=131114&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon May 9 19:41:46 2011
@@ -1508,15 +1508,18 @@
if (Ctor->isCopyConstructor())
return Sema::CXXCopyConstructor;
- return Sema::CXXConstructor;
+ if (Ctor->isDefaultConstructor())
+ return Sema::CXXDefaultConstructor;
}
if (isa<CXXDestructorDecl>(MD))
return Sema::CXXDestructor;
- assert(MD->isCopyAssignmentOperator() &&
- "Must have copy assignment operator");
- return Sema::CXXCopyAssignment;
+ if (MD->isCopyAssignmentOperator())
+ return Sema::CXXCopyAssignment;
+
+ llvm_unreachable("getSpecialMember on non-special member");
+ return Sema::CXXInvalid;
}
/// canRedefineFunction - checks if a function can be redefined. Currently,
@@ -7670,7 +7673,7 @@
if (!RDecl->hasTrivialCopyConstructor())
member = CXXCopyConstructor;
else if (!RDecl->hasTrivialDefaultConstructor())
- member = CXXConstructor;
+ member = CXXDefaultConstructor;
else if (!RDecl->hasTrivialCopyAssignment())
member = CXXCopyAssignment;
else if (!RDecl->hasTrivialDestructor())
@@ -7699,7 +7702,7 @@
case CXXInvalid:
break;
- case CXXConstructor:
+ case CXXDefaultConstructor:
if (RD->hasUserDeclaredConstructor()) {
typedef CXXRecordDecl::ctor_iterator ctor_iter;
for (ctor_iter ci = RD->ctor_begin(), ce = RD->ctor_end(); ci != ce;++ci){
@@ -7773,7 +7776,7 @@
bool (CXXRecordDecl::*hasTrivial)() const;
switch (member) {
- case CXXConstructor:
+ case CXXDefaultConstructor:
hasTrivial = &CXXRecordDecl::hasTrivialDefaultConstructor; break;
case CXXCopyConstructor:
hasTrivial = &CXXRecordDecl::hasTrivialCopyConstructor; break;
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=131114&r1=131113&r2=131114&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon May 9 19:41:46 2011
@@ -5091,7 +5091,7 @@
if (SetCtorInitializers(Constructor, 0, 0, /*AnyErrors=*/false) ||
Trap.hasErrorOccurred()) {
Diag(CurrentLocation, diag::note_member_synthesized_at)
- << CXXConstructor << Context.getTagDeclType(ClassDecl);
+ << CXXDefaultConstructor << Context.getTagDeclType(ClassDecl);
Constructor->setInvalidDecl();
return;
}
More information about the cfe-commits
mailing list