summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorSaar Raz <saar@raz.email>2020-01-30 20:46:32 +0200
committerSaar Raz <saar@raz.email>2020-01-30 20:54:12 +0200
commit6c6ea5995f261f0baa2be8a216ad08186551c622 (patch)
tree32112b98739e5cb809c50b67c14ea62e7354f3c8 /clang/lib/Sema/SemaExpr.cpp
parenta3609357f3888685f5d864d5708421b0993650b8 (diff)
downloadbcm5719-llvm-6c6ea5995f261f0baa2be8a216ad08186551c622.tar.gz
bcm5719-llvm-6c6ea5995f261f0baa2be8a216ad08186551c622.zip
[Concepts] Add check for dependent RC when checking function constraints
Do not attempt to check a dependent requires clause in a function constraint (may be triggered by, for example, DiagnoseUseOfDecl). (cherry picked from commit a424ef99e7b9821ec80564af3d3a8f091323a38c)
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 4f777e7b981..2a8302e9d22 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -333,11 +333,9 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs,
//
// See if this is a function with constraints that need to be satisfied.
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- if (Expr *RC = FD->getTrailingRequiresClause()) {
+ if (FD->getTrailingRequiresClause()) {
ConstraintSatisfaction Satisfaction;
- bool Failed = CheckConstraintSatisfaction(FD, {RC}, /*TemplateArgs=*/{},
- SourceRange(Loc), Satisfaction);
- if (Failed)
+ if (CheckFunctionConstraints(FD, Satisfaction, Loc))
// A diagnostic will have already been generated (non-constant
// constraint expression, for example)
return true;
OpenPOWER on IntegriCloud