[PATCH] D139261: [Clang] Modify sanity check assert in AggExprEmitter::VisitInitListExpr to cover anonymous struct in a union GNU extension

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 10:20:03 PST 2022


shafik added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprAgg.cpp:1688
       for (const auto *Field : record->fields())
-        assert(Field->isUnnamedBitfield() && "Only unnamed bitfields allowed");
+        assert((Field->isUnnamedBitfield() || Field->isAnonymousStructOrUnion()) && "Only unnamed bitfields or ananymous class allowed");
 #endif
----------------
aaron.ballman wrote:
> Guessing at the way to solve the 80-col limit issue, but do whatever clang-format says.
This is what clang-format likes.


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

https://reviews.llvm.org/D139261



More information about the cfe-commits mailing list