Skip to content

Commit 2e9bafe

Browse files
committed
Add test
1 parent 7a919e2 commit 2e9bafe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/test/SemaCXX/unique_object_duplication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ inline void has_thread_local() {
9999
thread_local int disallowedThreadLocal = 0; // hidden-warning {{'disallowedThreadLocal' may be duplicated when built into a shared library: it is mutable, has hidden visibility, and external linkage}}
100100
}
101101

102+
// Functions themselves are always immutable, so referencing them is okay
103+
inline auto& allowedFunctionReference = has_static_locals_external;
104+
102105
} // namespace StaticLocalTest
103106

104107
/******************************************************************************

0 commit comments

Comments
 (0)