]> granicus.if.org Git - clang/commitdiff
Touch up [[clang::require_constant_initialization]] docs
authorEric Fiselier <eric@efcs.ca>
Fri, 16 Sep 2016 10:04:38 +0000 (10:04 +0000)
committerEric Fiselier <eric@efcs.ca>
Fri, 16 Sep 2016 10:04:38 +0000 (10:04 +0000)
* Fix an egregious comma usage.
* Remove the `static` keyword in the example since the variables should have
  external linkage.
* Use C++11 attributes in the example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281712 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/AttrDocs.td

index 5caced80c2b2752970968d0febb9d4f69d531a41..0f0111474fc1f6ce87d6aaa40d46d201b43fe66f 100644 (file)
@@ -843,7 +843,7 @@ This attribute specifies that the variable to which it is attached is intended
 to have a `constant initializer <http://en.cppreference.com/w/cpp/language/constant_initialization>`_
 according to the rules of [basic.start.static]. The variable is required to
 have static or thread storage duration. If the initialization of the variable
-is not a constant initializer, an error will be produced. This attribute may
+is not a constant initializer an error will be produced. This attribute may
 only be used in C++.
 
 Note that in C++03 strict constant expression checking is not done. Instead
@@ -862,7 +862,7 @@ of silently falling back on dynamic initialization.
 .. code-block:: c++
 
   // -std=c++14
-  #define SAFE_STATIC __attribute__((require_constant_initialization)) static
+  #define SAFE_STATIC [[clang::require_constant_initialization]]
   struct T {
     constexpr T(int) {}
     ~T(); // non-trivial