summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-09-28 23:55:27 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-09-28 23:55:27 +0000
commit55fa8090a86ca7510f4295e6349efccfa77b08d7 (patch)
tree133d15e48de203da275de015858f751b605d4d15 /lib/Sema/SemaTemplateInstantiate.cpp
parente5804c1ee47f3bda8ef7cf36ddee13cbdfe0dc19 (diff)
P0127R2: Support type deduction for types of non-type template parameters in
C++1z. Patch by James Touton! Some bugfixes and rebasing by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 50663f9f4b..b715c13b07 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1179,8 +1179,8 @@ ExprResult TemplateInstantiator::transformNonTypeTemplateParmRef(
cast<PackExpansionType>(parm->getType())->getPattern(),
TemplateArgs, loc, parm->getDeclName());
} else {
- type = SemaRef.SubstType(parm->getType(), TemplateArgs,
- loc, parm->getDeclName());
+ type = SemaRef.SubstType(VD ? arg.getParamTypeForDecl() : arg.getNullPtrType(),
+ TemplateArgs, loc, parm->getDeclName());
}
assert(!type.isNull() && "type substitution failed for param type");
assert(!type->isDependentType() && "param type still dependent");