================
@@ -1013,6 +1013,24 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr 
*E, unsigned Type,
     // Can't find the field referenced by the "counted_by" attribute.
     return nullptr;
 
+  if (isa<DeclRefExpr>(Base))
----------------
efriedma-quic wrote:

I'm not sure this reliably detects a "whole struct"?  It's not clear to me why 
we want to treat `int f(struct X*p) { return __builtin_dynamic_object_size(p, 
0); }` differently from `int f2(struct X**p) { return 
__builtin_dynamic_object_size(*p, 0); }` here.

Maybe this is fine if other parts of the code detect "whole struct" the same 
way, though.

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

Reply via email to