diff --git a/compilerplugins/clang/noexceptmove.cxx b/compilerplugins/clang/noexceptmove.cxx index 1a1f2de41971..f0fd6cd899c5 100644 --- a/compilerplugins/clang/noexceptmove.cxx +++ b/compilerplugins/clang/noexceptmove.cxx @@ -67,7 +67,8 @@ bool NoExceptMove::TraverseCXXConstructorDecl(CXXConstructorDecl* constructorDec && constructorDecl->getExceptionSpecType() == EST_None && !constructorDecl->isDefaulted() && !constructorDecl->isDeleted() && !ignoreLocation(constructorDecl) - && constructorDecl->isThisDeclarationADefinition(); + && constructorDecl->isThisDeclarationADefinition() + && constructorDecl->getBody() != nullptr; if (isMove) { m_ConstructorThrows.push_back(false); @@ -115,7 +116,7 @@ bool NoExceptMove::TraverseCXXMethodDecl(CXXMethodDecl* methodDecl) bool isMove = methodDecl->isMoveAssignmentOperator() && methodDecl->getExceptionSpecType() == EST_None && !methodDecl->isDefaulted() && !methodDecl->isDeleted() && !ignoreLocation(methodDecl) - && methodDecl->isThisDeclarationADefinition(); + && methodDecl->isThisDeclarationADefinition() && methodDecl->getBody() != nullptr; if (isMove) { StringRef fn = getFileNameOfSpellingLoc(