summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/alias-templates.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-07-09 03:07:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-07-09 03:07:20 +0000
commit34349003cfe040c53656d113fa344aa9e4b5d051 (patch)
treedbb747ca85e2a6cad7d4a3eda1e9e65b5c45a3be /clang/test/SemaTemplate/alias-templates.cpp
parent38b99b025ca0bb8aec13b76697417ddfaacdbfb6 (diff)
downloadbcm5719-llvm-34349003cfe040c53656d113fa344aa9e4b5d051.tar.gz
bcm5719-llvm-34349003cfe040c53656d113fa344aa9e4b5d051.zip
PR13136:
* When substituting a reference to a non-type template parameter pack where the corresponding argument is a pack expansion, transform into an expression which contains an unexpanded parameter pack rather than into an expression which contains a pack expansion. This causes the SubstNonTypeTemplateParmExpr to be inside the PackExpansionExpr, rather than outside, so the expression still looks like a pack expansion and can be deduced. * Teach MarkUsedTemplateParameters that we can deduce a reference to a template parameter if it's wrapped in a SubstNonTypeTemplateParmExpr (such nodes are added during alias template substitution). llvm-svn: 159922
Diffstat (limited to 'clang/test/SemaTemplate/alias-templates.cpp')
-rw-r--r--clang/test/SemaTemplate/alias-templates.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/alias-templates.cpp b/clang/test/SemaTemplate/alias-templates.cpp
index a074bc4e1e6..cd796b8603d 100644
--- a/clang/test/SemaTemplate/alias-templates.cpp
+++ b/clang/test/SemaTemplate/alias-templates.cpp
@@ -109,3 +109,22 @@ namespace PR13243 {
template<typename A, int I> void f(X<A>, Ci<I>) {}
template void f(X<int>, C<0>);
}
+
+namespace PR13136 {
+ template <typename T, T... Numbers>
+ struct NumberTuple { };
+
+ template <unsigned int... Numbers>
+ using MyNumberTuple = NumberTuple<unsigned int, Numbers...>;
+
+ template <typename U, unsigned int... Numbers>
+ void foo(U&&, MyNumberTuple<Numbers...>);
+
+ template <typename U, unsigned int... Numbers>
+ void bar(U&&, NumberTuple<unsigned int, Numbers...>);
+
+ int main() {
+ foo(1, NumberTuple<unsigned int, 0, 1>());
+ bar(1, NumberTuple<unsigned int, 0, 1>());
+ }
+}
OpenPOWER on IntegriCloud