Debian Codegraph @

clang/test/PCH/dedup_types.cpp

raw
1 // RUN: %clang_cc1 -std=c++14 -x c++-header %s -emit-pch -o %t.pch
2 // RUN: %clang_cc1 -std=c++14 -x c++ /dev/null -include-pch %t.pch
3
4 // RUN: %clang_cc1 -std=c++14 -x c++-header %s -emit-pch -fpch-instantiate-templates -o %t.pch
5 // RUN: %clang_cc1 -std=c++14 -x c++ /dev/null -include-pch %t.pch
6
7 template <template <class...> class Templ, class...Types>
8 using TypePackDedup = Templ<__builtin_dedup_pack<Types...>...>;
9
10 template <class ...Ts>
11 struct TypeList {};
12
13 template <int i>
14 struct X {};
15
16 void fn1() {
17 TypeList<int, double> l1 = TypePackDedup<TypeList, int, double, int>{};
18 TypeList<> l2 = TypePackDedup<TypeList>{};
19 TypeList<X<0>, X<1>> x1 = TypePackDedup<TypeList, X<0>, X<1>, X<0>, X<1>>{};
20 }