================
@@ -152,7 +152,8 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
InvalidTypeKind = CountedByInvalidPointeeTypeKind::SIZELESS;
} else if (PointeeTy->isFunctionType()) {
InvalidTypeKind = CountedByInvalidPointeeTypeKind::FUNCTION;
- } else if (PointeeTy->isStructureTypeWithFlexibleArrayMember()) {
+ } else if (PointeeTy->isStructureTypeWithFlexibleArrayMember() &&
+ !CountInBytes) {
----------------
delcypher wrote:
So I wrote it this way to have the same shape as the
`PointeeTy->isAlwaysIncompleteType() && !CountInBytes` above. It would be odd
rewrite this one and not the other. Doing the rewrite in this PR makes it less
targeted so I'd rather not do it here. If we weren't forced to squash I would
just do a second commit to do the rewrite. I'll just do it as a follow up
commit.
https://github.com/llvm/llvm-project/pull/209603
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits