summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-25 20:50:04 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-25 20:50:04 +0000
commitfcaeae492940662da16b2a75dbf3be494150b82f (patch)
tree042e4e2367d39e6b43b0ee0655c65422ab47cbb4 /clang/lib/Sema/SemaDecl.cpp
parent9a26f0f260c1c12905358edb16661de21734dc0d (diff)
downloadbcm5719-llvm-fcaeae492940662da16b2a75dbf3be494150b82f.tar.gz
bcm5719-llvm-fcaeae492940662da16b2a75dbf3be494150b82f.zip
Implement a little bit of cleanup and a lot more of the base work
behind implicit moves. We now correctly identify move constructors and assignment operators and update bits on the record correctly. Generation of implicit moves (declarations or definitions) is not yet supported. llvm-svn: 132080
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 41e05d5cdb5..8b0ee7057a7 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7736,7 +7736,15 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
case CXXCopyConstructor:
if (RD->hasUserDeclaredCopyConstructor()) {
SourceLocation CtorLoc =
- RD->getCopyConstructor(Context, 0)->getLocation();
+ RD->getCopyConstructor(0)->getLocation();
+ Diag(CtorLoc, diag::note_nontrivial_user_defined) << QT << member;
+ return;
+ }
+ break;
+
+ case CXXMoveConstructor:
+ if (RD->hasUserDeclaredMoveConstructor()) {
+ SourceLocation CtorLoc = RD->getMoveConstructor()->getLocation();
Diag(CtorLoc, diag::note_nontrivial_user_defined) << QT << member;
return;
}
@@ -7752,6 +7760,14 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
}
break;
+ case CXXMoveAssignment:
+ if (RD->hasUserDeclaredMoveAssignment()) {
+ SourceLocation AssignLoc = RD->getMoveAssignmentOperator()->getLocation();
+ Diag(AssignLoc, diag::note_nontrivial_user_defined) << QT << member;
+ return;
+ }
+ break;
+
case CXXDestructor:
if (RD->hasUserDeclaredDestructor()) {
SourceLocation DtorLoc = LookupDestructor(RD)->getLocation();
OpenPOWER on IntegriCloud