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

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 30 17:20:38 PDT 2016


EricWF 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>`_
----------------
rsmith wrote:
> 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.
Ah I didn't know that! 


https://reviews.llvm.org/D23385





More information about the cfe-commits mailing list