[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 25 06:53:27 PDT 2025


================
@@ -396,17 +396,6 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs,
           targetDiag(*Locs.begin(), diag::err_thread_unsupported);
   }
 
-  if (isa<ParmVarDecl>(D) && isa<RequiresExprBodyDecl>(D->getDeclContext()) &&
-      !isUnevaluatedContext()) {
-    // C++ [expr.prim.req.nested] p3
-    //   A local parameter shall only appear as an unevaluated operand
-    //   (Clause 8) within the constraint-expression.
-    Diag(Loc, diag::err_requires_expr_parameter_referenced_in_evaluated_context)
----------------
cor3ntin wrote:

This seems to be the only use of this error - can you remove it from
clang/include/clang/Basic/DiagnosticSemaKinds.td ?

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


More information about the cfe-commits mailing list