[PATCH] D122874: [clang] Add GNU spelling for no_unqiue_address attribute

Nikolas Klauser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 23:58:30 PDT 2022


philnik created this revision.
philnik added reviewers: aaron.ballman, rsmith, RKSimon.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

libc++ wants to switch from `__compressed_pair` to using `no_unique_address`. That is currently not possible, because there is no way to get the behaviour of `no_unique_address` in C++03. Adding the `__attribute__` spelling allows libc++ to switch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122874

Files:
  clang/include/clang/Basic/Attr.td


Index: clang/include/clang/Basic/Attr.td
===================================================================
--- clang/include/clang/Basic/Attr.td
+++ clang/include/clang/Basic/Attr.td
@@ -1701,7 +1701,7 @@
 }
 
 def NoUniqueAddress : InheritableAttr, TargetSpecificAttr<TargetItaniumCXXABI> {
-  let Spellings = [CXX11<"", "no_unique_address", 201803>];
+  let Spellings = [GNU<"no_unique_address">, CXX11<"", "no_unique_address", 201803>];
   let Subjects = SubjectList<[NonBitField], ErrorDiag>;
   let Documentation = [NoUniqueAddressDocs];
   let SimpleHandler = 1;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122874.419644.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220401/3582a594/attachment.bin>


More information about the cfe-commits mailing list