[clang-tools-extra] [clang-reorder-fields] Check for flexible array member (PR #160262)

Vladimir Vuksanovic via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 26 01:56:04 PDT 2025


================
@@ -164,6 +164,22 @@ getNewFieldsOrder(const RecordDecl *Definition,
   return NewFieldsOrder;
 }
 
+static bool isOrderValid(const RecordDecl *RD, ArrayRef<unsigned> FieldOrder) {
+  if (FieldOrder.empty())
+    return false;
----------------
vvuksanovic wrote:

`getNewFieldsOrder` returns an empty array if the field order command line argument is bad. I suppose an empty struct will end up here too, but in that case there is nothing to reorder. This behavior is the same as it was, just moved to this function.

https://github.com/llvm/llvm-project/pull/160262


More information about the cfe-commits mailing list