[clang-tidy] fix PR39167, bugprone-exception-escape hangs-up
Summary: The check bugprone-exception-escape should not register if -fno-exceptions is set for the compile options. Bailing out on non-cplusplus and non-exceptions language options resolves the issue. Reviewers: alexfh, aaron.ballman, baloghadamsoftware Reviewed By: alexfh Subscribers: lebedev.ri, xazax.hun, rnkovacs, cfe-commits Differential Revision: https://reviews.llvm.org/D52880 llvm-svn: 343789
This commit is contained in:
parent
c97671e5da
commit
9b1cc0121c
|
@ -186,6 +186,9 @@ void ExceptionEscapeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
|
|||
}
|
||||
|
||||
void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) {
|
||||
if (!getLangOpts().CPlusPlus || !getLangOpts().CXXExceptions)
|
||||
return;
|
||||
|
||||
Finder->addMatcher(
|
||||
functionDecl(allOf(throws(unless(isIgnored(IgnoredExceptions))),
|
||||
anyOf(isNoThrow(), cxxDestructorDecl(),
|
||||
|
|
Loading…
Reference in New Issue