Skip to content

Commit

Permalink
Harmonize GNU- and C++-style attribute spellings.
Browse files Browse the repository at this point in the history
Most attributes will now use the Clang<"name"> construct to provide both __attribute__((name)) and [[clang::name]] syntaxes for the attribute. Attributes deviating from this should be marked with a comment explaining why they are not supported under both spellings. Common reasons are: the attribute is provided by some other specification that controls the syntax or the attribute cannot be exposed under a particular spelling for some given reason.

Because this is a mechanical change that only introduces new spellings, there are no test cases for the commit.

llvm-svn: 320752
  • Loading branch information
AaronBallman committed Dec 14, 2017
1 parent d15d76e commit 802de4f
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 87 deletions.
6 changes: 6 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ Clang now supports the ...
Attribute Changes in Clang
--------------------------

- Clang now supports the majority of its attributes under both the GNU-style
spelling (``__attribute((name))``) and the double square-bracket spelling
in the ``clang`` vendor namespace (``[[clang::name]]``). Attributes whose
syntax is specified by some other standard (such as CUDA and OpenCL
attributes) continue to follow their respective specification.

- Added the ``__has_c_attribute()`` builtin preprocessor macro which allows
users to dynamically detect whether a double square-bracket attribute is
supported in C mode. This attribute syntax can be enabled with the
Expand Down
Loading

0 comments on commit 802de4f

Please sign in to comment.