summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 5d0c6057f54..f1b9987a2f0 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4315,8 +4315,15 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc,
Expr *Arg = Result.getAs<Expr>();
CheckCompletedExpr(Arg, Param->getOuterLocStart());
+
+ // Remember the instantiated default argument.
+ Param->setDefaultArg(Arg);
+ if (ASTMutationListener *L = getASTMutationListener()) {
+ L->DefaultArgumentInstantiated(Param);
+ }
+
// Build the default argument expression.
- return CXXDefaultArgExpr::Create(Context, CallLoc, Param, Arg);
+ return CXXDefaultArgExpr::Create(Context, CallLoc, Param);
}
// If the default expression creates temporaries, we need to
OpenPOWER on IntegriCloud