[PATCH] D23385: Implement __attribute__((require_constant_initialization)) for safe static initialization.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 30 17:03:55 PDT 2016


rsmith added inline comments.

================
Comment at: include/clang/Basic/AttrDocs.td:836
@@ +835,3 @@
+  let Content = [{
+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>`_
----------------
For the record, in C the program is ill-formed if the initializer for a global is non-constant, so it doesn't seem like this attribute would ever be useful.


https://reviews.llvm.org/D23385





More information about the cfe-commits mailing list