summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-04 02:33:52 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-04 02:33:52 +0000
commit857591143e639df933b6a1de1652441716fe843e (patch)
tree6e38283f613b52d0f0c4f6122f469184d9167ae6
parentbc114c6b203ad77564ca6e952f6db7573e88abd6 (diff)
downloadbcm5719-llvm-857591143e639df933b6a1de1652441716fe843e.tar.gz
bcm5719-llvm-857591143e639df933b6a1de1652441716fe843e.zip
When creating the injected-class-name for a class template involving a
non-type template parameter pack, make sure to create a pack expansion for the corresponding template argument. llvm-svn: 122799
-rw-r--r--clang/lib/AST/DeclTemplate.cpp6
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index dff956c6dce..0110e3b180c 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -14,6 +14,7 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
+#include "clang/AST/ExprCXX.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/ASTMutationListener.h"
@@ -327,7 +328,10 @@ ClassTemplateDecl::getInjectedClassNameSpecialization() {
NTTP->getType().getNonLValueExprType(Context),
Expr::getValueKindForType(NTTP->getType()),
NTTP->getLocation());
- // FIXME: Variadic templates.
+
+ if (NTTP->isParameterPack())
+ E = new (Context) PackExpansionExpr(Context.DependentTy, E,
+ NTTP->getLocation());
Arg = TemplateArgument(E);
} else {
TemplateTemplateParmDecl *TTP = cast<TemplateTemplateParmDecl>(*Param);
diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
index 69f6b46c281..47b7793da03 100644
--- a/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
+++ b/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
@@ -106,8 +106,6 @@ namespace Math {
int check3[sum<1, 2, 3, 4, 5>::value == 15? 1 : -1];
-#if 0
- // FIXME: Instantiation of this fails.
template<int ... Values>
struct lazy_sum {
int operator()() {
@@ -118,7 +116,6 @@ namespace Math {
void f() {
lazy_sum<1, 2, 3, 4, 5>()();
}
-#endif
}
namespace Indices {
OpenPOWER on IntegriCloud