================
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
     InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
   }
 
-  if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+  if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID &&
+      !CountInBytes) {
----------------
delcypher wrote:

I would have thought we would want to prevent `sized_by` on all of the 
conditions above (e.g. pointee being a function type) apart from pointee being 
an incomplete type. However, it looks like this implementation allows pointee 
types for all the cases we disallow it for `counted_by`.

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

Reply via email to