czhang marked an inline comment as done. czhang added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp:39 + return; + Finder->addMatcher(varDecl(hasGlobalStorage()).bind("var"), this); +} ---------------- aaron.ballman wrote: > Do you want to restrict this matcher to only variable declarations that have > initializers, or are you also intending for this check to cover cases like: > ``` > // At file scope. > struct S { S(); } s; > ``` I think only variables with static storage are relevant to the stated goal of the checker. ================ Comment at: clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp:55 + SourceLocation Loc = Var->getLocation(); + if (!Loc.isValid() || !utils::isPresumedLocInHeaderFile(Loc, *Result.SourceManager, + HeaderFileExtensions)) ---------------- aaron.ballman wrote: > We have an AST matcher for this (`isExpansionInSystemHeader()`). Isn't this for system headers only, not just included 'user' headers? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62829/new/ https://reviews.llvm.org/D62829 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits