summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 23:51:46 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 23:51:46 +0000
commit7f61d441789c7b1f7c96d7672a176eb996ecb73f (patch)
tree7146d357210ccd6a50a98dc703fd49475a87397f /clang/lib/Sema/SemaExpr.cpp
parent02f0b379f56319eb49424bdfb96d567454cc77c5 (diff)
downloadbcm5719-llvm-7f61d441789c7b1f7c96d7672a176eb996ecb73f.tar.gz
bcm5719-llvm-7f61d441789c7b1f7c96d7672a176eb996ecb73f.zip
Mark declarations as referenced by a default argument in a
potentially-evaluated context. This applies even if the use of the default argument is within an unevaluated context. llvm-svn: 363113
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index ed39278b1ad..d444a35be86 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4855,6 +4855,8 @@ bool Sema::CheckCXXDefaultArgExpr(SourceLocation CallLoc, FunctionDecl *FD,
// We already type-checked the argument, so we know it works.
// Just mark all of the declarations in this potentially-evaluated expression
// as being "referenced".
+ EnterExpressionEvaluationContext EvalContext(
+ *this, ExpressionEvaluationContext::PotentiallyEvaluated, Param);
MarkDeclarationsReferencedInExpr(Param->getDefaultArg(),
/*SkipLocalVariables=*/true);
return false;
OpenPOWER on IntegriCloud