summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2017-05-22 14:30:14 +0000
committerAlexander Kornienko <alexfh@google.com>2017-05-22 14:30:14 +0000
commitf2dc6492edd47621a14622023e08a661dcd9640c (patch)
tree85fd790265ea1eb352e42591f5decfe1d1ae1299 /clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
parent6bb7e21f10e401e6d7165990ea2db2a2cfefa160 (diff)
downloadbcm5719-llvm-f2dc6492edd47621a14622023e08a661dcd9640c.tar.gz
bcm5719-llvm-f2dc6492edd47621a14622023e08a661dcd9640c.zip
[clang-tidy] misc-move-const-arg shouldn't complain on std::move(lambda)
llvm-svn: 303554
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
index c8ef94278e3..cc2d353da36 100644
--- a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp
@@ -74,6 +74,12 @@ void MoveConstantArgumentCheck::check(const MatchFinder::MatchResult &Result) {
if (IsConstArg || IsTriviallyCopyable) {
if (const CXXRecordDecl *R = Arg->getType()->getAsCXXRecordDecl()) {
+ // According to [expr.prim.lambda]p3, "whether the closure type is
+ // trivially copyable" property can be changed by the implementation of
+ // the language, so we shouldn't rely on it when issuing diagnostics.
+ if (R->isLambda())
+ return;
+ // Don't warn when the type is not copyable.
for (const auto *Ctor : R->ctors()) {
if (Ctor->isCopyConstructor() && Ctor->isDeleted())
return;
OpenPOWER on IntegriCloud