[PATCH] D62829: [clang-tidy] Check for dynamically initialized statics in headers.
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 5 09:45:03 PDT 2019
lebedev.ri added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp:47
+void DynamicStaticInitializersCheck::registerMatchers(MatchFinder *Finder) {
+ if (!getLangOpts().CPlusPlus || getLangOpts().ThreadsafeStatics)
+ return;
----------------
czhang wrote:
> aaron.ballman wrote:
> > Why is this check disabled for C++? I would expect dynamic init of a static in a C++ header file would be flagged by this check.
> I'm confused now. If the language is not C++, we do an early return; that is, the check is run if we are on C++. Perhaps the early return is too confusing?
Then the question is opposite, is this meaningless for C?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62829/new/
https://reviews.llvm.org/D62829
More information about the cfe-commits
mailing list