[PATCH] D78693: Make "#pragma clang attribute" support uninitialized attribute.

JF Bastien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 10:16:06 PDT 2020


jfb accepted this revision.
jfb added inline comments.


================
Comment at: clang/test/Parser/pragma-attribute.cpp:190
+#pragma clang attribute pop
+#pragma clang attribute push([[clang::uninitialized]], apply_to = variable) // expected-error {{attribute 'uninitialized' can't be applied to 'variable'}}
+#pragma clang attribute pop
----------------
aaron.ballman wrote:
> jfb wrote:
> > Should variable work? Since it’s a superset of local it seems like maybe? But then again only local works, so ok not sure. 
> I think this is correct. Requiring an explicit `is_local` here is a conservative approach. It means we can start supporting `[[clang::uninitialized]]` in other contexts without breaking code that uses `#pragma clang attribute` to apply it to more entities unexpectedly.
That makes sense, thanks for confirming!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78693/new/

https://reviews.llvm.org/D78693





More information about the cfe-commits mailing list