[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added a reviewer: rsmith. Herald added a project: clang. We currently accept use of _Thread_local in all C and C++ modes, but we do not issue a warning about it being an extension when used outside of C11 mode. This patch adds the warning and ad

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-16 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. `_Thread_local` is a reserved identifier; we generally don't produce extension warnings for uses of reserved identifiers. (Eg, there's no warning for `_Atomic` in C++ or `_Bool` in C89, and no warning for uses of `__type_traits` or `__builtins`.) But I note that we *do*

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D66364#1633775 , @rsmith wrote: > `_Thread_local` is a reserved identifier; we generally don't produce > extension warnings for uses of reserved identifiers. (Eg, there's no warning > for `_Atomic` in C++ or `_Bool` in C

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-19 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D66364#1633981 , @aaron.ballman wrote: > My motivation is for portability. _Thread_local (and all the rest) do not > exist in C99 or earlier (or C++), so having some way to warn users of that is > useful. I agree that we shoul

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: mclow.lists, ldionne. aaron.ballman added a comment. Herald added a subscriber: dexonsmith. In D66364#1635795 , @rsmith wrote: > In D66364#1633981 , @aaron.ballman > wrote: > > > My m

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-19 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment. In D66364#1635814 , @aaron.ballman wrote: > [ ...] > > Adding some libc++ maintainers to see if they have opinions. > > `__extension__` is one option. Could we get away with push/pop disabling of > the diagnostic? Or perhaps this

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D66364#1635863 , @ldionne wrote: > In D66364#1635814 , @aaron.ballman > wrote: > > > [ ...] > > > > Adding some libc++ maintainers to see if they have opinions. > > > > `__extensio

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-20 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment. In D66364#1637570 , @aaron.ballman wrote: > In D66364#1635863 , @ldionne wrote: > > > In D66364#1635814 , @aaron.ballman > > wrote: > > > > > [ ...

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. @rsmith are you fine with implementing the diagnostic for these keywords piecemeal based on the pattern from this patch, or do you want to see an omnibus patch that adds all of them at once? In D66364#1637635 , @ldionne wro

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-23 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. In D66364#1638026 , @aaron.ballman wrote: > @rsmith are you fine with implementing the diagnostic for these keywords > piecemeal based on the pattern

[PATCH] D66364: Diagnose use of _Thread_local as an extension when appropriate

2019-08-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Committed in r369954 Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:130 +def ext_c11_feature : Extension< "%0 is a C11-specific feature">, InGrou