summaryrefslogtreecommitdiff
path: root/docs/LanguageExtensions.rst
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2018-10-29 03:24:16 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2018-10-29 03:24:16 +0000
commit8029b38886dd239769e3501dac21438e16886ce8 (patch)
treed103dc9a8c2df26618feab729ff296c9cde9bad9 /docs/LanguageExtensions.rst
parent6f1373c1983ea5eb6e0853ae16621e5c0c348df2 (diff)
downloadclang-8029b38886dd239769e3501dac21438e16886ce8.tar.gz
Revert "Support for groups of attributes in #pragma clang attribute"
This reverts commit r345486. Looks like it causes some old versions of GCC to crash, I'll see if I can work around it and recommit... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LanguageExtensions.rst')
-rw-r--r--docs/LanguageExtensions.rst16
1 files changed, 7 insertions, 9 deletions
diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst
index 506d273689..894b7504fd 100644
--- a/docs/LanguageExtensions.rst
+++ b/docs/LanguageExtensions.rst
@@ -2651,19 +2651,17 @@ Specifying an attribute for multiple declarations (#pragma clang attribute)
The ``#pragma clang attribute`` directive can be used to apply an attribute to
multiple declarations. The ``#pragma clang attribute push`` variation of the
-directive pushes a new "scope" of ``#pragma clang attribute`` that attributes
-can be added to. The ``#pragma clang attribute (...)`` variation adds an
-attribute to that scope, and the ``#pragma clang attribute pop`` variation pops
-the scope. You can also use ``#pragma clang attribute push (...)``, which is a
-shorthand for when you want to add one attribute to a new scope. Multiple push
-directives can be nested inside each other.
+directive pushes a new attribute to the attribute stack. The declarations that
+follow the pragma receive the attributes that are on the attribute stack, until
+the stack is cleared using a ``#pragma clang attribute pop`` directive. Multiple
+push directives can be nested inside each other.
The attributes that are used in the ``#pragma clang attribute`` directives
can be written using the GNU-style syntax:
.. code-block:: c++
- #pragma clang attribute push (__attribute__((annotate("custom"))), apply_to = function)
+ #pragma clang attribute push(__attribute__((annotate("custom"))), apply_to = function)
void function(); // The function now has the annotate("custom") attribute
@@ -2673,7 +2671,7 @@ The attributes can also be written using the C++11 style syntax:
.. code-block:: c++
- #pragma clang attribute push ([[noreturn]], apply_to = function)
+ #pragma clang attribute push([[noreturn]], apply_to = function)
void function(); // The function now has the [[noreturn]] attribute
@@ -2683,7 +2681,7 @@ The ``__declspec`` style syntax is also supported:
.. code-block:: c++
- #pragma clang attribute push (__declspec(dllexport), apply_to = function)
+ #pragma clang attribute push(__declspec(dllexport), apply_to = function)
void function(); // The function now has the __declspec(dllexport) attribute