Skip to content

Commit 7905577

Browse files
committed
[Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression
1 parent e696f4e commit 7905577

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -396,17 +396,6 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs,
396396
targetDiag(*Locs.begin(), diag::err_thread_unsupported);
397397
}
398398

399-
if (isa<ParmVarDecl>(D) && isa<RequiresExprBodyDecl>(D->getDeclContext()) &&
400-
!isUnevaluatedContext()) {
401-
// C++ [expr.prim.req.nested] p3
402-
// A local parameter shall only appear as an unevaluated operand
403-
// (Clause 8) within the constraint-expression.
404-
Diag(Loc, diag::err_requires_expr_parameter_referenced_in_evaluated_context)
405-
<< D;
406-
Diag(D->getLocation(), diag::note_entity_declared_at) << D;
407-
return true;
408-
}
409-
410399
return false;
411400
}
412401

0 commit comments

Comments
 (0)