diff options
author | Florian Mayer <fmayer@google.com> | 2024-02-23 11:31:09 -0800 |
---|---|---|
committer | Florian Mayer <fmayer@google.com> | 2024-02-23 11:31:09 -0800 |
commit | 8d536f83545f071948888983e2db25ce23a8302d (patch) | |
tree | b46a6c218f811753e98cb07c725c9e9f03224780 /clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp | |
parent | 214e60250987ad1f305a0fa6a823093d5247ee77 (diff) | |
parent | 6dd6d487d012a9000fe975133b7935c1f8c658eb (diff) | |
download | llvm-users/fmayer/sprmain.scudo-allow-to-resize-allocation-ring-buffer.zip llvm-users/fmayer/sprmain.scudo-allow-to-resize-allocation-ring-buffer.tar.gz llvm-users/fmayer/sprmain.scudo-allow-to-resize-allocation-ring-buffer.tar.bz2 |
[𝘀𝗽𝗿] changes introduced through rebaseusers/fmayer/sprmain.scudo-allow-to-resize-allocation-ring-buffer
Created using spr 1.3.4
[skip ci]
Diffstat (limited to 'clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp b/clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp index 4205855..822ed75 100644 --- a/clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp +++ b/clang/test/SemaCXX/cxx2a-ms-no-unique-address.cpp @@ -17,3 +17,28 @@ struct [[msvc::no_unique_address]] S { // expected-error {{only applies to non-b int [[msvc::no_unique_address]] c; // expected-error {{cannot be applied to types}} unsupported-error {{cannot be applied to types}} }; + +struct CStructNoUniqueAddress { + int one; + [[no_unique_address]] int two; + // expected-warning@-1 {{unknown attribute 'no_unique_address' ignored}} +}; + +struct CStructMSVCNoUniqueAddress { + int one; + [[msvc::no_unique_address]] int two; + // unsupported-warning@-1 {{unknown attribute 'no_unique_address' ignored}} +}; + +struct CStructMSVCNoUniqueAddress2 { + int one; + [[msvc::no_unique_address]] int two; + // unsupported-warning@-1 {{unknown attribute 'no_unique_address' ignored}} +}; + +static_assert(__has_cpp_attribute(no_unique_address) == 0); +// unsupported-error@-1 {{static assertion failed due to requirement '201803L == 0'}} +static_assert(!__is_layout_compatible(CStructNoUniqueAddress, CStructMSVCNoUniqueAddress), ""); +static_assert(__is_layout_compatible(CStructMSVCNoUniqueAddress, CStructMSVCNoUniqueAddress), ""); +static_assert(!__is_layout_compatible(CStructMSVCNoUniqueAddress, CStructMSVCNoUniqueAddress2), ""); +// unsupported-error@-1 {{static assertion failed due to requirement '!__is_layout_compatible(CStructMSVCNoUniqueAddress, CStructMSVCNoUniqueAddress2)':}} |