r281712 - Touch up [[clang::require_constant_initialization]] docs
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 16 03:04:38 PDT 2016
Author: ericwf
Date: Fri Sep 16 05:04:38 2016
New Revision: 281712
URL: http://llvm.org/viewvc/llvm-project?rev=281712&view=rev
Log:
Touch up [[clang::require_constant_initialization]] docs
* 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.
Modified:
cfe/trunk/include/clang/Basic/AttrDocs.td
Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=281712&r1=281711&r2=281712&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
+++ cfe/trunk/include/clang/Basic/AttrDocs.td Fri Sep 16 05:04:38 2016
@@ -843,7 +843,7 @@ This attribute specifies that the variab
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 init
.. 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
More information about the cfe-commits
mailing list