================ @@ -264,10 +264,13 @@ namespace { } QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { - if (isa<EnumType>(this->getType())) + if (isa<EnumType>(this->getType())) { return this->getType(); - else if (const auto *ECD = this->getEnumConstantDecl()) - return Ctx.getTypeDeclType(cast<EnumDecl>(ECD->getDeclContext())); + } else if (const auto *ECD = this->getEnumConstantDecl()) { + const auto *ED = cast<EnumDecl>(ECD->getDeclContext()); + if (ED->isCompleteDefinition()) + return Ctx.getTypeDeclType(ED); + } return this->getType(); ---------------- Kupa-Martin wrote:
Force of habit. I already changed it. https://github.com/llvm/llvm-project/pull/84068 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits