1 | template <typename T> struct Foo; |
2 | |
3 | typedef Foo<int> BarInt; |
4 | typedef Foo<double> BarDouble; |
5 | |
6 | template <typename T> using Bar = Foo<T>; |
7 | |
8 | template <typename T> |
9 | struct [[clang::preferred_name(BarInt), clang::preferred_name(BarDouble), |
10 | clang::preferred_name(Bar<short>), clang::preferred_name(Bar<short>), |
11 | clang::preferred_name(Bar<double>), |
12 | clang::preferred_name(Bar<char>)]] Foo{}; |
13 | |
14 | int main() { |
15 | BarInt barInt; |
16 | BarDouble barDouble; |
17 | Bar<short> barShort; |
18 | Bar<char> barChar; |
19 | |
20 | Foo<int> varInt; |
21 | Foo<double> varDouble; |
22 | Foo<short> varShort; |
23 | Foo<char> varChar; |
24 | Foo<Foo<int>> varFooInt; |
25 | return 0; |
26 | } |
27 | |