================ @@ -102,7 +105,36 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, // only `PointeeTy->isStructureTypeWithFlexibleArrayMember()` is reachable // when `FieldTy->isArrayType()`. bool ShouldWarn = false; - if (PointeeTy->isIncompleteType() && !CountInBytes) { + if (PointeeTy->isAlwaysIncompleteType() && !CountInBytes) { ---------------- AaronBallman wrote:
Perhaps silly question: did you consider a model where you track incomplete types or their checks to ensure they're completed before the end of the TU and issuing a diagnostic for any that remain incomplete at the end of the TU? We do this dance somewhat frequently: https://github.com/llvm/llvm-project/blob/0d9cf2671e06c9124a0b5fc753330c39c8b4a791/clang/lib/Sema/Sema.cpp#L1171 https://github.com/llvm/llvm-project/pull/106321 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits