1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 namespace ParameterPacksWithFunctions
{
5 template<typename
...> struct count
;
7 template<typename Head
, typename
...Tail
>
8 struct count
<Head
, Tail
...> {
9 static const unsigned value
= 1 + count
<Tail
...>::value
;
14 static const unsigned value
= 0;
17 template<unsigned> struct unsigned_c
{ };
19 template<typename
... Types
>
20 unsigned_c
<count
<Types
...>::value
> f();
23 unsigned_c
<0> uc0a
= f(); // okay, deduced to an empty pack
24 unsigned_c
<0> uc0b
= f
<>();
25 unsigned_c
<1> uc1
= f
<int>();
26 unsigned_c
<2> uc2
= f
<float, double>();
30 namespace rdar12176336
{
31 typedef void (*vararg_func
)(...);
34 vararg_func implementation
;
36 method(vararg_func implementation
) : implementation(implementation
) {}
38 template<typename TReturnType
, typename
... TArguments
, typename TFunctionType
= TReturnType (*)(TArguments
...)>
39 auto getImplementation() const -> TFunctionType
41 return reinterpret_cast<TFunctionType
>(implementation
);
47 auto imp
= m
.getImplementation
<int, int, int>();