New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C23 thread_local is mapping to C++ thread_local, not C11 _Thread_local #70068
Comments
@llvm/issue-subscribers-c Author: Mariya Podchishchaeva (Fznamznon)
Per 6.7.1 p4
> In the declaration of an object with block scope, if the declaration specifiers include thread_local,
they shall also include either static or extern.
gcc does complain. Online demo https://godbolt.org/z/YorncrhKW cc @AaronBallman |
@llvm/issue-subscribers-clang-frontend Author: Mariya Podchishchaeva (Fznamznon)
Per 6.7.1 p4
> In the declaration of an object with block scope, if the declaration specifiers include thread_local,
they shall also include either static or extern.
gcc does complain. Online demo https://godbolt.org/z/YorncrhKW cc @AaronBallman |
@llvm/issue-subscribers-c11 Author: Mariya Podchishchaeva (Fznamznon)
Per 6.7.1 p4
> In the declaration of an object with block scope, if the declaration specifiers include thread_local,
they shall also include either static or extern.
gcc does complain. Online demo https://godbolt.org/z/YorncrhKW cc @AaronBallman |
The root cause of this is that we enabled |
When implementing thread_local as a keyword in C23, we accidentally started using C++11 thread_local semantics when using that keyword instead of using C11 _Thread_local semantics. This oversight is fixed by pretending the user wrote _Thread_local instead. This doesn't have the best behavior in terms of diagnostics, but it does correct the semantic behavior. Fixes llvm#70068
When implementing thread_local as a keyword in C23, we accidentally started using C++11 thread_local semantics when using that keyword instead of using C11 _Thread_local semantics. This oversight is fixed by pretending the user wrote _Thread_local instead. This doesn't have the best behavior in terms of diagnostics, but it does correct the semantic behavior. Fixes #70068 Fixes #69167
When implementing thread_local as a keyword in C23, we accidentally started using C++11 thread_local semantics when using that keyword instead of using C11 _Thread_local semantics. This oversight is fixed by pretending the user wrote _Thread_local instead. This doesn't have the best behavior in terms of diagnostics, but it does correct the semantic behavior. Fixes llvm#70068 Fixes llvm#69167
When implementing thread_local as a keyword in C23, we accidentally started using C++11 thread_local semantics when using that keyword instead of using C11 _Thread_local semantics. This oversight is fixed by pretending the user wrote _Thread_local instead. This doesn't have the best behavior in terms of diagnostics, but it does correct the semantic behavior. Fixes llvm/llvm-project#70068 Fixes llvm/llvm-project#69167
Per 6.7.1 p4
gcc does complain.
Online demo https://godbolt.org/z/YorncrhKW
cc @AaronBallman
The text was updated successfully, but these errors were encountered: