annotate gcc/testsuite/g++.dg/cpp0x/decltype19.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/42013
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 template<typename _Tp>
kono
parents:
diff changeset
4 _Tp
kono
parents:
diff changeset
5 __attribute ((const)) declval();
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 template<typename _Tp, typename _Up>
kono
parents:
diff changeset
8 struct common_type
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 typedef __decltype(true ? declval<_Tp>() : declval<_Up>()) typet;
kono
parents:
diff changeset
11 typedef __decltype(false ? declval<_Tp>() : declval<_Up>()) typef;
kono
parents:
diff changeset
12 };
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 template<typename, typename> struct is_same;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 template<typename _Tp> struct is_same<_Tp, _Tp> { typedef _Tp type; };
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 void f()
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 typedef common_type<int, const int>::typet typet;
kono
parents:
diff changeset
21 typedef common_type<int, const int>::typef typef;
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 typedef is_same<typet, typef>::type type;
kono
parents:
diff changeset
24 }