[PATCH] D74361: [Clang] Undef attribute for global variables

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 18:33:42 PST 2020


JonChesterfield added a comment.

I'm finally happy with the semantic checks here. Thanks for the guidance on where to look for the hooks.

- attributed variable must be at global scope
- all initializers are rejected
- default constructors must be trivial (to reduce the scope of this patch)
- extern variables rejected as they can't meaningfully have a definition
- attribute on a declaration following a normal definition in C rejected

Patch is a bit bigger than I hoped for but quite self contained. Everything is guarded by a test on the attribute.

@Quuxplusone does restricting this to trivial default construction resolve your concerns?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74361





More information about the cfe-commits mailing list