20 return Node.isConstantInitializer(Finder->getASTContext(),
false);
24 return Node.getStorageDuration() == SD_Static && !Node.isLocalVarDecl();
28 void StaticallyConstructedObjectsCheck::registerMatchers(MatchFinder *Finder) {
34 if (!getLangOpts().CPlusPlus11)
42 hasDescendant(cxxConstructExpr(unless(allOf(
44 hasDeclaration(cxxConstructorDecl(isConstexpr())),
46 isConstantInitializer()))))))
51 void StaticallyConstructedObjectsCheck::check(
52 const MatchFinder::MatchResult &Result) {
53 if (
const auto *D = Result.Nodes.getNodeAs<VarDecl>(
"decl"))
54 diag(D->getLocStart(),
"static objects are disallowed; if possible, use a " 55 "constexpr constructor instead");
AST_MATCHER(BinaryOperator, isAssignmentOperator)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//