summaryrefslogtreecommitdiff
path: root/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
commitf80fa1d28cd7d31f1744cfffa90f804e4578e9ac (patch)
tree775c1ede9f097cdb5e265a240fbc373704df8412 /lib/Sema/SemaExpr.cpp
parente75ebf573f7f71e65e7bdfa288254237eb563255 (diff)
downloadclang-f80fa1d28cd7d31f1744cfffa90f804e4578e9ac.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index ed39278b1a..d444a35be8 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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;