[PATCH] D63451: P0840R2: support for [[no_unique_address]] attribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 08:38:24 PDT 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

The attribute parts LGTM! You can change the `TargetItaniumCXXABI` part in a follow-up commit if you'd prefer.



================
Comment at: lib/AST/Decl.cpp:3945
+        return false;
+  }
+
----------------
rjmccall wrote:
> rsmith wrote:
> > rjmccall wrote:
> > > Is this a C/C++ modules interaction?
> > We don't allow C modules to be imported into C++ compilations or vice versa, so this should be unreachable unless we start allowing the attribute in C. Nice catch.
> > 
> > I guess the question is, then: should we allow this attribute in C (either with a GNU `__attribute__` spelling or as a C20 `[[clang::attribute]]`)? I don't think it's really useful in C (empty structs are ill-formed, and you can't reuse tail padding because structs are always trivial, at least in standard C), so I'm inclined to say no.
> I agree that it seems relatively useless in C, and there's no reason to think they'd use this language design if they decided they did want it.
Agreed that this makes no sense in C. I was not planning on proposing this to WG14 because I couldn't think of a use case for it.


Repository:
  rC Clang

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

https://reviews.llvm.org/D63451





More information about the cfe-commits mailing list