[clang] [Clang] Fix a crash when checking the constraints of a self-referential concept (PR #208465)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 07:46:10 PDT 2026


================
@@ -9303,6 +9306,7 @@ bool Sema::CheckConceptUseInDefinition(NamedDecl *Concept, SourceLocation Loc) {
       CE && !CE->isInvalidDecl() && !CE->hasDefinition()) {
     Diag(Loc, diag::err_recursive_concept) << CE;
     Diag(CE->getLocation(), diag::note_declared_at);
+    CE->setInvalidDecl();
----------------
zyn0217 wrote:

But we have already returned invalid here, it's strange to me that CE ended up being evaluated

https://github.com/llvm/llvm-project/pull/208465


More information about the cfe-commits mailing list