// RUN: %clang_cc1 -fsyntax-only -std=c++23 -verify %s namespace GH140509 { template void not_instantiated() { static __thread T my_wrapper; } template void instantiated() { static __thread T my_wrapper = T{}; // expected-error {{initializer for thread-local variable must be a constant expression}} \ expected-note {{use 'thread_local' to allow this}} } template void nondependent_var() { // Verify that the dependence of the initializer is what really matters. static __thread int my_wrapper = T{}; } struct S { S() {} }; void f() { instantiated(); instantiated(); // expected-note {{in instantiation of function template specialization 'GH140509::instantiated' requested here}} nondependent_var(); } } // namespace GH140509