[clang] [C23] Use thread_local semantics (PR #70107)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 12:49:46 PDT 2023


================
@@ -4076,8 +4076,15 @@ void Parser::ParseDeclarationSpecifiers(
     case tok::kw_thread_local:
       if (getLangOpts().C23)
         Diag(Tok, diag::warn_c23_compat_keyword) << Tok.getName();
-      isInvalid = DS.SetStorageClassSpecThread(DeclSpec::TSCS_thread_local, Loc,
-                                               PrevSpec, DiagID);
+      // We map thread_local to _Thread_local in C23 mode so it retains the C
+      // semantics rather than getting the C++ semantics.
+      // FIXME: diagnostics will now show _Thread_local when the user wrote
----------------
AaronBallman wrote:

This should be fixed now.

https://github.com/llvm/llvm-project/pull/70107


More information about the cfe-commits mailing list