diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-04-20 01:15:31 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-04-20 01:15:31 +0000 |
| commit | 479ba8ee0e51b576182727c111d1efa5c10d5818 (patch) | |
| tree | 62a1ba49bf1d302bf46e4ea6bcd578a17e297360 /clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp | |
| parent | a90474544e47bd0d4452cfe4d9073ce48bacf150 (diff) | |
| download | bcm5719-llvm-479ba8ee0e51b576182727c111d1efa5c10d5818.tar.gz bcm5719-llvm-479ba8ee0e51b576182727c111d1efa5c10d5818.zip | |
PR32673: Don't wrap parameter packs in SubstTemplateTypeParmPackType nodes when forming implicit deduction guides.
Doing so thwarts template type deduction. Instead, substitute the pack directly
by picking "slice 0" of the resulting expansion.
llvm-svn: 300805
Diffstat (limited to 'clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp b/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp index d6374e4ce90..5de228ad285 100644 --- a/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp +++ b/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp @@ -213,3 +213,38 @@ namespace transform_params { }; D d(Y<0, 1, 2>{}); } + +namespace variadic { + int arr3[3], arr4[4]; + + // PR32673 + template<typename T> struct A { + template<typename ...U> A(T, U...); + }; + A a(1, 2, 3); + + template<typename T> struct B { + template<int ...N> B(T, int (&...r)[N]); + }; + B b(1, arr3, arr4); + + template<typename T> struct C { + template<template<typename> typename ...U> C(T, U<int>...); + }; + C c(1, a, b); + + template<typename ...U> struct X { + template<typename T> X(T, U...); + }; + X x(1, 2, 3); + + template<int ...N> struct Y { + template<typename T> Y(T, int (&...r)[N]); + }; + Y y(1, arr3, arr4); + + template<template<typename> typename ...U> struct Z { + template<typename T> Z(T, U<int>...); + }; + Z z(1, a, b); +} |

