[PATCH] D155895: Anonymous unions should be transparent wrt `[[clang::trivial_abi]]`.

Ɓukasz Anforowicz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 7 12:20:34 PDT 2023


lukasza added a comment.

In D155895#4566903 <https://reviews.llvm.org/D155895#4566903>, @thakis wrote:

> Looks like this breaks tests on windows: http://45.33.8.238/win/82239/step_7.txt

Thanks for the report!  It seems that `#if defined(_WIN64) && !defined(__MINGW32__)` from `clang/test/SemaCXX/attr-trivial-abi.cpp` needs to be applied to fix the failing expectations of the new tests:

  error: 'error' diagnostics seen but not expected: 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 182: static assertion failed due to requirement '__is_trivially_relocatable(anonymousUnionsAndStructs::Trivial)': 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 200: static assertion failed due to requirement '__is_trivially_relocatable(anonymousUnionsAndStructs::BasicStruct)': 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 225: static assertion failed due to requirement '__is_trivially_relocatable(anonymousUnionsAndStructs::StructWithAnonymousUnion)': 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 239: static assertion failed due to requirement '__is_trivially_relocatable(anonymousUnionsAndStructs::StructWithAnonymousStruct)': 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 266: static assertion failed due to requirement '__is_trivially_relocatable(anonymousUnionsAndStructs::TrivialAbiAttributeAppliedToAnonymousUnion)': 
  error: 'warning' diagnostics seen but not expected: 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 194: 'trivial_abi' cannot be applied to 'BasicStruct'
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 212: 'trivial_abi' cannot be applied to 'StructWithAnonymousUnion'
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 233: 'trivial_abi' cannot be applied to 'StructWithAnonymousStruct'
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 251: 'trivial_abi' cannot be applied to 'TrivialAbiAttributeAppliedToAnonymousUnion'
  error: 'note' diagnostics seen but not expected: 
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 194: 'trivial_abi' is disallowed on 'BasicStruct' because it has a field of a non-trivial class type
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 212: 'trivial_abi' is disallowed on 'StructWithAnonymousUnion' because it has a field of a non-trivial class type
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 233: 'trivial_abi' is disallowed on 'StructWithAnonymousStruct' because it has a field of a non-trivial class type
    File C:\src\llvm-project\clang\test\SemaCXX\attr-trivial-abi.cpp Line 251: 'trivial_abi' is disallowed on 'TrivialAbiAttributeAppliedToAnonymousUnion' because it has a field of a non-trivial class type

Alternatively, maybe the test classes can be made trivially copyable.

> Please take a look and revert for now if it takes a while to fix.

I need to take a few days off this week, so I think it will indeed be safest to revert for now.  I don't have write access to the repo though - I hope that @gribozavr2 can help with the revert?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155895



More information about the cfe-commits mailing list