summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2017-03-17 16:40:34 +0000
committerAlexander Kornienko <alexfh@google.com>2017-03-17 16:40:34 +0000
commitb10daaf1989de6b00856c0c94e0afb3719d56ec6 (patch)
treeae799c22d8e507934993aaef5ebc6fa61e560358 /clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
parentf98dec1c536b8f107bf4bcc134969f94a9a44910 (diff)
downloadbcm5719-llvm-b10daaf1989de6b00856c0c94e0afb3719d56ec6.tar.gz
bcm5719-llvm-b10daaf1989de6b00856c0c94e0afb3719d56ec6.zip
[Clang-tidy] Fix for misc-noexcept-move-constructor false triggers on defaulted declarations
Summary: There is no need for triggering warning when noexcept specifier in move constructor or move-assignment operator is neither evaluated nor uninstantiated. This fixes bug reported here: bugs.llvm.org/show_bug.cgi?id=24712 Reviewers: alexfh Reviewed By: alexfh Subscribers: JonasToth, JDevlieghere, cfe-commits Tags: #clang-tools-extra Patch by Marek Jenda! Differential Revision: https://reviews.llvm.org/D31049 llvm-svn: 298101
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
index f145db824cf..12a360f4ba7 100644
--- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
@@ -43,6 +43,10 @@ void NoexceptMoveConstructorCheck::check(
}
const auto *ProtoType = Decl->getType()->getAs<FunctionProtoType>();
+
+ if (isUnresolvedExceptionSpec(ProtoType->getExceptionSpecType()))
+ return;
+
switch (ProtoType->getNoexceptSpec(*Result.Context)) {
case FunctionProtoType::NR_NoNoexcept:
diag(Decl->getLocation(), "move %0s should be marked noexcept")
OpenPOWER on IntegriCloud