================
@@ -631,6 +631,18 @@ bool Type::isStructureType() const {
   return false;
 }
 
+bool Type::isStructureTypeWithFlexibleArrayMember() const {
+  const auto *RT = getAs<RecordType>();
+  if (!RT)
+    return false;
+  const auto *Decl = RT->getDecl();
+  if (!Decl->isStruct())
+    return false;
+  if (!Decl->hasFlexibleArrayMember())
+    return false;
+  return true;
----------------
bwendling wrote:

Maybe? The `isFlexibleArrayMemberLike` methods are more in depth analysis of 
the struct and checks against the `-fstrict-flex-arrays=` flag, so it's a more 
expensive call. But if the `hasFlexibleArrayMember` is always set "correctly," 
then it's probably sufficient.

https://github.com/llvm/llvm-project/pull/90786
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to