20 unless(has(expr(anyOf(isTypeDependent(), isValueDependent())))),
23 hasType(qualType(hasCanonicalType(hasDeclaration(cxxRecordDecl(
24 isSameOrDerivedFrom(hasName(
"::std::exception")))))))))),
28 expr(hasType(substTemplateTypeParmType().bind(
"templ_type"))))),
32 optionally(has(expr(hasType(namedDecl().bind(
"decl"))))))
38 const auto *BadThrow = Result.Nodes.getNodeAs<CXXThrowExpr>(
"bad_throw");
39 assert(BadThrow &&
"Did not match the throw expression");
41 diag(BadThrow->getSubExpr()->getBeginLoc(),
"throwing an exception whose "
42 "type %0 is not derived from "
44 << BadThrow->getSubExpr()->getType() << BadThrow->getSourceRange();
47 Result.Nodes.getNodeAs<SubstTemplateTypeParmType>(
"templ_type"))
48 diag(BadThrow->getSubExpr()->getBeginLoc(),
49 "type %0 is a template instantiation of %1", DiagnosticIDs::Note)
50 << BadThrow->getSubExpr()->getType()
53 if (
const auto *TypeDecl = Result.Nodes.getNodeAs<NamedDecl>(
"decl"))
54 diag(TypeDecl->getBeginLoc(),
"type defined here", DiagnosticIDs::Note);