diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/CodeGenCXX/mangle-variadic-templates.cpp | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'test/CodeGenCXX/mangle-variadic-templates.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle-variadic-templates.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/CodeGenCXX/mangle-variadic-templates.cpp b/test/CodeGenCXX/mangle-variadic-templates.cpp index 264cc11..d2c1b77 100644 --- a/test/CodeGenCXX/mangle-variadic-templates.cpp +++ b/test/CodeGenCXX/mangle-variadic-templates.cpp @@ -3,11 +3,12 @@ template<unsigned I, typename ...Types> struct X { }; -template<typename T> struct identity { }; +template<typename T> struct identity { using type = T; }; template<typename T> struct add_reference; template<typename ...Types> struct tuple { }; template<int ...Values> struct int_tuple { }; template<template<typename> class ...Templates> struct template_tuple { }; +template<typename ...T> using ArrayOfN = int[sizeof...(T)]; // CHECK-LABEL: define weak_odr void @_Z2f0IJEEv1XIXsZT_EJDpRT_EE template<typename ...Types> @@ -65,3 +66,12 @@ template<template<typename> class ...Templates> template_tuple<Templates...> f7() {} // CHECK-LABEL: define weak_odr void @_Z2f7IJ8identity13add_referenceEE14template_tupleIJDpT_EEv template template_tuple<identity, add_reference> f7(); + +template<typename T, typename ...U> void f8(ArrayOfN<int, U..., T, typename U::type...>&) {} +// CHECK-LABEL: define weak_odr void @_Z2f8IiJ8identityIiES0_IfEEEvRAsPiDpT0_T_DpNS3_4typeEE_i +template void f8<int, identity<int>, identity<float>>(int (&)[6]); + +template<typename ...T> void f10(ArrayOfN<T...> &) {} +// FIXME: This is wrong; should be @_Z3f10IJifEEvRAsZT__i +// CHECK-LABEL: define weak_odr void @_Z3f10IJifEEvRAsPDpT_E_i +template void f10<int, float>(int (&)[2]); |