summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2015-12-11 01:56:36 +0000
committerJohn McCall <rjmccall@apple.com>2015-12-11 01:56:36 +0000
commitdc40b618cf397df7369406b3f61e91ccb57fb9f6 (patch)
treed544471453fefba0d5d5dfd314fcc8fc64a19acc /clang/lib/Sema/SemaTemplateInstantiate.cpp
parent38f2bfbbe49dc66cf33a542d3d00b115203e29eb (diff)
downloadbcm5719-llvm-dc40b618cf397df7369406b3f61e91ccb57fb9f6.tar.gz
bcm5719-llvm-dc40b618cf397df7369406b3f61e91ccb57fb9f6.zip
Correctly type-check the default arguments of local functions
when eagerly instantiating them. rdar://23721638 llvm-svn: 255325
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 3a3f6323d4b..ac99a25470c 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1680,8 +1680,11 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldParm,
Sema::ContextRAII SavedContext(*this, OwningFunc);
LocalInstantiationScope Local(*this);
ExprResult NewArg = SubstExpr(Arg, TemplateArgs);
- if (NewArg.isUsable())
- NewParm->setDefaultArg(NewArg.get());
+ if (NewArg.isUsable()) {
+ // It would be nice if we still had this.
+ SourceLocation EqualLoc = NewArg.get()->getLocStart();
+ SetParamDefaultArgument(NewParm, NewArg.get(), EqualLoc);
+ }
} else {
// FIXME: if we non-lazily instantiated non-dependent default args for
// non-dependent parameter types we could remove a bunch of duplicate
OpenPOWER on IntegriCloud