]> granicus.if.org Git - clang/commitdiff
Fix pack instantiation with function types.
authorEli Friedman <eli.friedman@gmail.com>
Fri, 19 Jul 2013 22:50:29 +0000 (22:50 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 19 Jul 2013 22:50:29 +0000 (22:50 +0000)
Make sure we correctly expand packs which expand to another
pack in a function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186728 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/TreeTransform.h
test/SemaTemplate/alias-templates.cpp

index 34fdbad87b3401a5648a83202b1aeb3193207aa3..4a41b603642851db494164abf80f9da3670784a3 100644 (file)
@@ -4269,6 +4269,10 @@ bool TreeTransform<Derived>::
           if (NewType.isNull())
             return true;
 
+          if (NewType->containsUnexpandedParameterPack())
+            NewType = getSema().Context.getPackExpansionType(NewType,
+                                                             NumExpansions);
+
           OutParamTypes.push_back(NewType);
           if (PVars)
             PVars->push_back(0);
index eeb6b95189769264b5021bd48baf11640b4d1728..f495620b54fbaa1ebbf71a951ca4d07c2aaf98ec 100644 (file)
@@ -189,3 +189,10 @@ namespace PR16646 {
     }
   }
 }
+
+namespace VariadicAliasWithFunctionType {
+  template <class T> struct A { };
+  template <class ...Args> using B = A<int(Args ...x)>;
+  template <class ...Args> void f(B<A<int>, A<Args>...>) {}
+  void g() { f(A<int(A<int>,A<int>)>()); }
+}