================ @@ -4111,7 +4111,10 @@ static ActionResult<CXXRecordDecl *> getPatternForClassTemplateSpecialization( if (Ambiguous) { // Partial ordering did not produce a clear winner. Complain. Inst.Clear(); - ClassTemplateSpec->setInvalidDecl(); + + if (!S.isSFINAEContext()) + ClassTemplateSpec->setInvalidDecl(); ---------------- mizvekov wrote:
After a quick grep through the code base, we don't have any similar cases where we decide to mark a declaration as invalid depending on SFINAE context. And indeed it's a bit odd, if the declaration is invalid, then the context shouldn't matter. The question is, Is this declaration specially malformed so that we need to mark it as invalid, in order to have an easier time dealing with it downstream? That's currently hard to answer, as we are both lacking an expectation on how error recovery should proceed, but even worse, marking this as invalid is making it harder for downstream to deal with this declaration. I think the other alternatives are better than the middle ground here: Either don't mark this as invalid at all, or otherwise do in every context, but have the downstream users do something useful with it. https://github.com/llvm/llvm-project/pull/147275 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits