diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-09-25 07:03:22 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-09-25 07:03:22 +0000 |
| commit | 25a3967ebb3b435e19d4382927c104b5f4acdf23 (patch) | |
| tree | fcbe09136aa22d4d9b4354f688b60003772827b6 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
| parent | c103ccd85527c47774f0c4d9ca0e8c04a5c74ca5 (diff) | |
| download | bcm5719-llvm-25a3967ebb3b435e19d4382927c104b5f4acdf23.tar.gz bcm5719-llvm-25a3967ebb3b435e19d4382927c104b5f4acdf23.zip | |
Sigh. Be *really* careful when copying a default function argument during template instantiation
llvm-svn: 82761
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 |
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. |

