[cfe-commits] r131126 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue May 10 07:12:22 PDT 2011
Author: rafael
Date: Tue May 10 09:12:22 2011
New Revision: 131126
URL: http://llvm.org/viewvc/llvm-project?rev=131126&view=rev
Log:
Revert 131114. This fixes PR9884.
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=131126&r1=131125&r2=131126&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue May 10 09:12:22 2011
@@ -1105,7 +1105,7 @@
enum CXXSpecialMember {
CXXInvalid = -1,
- CXXDefaultConstructor = 0,
+ CXXConstructor = 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=131126&r1=131125&r2=131126&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue May 10 09:12:22 2011
@@ -1508,18 +1508,15 @@
if (Ctor->isCopyConstructor())
return Sema::CXXCopyConstructor;
- if (Ctor->isDefaultConstructor())
- return Sema::CXXDefaultConstructor;
+ return Sema::CXXConstructor;
}
if (isa<CXXDestructorDecl>(MD))
return Sema::CXXDestructor;
- if (MD->isCopyAssignmentOperator())
- return Sema::CXXCopyAssignment;
-
- llvm_unreachable("getSpecialMember on non-special member");
- return Sema::CXXInvalid;
+ assert(MD->isCopyAssignmentOperator() &&
+ "Must have copy assignment operator");
+ return Sema::CXXCopyAssignment;
}
/// canRedefineFunction - checks if a function can be redefined. Currently,
@@ -7680,7 +7677,7 @@
if (!RDecl->hasTrivialCopyConstructor())
member = CXXCopyConstructor;
else if (!RDecl->hasTrivialDefaultConstructor())
- member = CXXDefaultConstructor;
+ member = CXXConstructor;
else if (!RDecl->hasTrivialCopyAssignment())
member = CXXCopyAssignment;
else if (!RDecl->hasTrivialDestructor())
@@ -7709,7 +7706,7 @@
case CXXInvalid:
break;
- case CXXDefaultConstructor:
+ case CXXConstructor:
if (RD->hasUserDeclaredConstructor()) {
typedef CXXRecordDecl::ctor_iterator ctor_iter;
for (ctor_iter ci = RD->ctor_begin(), ce = RD->ctor_end(); ci != ce;++ci){
@@ -7783,7 +7780,7 @@
bool (CXXRecordDecl::*hasTrivial)() const;
switch (member) {
- case CXXDefaultConstructor:
+ case CXXConstructor:
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=131126&r1=131125&r2=131126&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue May 10 09:12:22 2011
@@ -5109,7 +5109,7 @@
if (SetCtorInitializers(Constructor, 0, 0, /*AnyErrors=*/false) ||
Trap.hasErrorOccurred()) {
Diag(CurrentLocation, diag::note_member_synthesized_at)
- << CXXDefaultConstructor << Context.getTagDeclType(ClassDecl);
+ << CXXConstructor << Context.getTagDeclType(ClassDecl);
Constructor->setInvalidDecl();
return;
}
More information about the cfe-commits
mailing list