Index: clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp @@ -26,7 +26,7 @@ isSameOrDerivedFrom(matchesName("[Ee]xception|EXCEPTION")))), unless(anyOf(hasAncestor(stmt( anyOf(cxxThrowExpr(), callExpr(), returnStmt()))), - hasAncestor(varDecl()), + hasAncestor(decl(anyOf(varDecl(), fieldDecl()))), allOf(hasAncestor(CtorInitializerList), unless(hasAncestor(cxxCatchStmt())))))) .bind("temporary-exception-not-thrown"), Index: clang-tools-extra/test/clang-tidy/checkers/bugprone-throw-keyword-missing.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone-throw-keyword-missing.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone-throw-keyword-missing.cpp @@ -118,6 +118,7 @@ class CtorInitializerListTest { RegularException exc; + RegularException exc2{}; CtorInitializerListTest() : exc(RegularException()) {}