10 #include "../utils/Matchers.h"
11 #include "clang/AST/ASTContext.h"
12 #include "clang/ASTMatchers/ASTMatchFinder.h"
20 void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) {
23 ast_type_traits::TK_AsIs,
24 cxxThrowExpr(has(ignoringParenImpCasts(
25 cxxConstructExpr(hasDeclaration(cxxConstructorDecl(
26 isCopyConstructor(), unless(isNoThrow()))))
31 void ThrownExceptionTypeCheck::check(
const MatchFinder::MatchResult &Result) {
32 const auto *
E = Result.Nodes.getNodeAs<Expr>(
"expr");
34 "thrown exception type is not nothrow copy constructible");