Support GCC [[gnu::attributes]] in C2x mode
authorAaron Ballman <aaron@aaronballman.com>
Mon, 1 Jun 2020 14:39:38 +0000 (10:39 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 1 Jun 2020 14:42:42 +0000 (10:42 -0400)
commit522934da1f0c78c1de1a80d4ba14204a11f5afa8
tree05c9d2e0e887fbe30793415ead9631de3d02bb63
parent8a84158e5b966236c0e090cd5c7f44dab69e59a8
Support GCC [[gnu::attributes]] in C2x mode

GCC 10.1 introduced support for the [[]] style spelling of attributes in C
mode. Similar to how GCC supports __attribute__((foo)) as [[gnu::foo]] in
C++ mode, it now supports the same spelling in C mode as well. This patch
makes a change in Clang so that when you use the GCC attribute spelling,
the attribute is automatically available in all three spellings by default.
However, like Clang, GCC has some attributes it only recognizes in C++ mode
(specifically, abi_tag and init_priority), which this patch also honors.
clang/include/clang/Basic/Attr.td
clang/test/Sema/attr-c2x.c
clang/utils/TableGen/ClangAttrEmitter.cpp