[mlir][Vector] Update VectorEmulateNarrowType.cpp (1/N) (#123526)
[llvm-project.git] / clang / test / CXX / temp / temp.fct.spec / temp.arg.explicit / p3-0x.cpp
blobdcf5a08d906290a548247f0f3acd38fa11cfa52c
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;
12 template<>
13 struct count<> {
14 static const unsigned value = 0;
17 template<unsigned> struct unsigned_c { };
19 template<typename ... Types>
20 unsigned_c<count<Types...>::value> f();
22 void test_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)(...);
33 struct method {
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);
45 void f() {
46 method m(nullptr);
47 auto imp = m.getImplementation<int, int, int>();