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

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 12:28:57 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
----------------
cor3ntin wrote:

```suggestion
      // FIXME: diagnostics will show _Thread_local when the user wrote
```


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


More information about the cfe-commits mailing list