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

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 12 06:29:20 PDT 2016


EricWF added inline comments.

================
Comment at: include/clang/Basic/Attr.td:1384
@@ +1383,3 @@
+def RequireConstantInit : InheritableAttr {
+  let Spellings = [GCC<"require_constant_initialization">];
+  let Subjects = SubjectList<[Var]>;
----------------
aaron.ballman wrote:
> This should not use the GCC spelling because GCC doesn't support the attribute. Do you expect this attribute to do anything useful in C? If not, this should just be a CXX11 spelling in the clang namespace.
Are CXX11 attributes usable in C++03? If not perhaps we should provide both?

================
Comment at: test/SemaCXX/attr-require-constant-initialization.cpp:4-6
@@ +3,5 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -std=c++14 %s
+//
+// Tests for "expression traits" intrinsics such as __is_lvalue_expr.
+//
+
----------------
aaron.ballman wrote:
> Does this comment actually apply?
No. 


https://reviews.llvm.org/D23385





More information about the cfe-commits mailing list