summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-25 07:03:22 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-25 07:03:22 +0000
commit25a3967ebb3b435e19d4382927c104b5f4acdf23 (patch)
treefcbe09136aa22d4d9b4354f688b60003772827b6
parentc103ccd85527c47774f0c4d9ca0e8c04a5c74ca5 (diff)
downloadbcm5719-llvm-25a3967ebb3b435e19d4382927c104b5f4acdf23.tar.gz
bcm5719-llvm-25a3967ebb3b435e19d4382927c104b5f4acdf23.zip
Sigh. Be *really* careful when copying a default function argument during template instantiation
llvm-svn: 82761
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index fc51684f9e7..b7548415aa3 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -711,7 +711,9 @@ ParmVarDecl *TemplateDeclInstantiator::VisitParmVarDecl(ParmVarDecl *D) {
// Mark the default argument as being uninstantiated.
if (D->hasUninstantiatedDefaultArg())
Param->setUninstantiatedDefaultArg(D->getUninstantiatedDefaultArg());
-
+ else if (Expr *Arg = D->getDefaultArg())
+ Param->setUninstantiatedDefaultArg(Arg);
+
// Note: we don't try to instantiate function parameters until after
// we've instantiated the function's type. Therefore, we don't have
// to check for 'void' parameter types here.
OpenPOWER on IntegriCloud