diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp index f145db824cf3..12a360f4ba73 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") diff --git a/clang-tools-extra/test/clang-tidy/misc-noexcept-move-constructor.cpp b/clang-tools-extra/test/clang-tidy/misc-noexcept-move-constructor.cpp index 289cc131e3e0..b8154ec3af15 100644 --- a/clang-tools-extra/test/clang-tidy/misc-noexcept-move-constructor.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-noexcept-move-constructor.cpp @@ -42,3 +42,13 @@ struct OK3 { OK3(OK3 &&) noexcept(false) {} OK3 &operator=(OK3 &&) = delete; }; + +struct OK4 { + OK4(OK4 &&) noexcept = default; + OK4 &operator=(OK4 &&) noexcept = default; +}; + +struct OK5 { + OK5(OK5 &&) noexcept(true) = default; + OK5 &operator=(OK5 &&) noexcept(true) = default; +};