11 #include "../utils/Matchers.h"
12 #include "clang/AST/ASTContext.h"
13 #include "clang/ASTMatchers/ASTMatchFinder.h"
15 using namespace clang::ast_matchers;
21 void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *
Finder) {
22 if (!getLangOpts().CPlusPlus)
26 cxxThrowExpr(has(ignoringParenImpCasts(
27 cxxConstructExpr(hasDeclaration(cxxConstructorDecl(
28 isCopyConstructor(), unless(isNoThrow()))))
33 void ThrownExceptionTypeCheck::check(
const MatchFinder::MatchResult &
Result) {
34 const auto *E = Result.Nodes.getNodeAs<Expr>(
"expr");
36 "thrown exception type is not nothrow copy constructible");
std::unique_ptr< ast_matchers::MatchFinder > Finder