19 return Node.isConstantInitializer(Finder->getASTContext(),
false);
23 return Node.getStorageDuration() == SD_Static && !Node.isLocalVarDecl();
27 void StaticallyConstructedObjectsCheck::registerMatchers(MatchFinder *Finder) {
33 if (!getLangOpts().CPlusPlus11)
36 Finder->addMatcher(varDecl(
40 hasDescendant(cxxConstructExpr(unless(allOf(
42 hasDeclaration(cxxConstructorDecl(isConstexpr())),
44 isConstantInitializer())))))
49 void StaticallyConstructedObjectsCheck::check(
50 const MatchFinder::MatchResult &Result) {
51 if (
const auto *D = Result.Nodes.getNodeAs<VarDecl>(
"decl"))
52 diag(D->getBeginLoc(),
"static objects are disallowed; if possible, use a " 53 "constexpr constructor instead");
AST_MATCHER(Expr, isMacroID)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//