summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-02-14 02:07:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-02-14 02:07:53 +0000
commitd0f176e8eb6c5cc7c1e89436b25692baedd6aca1 (patch)
tree1d6d42f35f97c9fddd6a7f68038402fd15650d5c /lib/Sema/SemaTemplateInstantiate.cpp
parent789b385fd15c27c91e621faf571e2f6ff060208c (diff)
Fix a couple of places where we assumed that non-type template parameters are always rvalues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 489d026027..2c4f649078 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1212,11 +1212,11 @@ TemplateInstantiator::TransformTemplateParmRefExpr(DeclRefExpr *E,
NTTP->getDeclName());
if (TargetType.isNull())
return ExprError();
-
- return new (SemaRef.Context) SubstNonTypeTemplateParmPackExpr(TargetType,
- NTTP,
- E->getLocation(),
- Arg);
+
+ return new (SemaRef.Context) SubstNonTypeTemplateParmPackExpr(
+ TargetType.getNonLValueExprType(SemaRef.Context),
+ TargetType->isReferenceType() ? VK_LValue : VK_RValue, NTTP,
+ E->getLocation(), Arg);
}
Arg = getPackSubstitutedTemplateArgument(getSema(), Arg);