From b10daaf1989de6b00856c0c94e0afb3719d56ec6 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Fri, 17 Mar 2017 16:40:34 +0000 Subject: [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 --- clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp') 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(); + + if (isUnresolvedExceptionSpec(ProtoType->getExceptionSpecType())) + return; + switch (ProtoType->getNoexceptSpec(*Result.Context)) { case FunctionProtoType::NR_NoNoexcept: diag(Decl->getLocation(), "move %0s should be marked noexcept") -- cgit v1.2.3