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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 26 11:51:05 PDT 2023


rsmith added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:10339-10343
+      if (RT->getDecl()->isAnonymousStructOrUnion()) {
+        FieldsToCheck.append(RT->getDecl()->field_begin(),
+                             RT->getDecl()->field_end());
+        continue;
+      }
----------------
Please add a check for `ClangABICompat` here (only do the new thing if `getLangOpts().getClangABICompat() > LangOptions::ClangABI::Ver17`) so that people with a stable ABI requirement can use `-fclang-abi-compat=17.0` or earlier to turn off this ABI change. This is the first ABI change since we branched off the 17.x release, so you'll also need to add the new `Ver17` enumerator and parsing support for it; grep for `Ver15` to find the places you may need to update.


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

https://reviews.llvm.org/D155895



More information about the cfe-commits mailing list