EricWF marked 3 inline comments as done.

================
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>`_
----------------
aaron.ballman wrote:
> I don't think I ever heard whether this attribute was usable in C or not. I 
> suspect it's not particularly needed in C. If that's true, we should state 
> that in the documentation, and consider making the attribute a C++-only 
> attribute?
I think it would be somewhat useful in C.  In particular if you have globals 
initialized from values you don't own. Example:

```
#include <y.h>
ATTR int x = y; // Will diagnose if  becomes 'y' is a non-constant expression.
```

However the current implementation only handles C++ and I'm satisfied with 
that. I'll mark the attribute as C++ only and document that change.


https://reviews.llvm.org/D23385



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to