This revision was automatically updated to reflect the committed changes. Closed by commit rGfc5f14c5fe78: [clang-tidy] Ignore declarations in bugprone-exception-escape (authored by PiotrZSL).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148462/new/ https://reviews.llvm.org/D148462 Files: clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp @@ -655,7 +655,6 @@ } int indirectly_recursive(int n) noexcept; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'indirectly_recursive' which should not throw exceptions int recursion_helper(int n) { indirectly_recursive(n); Index: clang-tools-extra/docs/ReleaseNotes.rst =================================================================== --- clang-tools-extra/docs/ReleaseNotes.rst +++ clang-tools-extra/docs/ReleaseNotes.rst @@ -201,6 +201,10 @@ <clang-tidy/checks/bugprone/dynamic-static-initializers>` check. Global options of the same name should be used instead. +- Improved :doc:`bugprone-exception-escape + <clang-tidy/checks/bugprone/exception-escape>` to not emit warnings for + forward declarations of functions. + - Improved :doc:`bugprone-fold-init-type <clang-tidy/checks/bugprone/fold-init-type>` to handle iterators that do not define `value_type` type aliases. Index: clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp @@ -52,7 +52,8 @@ void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( - functionDecl(anyOf(isNoThrow(), cxxDestructorDecl(), + functionDecl(isDefinition(), + anyOf(isNoThrow(), cxxDestructorDecl(), cxxConstructorDecl(isMoveConstructor()), cxxMethodDecl(isMoveAssignmentOperator()), hasName("main"), hasName("swap"),
Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp @@ -655,7 +655,6 @@ } int indirectly_recursive(int n) noexcept; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'indirectly_recursive' which should not throw exceptions int recursion_helper(int n) { indirectly_recursive(n); Index: clang-tools-extra/docs/ReleaseNotes.rst =================================================================== --- clang-tools-extra/docs/ReleaseNotes.rst +++ clang-tools-extra/docs/ReleaseNotes.rst @@ -201,6 +201,10 @@ <clang-tidy/checks/bugprone/dynamic-static-initializers>` check. Global options of the same name should be used instead. +- Improved :doc:`bugprone-exception-escape + <clang-tidy/checks/bugprone/exception-escape>` to not emit warnings for + forward declarations of functions. + - Improved :doc:`bugprone-fold-init-type <clang-tidy/checks/bugprone/fold-init-type>` to handle iterators that do not define `value_type` type aliases. Index: clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp @@ -52,7 +52,8 @@ void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( - functionDecl(anyOf(isNoThrow(), cxxDestructorDecl(), + functionDecl(isDefinition(), + anyOf(isNoThrow(), cxxDestructorDecl(), cxxConstructorDecl(isMoveConstructor()), cxxMethodDecl(isMoveAssignmentOperator()), hasName("main"), hasName("swap"),
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits