[PATCH] D110485: Support [[no_unique_address]] for all targets.

cqwrteur via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 27 20:12:11 PDT 2021


expnkx updated this revision to Diff 375461.
expnkx added a comment.

I just find that Preprocessor test has a windows (msvc not gnu) specific test that tests no_unique_address.

add that to patch and see whether it is mergable.


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

https://reviews.llvm.org/D110485

Files:
  clang/include/clang/Basic/Attr.td
  clang/test/Preprocessor/has_attribute.cpp
  clang/test/SemaCXX/cxx2a-no-unique-address.cpp


Index: clang/test/SemaCXX/cxx2a-no-unique-address.cpp
===================================================================
--- clang/test/SemaCXX/cxx2a-no-unique-address.cpp
+++ clang/test/SemaCXX/cxx2a-no-unique-address.cpp
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -std=c++2a %s -verify -triple x86_64-linux-gnu
-// RUN: %clang_cc1 -std=c++2a %s -verify=unsupported -triple x86_64-windows
 
 [[no_unique_address]] int a; // expected-error {{only applies to non-bit-field non-static data members}} unsupported-warning {{unknown}}
 [[no_unique_address]] void f(); // expected-error {{only applies to non-bit-field non-static data members}} unsupported-warning {{unknown}}
Index: clang/test/Preprocessor/has_attribute.cpp
===================================================================
--- clang/test/Preprocessor/has_attribute.cpp
+++ clang/test/Preprocessor/has_attribute.cpp
@@ -64,8 +64,7 @@
 // CHECK: fallthrough: 201603L
 // CHECK: likely: 201803L
 // CHECK: maybe_unused: 201603L
-// ITANIUM: no_unique_address: 201803L
-// WINDOWS: no_unique_address: 0
+// CHECK: no_unique_address: 201803L
 // CHECK: nodiscard: 201907L
 // CHECK: noreturn: 200809L
 // CHECK: unlikely: 201803L
Index: clang/include/clang/Basic/Attr.td
===================================================================
--- clang/include/clang/Basic/Attr.td
+++ clang/include/clang/Basic/Attr.td
@@ -1686,7 +1686,7 @@
   let Documentation = [ArmMveStrictPolymorphismDocs];
 }
 
-def NoUniqueAddress : InheritableAttr, TargetSpecificAttr<TargetItaniumCXXABI> {
+def NoUniqueAddress : InheritableAttr {
   let Spellings = [CXX11<"", "no_unique_address", 201803>];
   let Subjects = SubjectList<[NonBitField], ErrorDiag>;
   let Documentation = [NoUniqueAddressDocs];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110485.375461.patch
Type: text/x-patch
Size: 1738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210928/acd13f45/attachment.bin>


More information about the cfe-commits mailing list