File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,10 @@ void UseInternalLinkageCheck::registerMatchers(MatchFinder *Finder) {
130130 isMain ())))
131131 .bind (" fn" ),
132132 this );
133- Finder->addMatcher (varDecl (Common, hasGlobalStorage ()).bind (" var" ), this );
133+ Finder->addMatcher (
134+ varDecl (Common, hasGlobalStorage (), unless (hasThreadStorageDuration ()))
135+ .bind (" var" ),
136+ this );
134137}
135138
136139static constexpr StringRef Message =
Original file line number Diff line number Diff line change @@ -159,7 +159,9 @@ Changes in existing checks
159159
160160- Improved :doc: `misc-use-internal-linkage
161161 <clang-tidy/checks/misc/use-internal-linkage>` check by fix false positives
162- for function or variable in header file which contains macro expansion.
162+ for function or variable in header file which contains macro expansion and
163+ excluding variables with ``thread_local `` storage class specifier from being
164+ matched.
163165
164166- Improved :doc: `modernize-use-default-member-init
165167 <clang-tidy/checks/modernize/use-default-member-init>` check by matching
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ extern int global_extern;
3131
3232static int global_static;
3333
34+ thread_local int global_thread_local;
35+
3436namespace {
3537static int global_anonymous_ns;
3638namespace NS {
@@ -41,6 +43,7 @@ static int global_anonymous_ns;
4143static void f (int para) {
4244 int local;
4345 static int local_static;
46+ thread_local int local_thread_local;
4447}
4548
4649struct S {
You can’t perform that action at this time.
0 commit comments