================ @@ -2438,6 +2438,22 @@ bool Type::isIncompleteType(NamedDecl **Def) const { } } +bool Type::isIncompletableIncompleteType() const { + if (!isIncompleteType()) + return false; + + // Forward declarations of structs, classes, enums, and unions could be later + // completed in a compilation unit by providing a type definition. + if (isStructureOrClassType() || isEnumeralType() || isUnionType()) + return false; + + // Other types are incompletable. + // + // E.g. `char[]` and `void`. The type is incomplete and no future + // type declarations can make the type complete. + return true; +} + ---------------- Sirraide wrote:
I think all of this can just be ``` TagDecl *TD = getAsTagDecl(); return isIncompleteType() && TD && !TD->isCompleteDefinition() ``` Since it’s only called in one place, I think we can just inline this and delete this function entirely? 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