[all-commits] [llvm/llvm-project] 522934: Support GCC [[gnu::attributes]] in C2x mode

AaronBallman via All-commits all-commits at lists.llvm.org
Mon Jun 1 07:43:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 522934da1f0c78c1de1a80d4ba14204a11f5afa8
      https://github.com/llvm/llvm-project/commit/522934da1f0c78c1de1a80d4ba14204a11f5afa8
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2020-06-01 (Mon, 01 Jun 2020)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/test/Sema/attr-c2x.c
    M clang/utils/TableGen/ClangAttrEmitter.cpp

  Log Message:
  -----------
  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.




More information about the All-commits mailing list