summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2015-05-18 19:54:08 +0000
committerRichard Trieu <rtrieu@google.com>2015-05-18 19:54:08 +0000
commit1d4911bc994789169594be634ae158966fc41cfb (patch)
treeef28538745090b7e74d57db7aee150299deb69a9 /clang/lib/Sema/SemaInit.cpp
parentc9f11241209e0038680e4d95c19ca5291368a926 (diff)
downloadbcm5719-llvm-1d4911bc994789169594be634ae158966fc41cfb.tar.gz
bcm5719-llvm-1d4911bc994789169594be634ae158966fc41cfb.zip
Have -Wredundant-move ignore reference types.
Don't give a warning when the type being moved is a reference type. Also uncomment two lines in the test case. llvm-svn: 237607
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 7dd93e8de58..610e0a9a038 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -5831,6 +5831,9 @@ static void CheckMoveOnConstruction(Sema &S, const Expr *InitExpr,
if (!VD || !VD->hasLocalStorage())
return;
+ if (!VD->getType()->isRecordType())
+ return;
+
if (DiagID == 0) {
DiagID = S.Context.hasSameUnqualifiedType(DestType, VD->getType())
? diag::warn_pessimizing_move_on_return
OpenPOWER on IntegriCloud