1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 #define T(b) (b) ? 1 : -1
3 #define F(b) (b) ? -1 : 1
5 struct NonPOD
{ NonPOD(int); };
9 struct POD
{ Enum e
; int i
; float f
; NonPOD
* p
; };
11 typedef Empty EmptyAr
[10];
13 typedef Int IntAr
[10];
14 typedef Int IntArNB
[];
15 class Statics
{ static int priv
; static NonPOD np
; };
17 union Union
{ int i
; float f
; };
18 struct HasFunc
{ void f (); };
19 struct HasOp
{ void operator *(); };
20 struct HasConv
{ operator int(); };
21 struct HasAssign
{ void operator =(int); };
23 struct HasAnonymousUnion
{
31 typedef const void cvoid
;
32 struct Derives
: POD
{};
33 struct DerivesEmpty
: Empty
{};
34 struct HasCons
{ HasCons(int); };
35 struct HasCopyAssign
{ HasCopyAssign
operator =(const HasCopyAssign
&); };
36 struct HasDest
{ ~HasDest(); };
37 class HasPriv
{ int priv
; };
38 class HasProt
{ protected: int prot
; };
39 struct HasRef
{ int i
; int& ref
; HasRef() : i(0), ref(i
) {} };
40 struct HasNonPOD
{ NonPOD np
; };
41 struct HasVirt
{ virtual void Virt() {}; };
42 typedef Derives NonPODAr
[10];
43 typedef HasVirt VirtAr
[10];
44 typedef HasCons NonPODArNB
[];
45 union NonPODUnion
{ int i
; Derives n
; };
47 struct HasNoThrowCopyAssign
{
48 void operator =(const HasNoThrowCopyAssign
&) throw();
50 struct HasMultipleCopyAssign
{
51 void operator =(const HasMultipleCopyAssign
&) throw();
52 void operator =(volatile HasMultipleCopyAssign
&);
54 struct HasMultipleNoThrowCopyAssign
{
55 void operator =(const HasMultipleNoThrowCopyAssign
&) throw();
56 void operator =(volatile HasMultipleNoThrowCopyAssign
&) throw();
59 struct HasNoThrowConstructor
{ HasNoThrowConstructor() throw(); };
60 struct HasNoThrowConstructorWithArgs
{
61 HasNoThrowConstructorWithArgs(HasCons i
= HasCons(0)) throw();
64 struct HasNoThrowCopy
{ HasNoThrowCopy(const HasNoThrowCopy
&) throw(); };
65 struct HasMultipleCopy
{
66 HasMultipleCopy(const HasMultipleCopy
&) throw();
67 HasMultipleCopy(volatile HasMultipleCopy
&);
69 struct HasMultipleNoThrowCopy
{
70 HasMultipleNoThrowCopy(const HasMultipleNoThrowCopy
&) throw();
71 HasMultipleNoThrowCopy(volatile HasMultipleNoThrowCopy
&) throw();
74 struct HasVirtDest
{ virtual ~HasVirtDest(); };
75 struct DerivedVirtDest
: HasVirtDest
{};
76 typedef HasVirtDest VirtDestAr
[1];
80 int t01
[T(__is_pod(int))];
81 int t02
[T(__is_pod(Enum
))];
82 int t03
[T(__is_pod(POD
))];
83 int t04
[T(__is_pod(Int
))];
84 int t05
[T(__is_pod(IntAr
))];
85 int t06
[T(__is_pod(Statics
))];
86 int t07
[T(__is_pod(Empty
))];
87 int t08
[T(__is_pod(EmptyUnion
))];
88 int t09
[T(__is_pod(Union
))];
89 int t10
[T(__is_pod(HasFunc
))];
90 int t11
[T(__is_pod(HasOp
))];
91 int t12
[T(__is_pod(HasConv
))];
92 int t13
[T(__is_pod(HasAssign
))];
93 int t14
[T(__is_pod(IntArNB
))];
94 int t15
[T(__is_pod(HasAnonymousUnion
))];
96 int t21
[F(__is_pod(Derives
))];
97 int t22
[F(__is_pod(HasCons
))];
98 int t23
[F(__is_pod(HasCopyAssign
))];
99 int t24
[F(__is_pod(HasDest
))];
100 int t25
[F(__is_pod(HasPriv
))];
101 int t26
[F(__is_pod(HasProt
))];
102 int t27
[F(__is_pod(HasRef
))];
103 int t28
[F(__is_pod(HasNonPOD
))];
104 int t29
[F(__is_pod(HasVirt
))];
105 int t30
[F(__is_pod(NonPODAr
))];
106 int t31
[F(__is_pod(DerivesEmpty
))];
107 int t32
[F(__is_pod(void))];
108 int t33
[F(__is_pod(cvoid
))];
109 int t34
[F(__is_pod(NonPODArNB
))];
110 // int t32[F(__is_pod(NonPODUnion))];
113 typedef Empty EmptyAr
[10];
114 struct Bit0
{ int : 0; };
115 struct Bit0Cons
{ int : 0; Bit0Cons(); };
116 struct BitOnly
{ int x
: 3; };
117 //struct DerivesVirt : virtual POD {};
121 int t01
[T(__is_empty(Empty
))];
122 int t02
[T(__is_empty(DerivesEmpty
))];
123 int t03
[T(__is_empty(HasCons
))];
124 int t04
[T(__is_empty(HasCopyAssign
))];
125 int t05
[T(__is_empty(HasDest
))];
126 int t06
[T(__is_empty(HasFunc
))];
127 int t07
[T(__is_empty(HasOp
))];
128 int t08
[T(__is_empty(HasConv
))];
129 int t09
[T(__is_empty(HasAssign
))];
130 int t10
[T(__is_empty(Bit0
))];
131 int t11
[T(__is_empty(Bit0Cons
))];
133 int t21
[F(__is_empty(Int
))];
134 int t22
[F(__is_empty(POD
))];
135 int t23
[F(__is_empty(EmptyUnion
))];
136 int t24
[F(__is_empty(EmptyAr
))];
137 int t25
[F(__is_empty(HasRef
))];
138 int t26
[F(__is_empty(HasVirt
))];
139 int t27
[F(__is_empty(BitOnly
))];
140 int t28
[F(__is_empty(void))];
141 int t29
[F(__is_empty(IntArNB
))];
142 int t30
[F(__is_empty(HasAnonymousUnion
))];
143 // int t27[F(__is_empty(DerivesVirt))];
146 typedef Derives ClassType
;
150 int t01
[T(__is_class(Derives
))];
151 int t02
[T(__is_class(HasPriv
))];
152 int t03
[T(__is_class(ClassType
))];
153 int t04
[T(__is_class(HasAnonymousUnion
))];
155 int t11
[F(__is_class(int))];
156 int t12
[F(__is_class(Enum
))];
157 int t13
[F(__is_class(Int
))];
158 int t14
[F(__is_class(IntAr
))];
159 int t15
[F(__is_class(NonPODAr
))];
160 int t16
[F(__is_class(Union
))];
161 int t17
[F(__is_class(cvoid
))];
162 int t18
[F(__is_class(IntArNB
))];
165 typedef Union UnionAr
[10];
166 typedef Union UnionType
;
170 int t01
[T(__is_union(Union
))];
171 int t02
[T(__is_union(UnionType
))];
173 int t11
[F(__is_union(int))];
174 int t12
[F(__is_union(Enum
))];
175 int t13
[F(__is_union(Int
))];
176 int t14
[F(__is_union(IntAr
))];
177 int t15
[F(__is_union(UnionAr
))];
178 int t16
[F(__is_union(cvoid
))];
179 int t17
[F(__is_union(IntArNB
))];
180 int t18
[F(__is_union(HasAnonymousUnion
))];
183 typedef Enum EnumType
;
187 int t01
[T(__is_enum(Enum
))];
188 int t02
[T(__is_enum(EnumType
))];
190 int t11
[F(__is_enum(int))];
191 int t12
[F(__is_enum(Union
))];
192 int t13
[F(__is_enum(Int
))];
193 int t14
[F(__is_enum(IntAr
))];
194 int t15
[F(__is_enum(UnionAr
))];
195 int t16
[F(__is_enum(Derives
))];
196 int t17
[F(__is_enum(ClassType
))];
197 int t18
[F(__is_enum(cvoid
))];
198 int t19
[F(__is_enum(IntArNB
))];
199 int t20
[F(__is_enum(HasAnonymousUnion
))];
202 typedef HasVirt Polymorph
;
203 struct InheritPolymorph
: Polymorph
{};
205 void is_polymorphic()
207 int t01
[T(__is_polymorphic(Polymorph
))];
208 int t02
[T(__is_polymorphic(InheritPolymorph
))];
210 int t11
[F(__is_polymorphic(int))];
211 int t12
[F(__is_polymorphic(Union
))];
212 int t13
[F(__is_polymorphic(Int
))];
213 int t14
[F(__is_polymorphic(IntAr
))];
214 int t15
[F(__is_polymorphic(UnionAr
))];
215 int t16
[F(__is_polymorphic(Derives
))];
216 int t17
[F(__is_polymorphic(ClassType
))];
217 int t18
[F(__is_polymorphic(Enum
))];
218 int t19
[F(__is_polymorphic(cvoid
))];
219 int t20
[F(__is_polymorphic(IntArNB
))];
223 typedef const IntAr ConstIntAr
;
224 typedef ConstIntAr ConstIntArAr
[4];
227 HasCopy(HasCopy
& cp
);
230 struct HasTemplateCons
{
233 template <typename T
>
234 HasTemplateCons(const T
&);
237 void has_trivial_default_constructor() {
238 int t01
[T(__has_trivial_constructor(Int
))];
239 int t02
[T(__has_trivial_constructor(IntAr
))];
240 int t03
[T(__has_trivial_constructor(Union
))];
241 int t04
[T(__has_trivial_constructor(UnionAr
))];
242 int t05
[T(__has_trivial_constructor(POD
))];
243 int t06
[T(__has_trivial_constructor(Derives
))];
244 int t07
[T(__has_trivial_constructor(ConstIntAr
))];
245 int t08
[T(__has_trivial_constructor(ConstIntArAr
))];
246 int t09
[T(__has_trivial_constructor(HasDest
))];
247 int t10
[T(__has_trivial_constructor(HasPriv
))];
248 int t11
[F(__has_trivial_constructor(HasCons
))];
249 int t12
[F(__has_trivial_constructor(HasRef
))];
250 int t13
[F(__has_trivial_constructor(HasCopy
))];
251 int t14
[F(__has_trivial_constructor(IntRef
))];
252 int t15
[T(__has_trivial_constructor(HasCopyAssign
))];
253 int t16
[T(__has_trivial_constructor(const Int
))];
254 int t17
[T(__has_trivial_constructor(NonPODAr
))];
255 int t18
[F(__has_trivial_constructor(VirtAr
))];
256 int t19
[F(__has_trivial_constructor(void))];
257 int t20
[F(__has_trivial_constructor(cvoid
))];
258 int t21
[F(__has_trivial_constructor(HasTemplateCons
))];
261 void has_trivial_copy_constructor() {
262 int t01
[T(__has_trivial_copy(Int
))];
263 int t02
[T(__has_trivial_copy(IntAr
))];
264 int t03
[T(__has_trivial_copy(Union
))];
265 int t04
[T(__has_trivial_copy(UnionAr
))];
266 int t05
[T(__has_trivial_copy(POD
))];
267 int t06
[T(__has_trivial_copy(Derives
))];
268 int t07
[T(__has_trivial_copy(ConstIntAr
))];
269 int t08
[T(__has_trivial_copy(ConstIntArAr
))];
270 int t09
[T(__has_trivial_copy(HasDest
))];
271 int t10
[T(__has_trivial_copy(HasPriv
))];
272 int t11
[T(__has_trivial_copy(HasCons
))];
273 int t12
[T(__has_trivial_copy(HasRef
))];
274 int t13
[F(__has_trivial_copy(HasCopy
))];
275 int t14
[T(__has_trivial_copy(IntRef
))];
276 int t15
[T(__has_trivial_copy(HasCopyAssign
))];
277 int t16
[T(__has_trivial_copy(const Int
))];
278 int t17
[F(__has_trivial_copy(NonPODAr
))];
279 int t18
[F(__has_trivial_copy(VirtAr
))];
280 int t19
[F(__has_trivial_copy(void))];
281 int t20
[F(__has_trivial_copy(cvoid
))];
282 int t21
[F(__has_trivial_copy(HasTemplateCons
))];
285 void has_trivial_copy_assignment() {
286 int t01
[T(__has_trivial_assign(Int
))];
287 int t02
[T(__has_trivial_assign(IntAr
))];
288 int t03
[T(__has_trivial_assign(Union
))];
289 int t04
[T(__has_trivial_assign(UnionAr
))];
290 int t05
[T(__has_trivial_assign(POD
))];
291 int t06
[T(__has_trivial_assign(Derives
))];
292 int t07
[F(__has_trivial_assign(ConstIntAr
))];
293 int t08
[F(__has_trivial_assign(ConstIntArAr
))];
294 int t09
[T(__has_trivial_assign(HasDest
))];
295 int t10
[T(__has_trivial_assign(HasPriv
))];
296 int t11
[T(__has_trivial_assign(HasCons
))];
297 int t12
[T(__has_trivial_assign(HasRef
))];
298 int t13
[T(__has_trivial_assign(HasCopy
))];
299 int t14
[F(__has_trivial_assign(IntRef
))];
300 int t15
[F(__has_trivial_assign(HasCopyAssign
))];
301 int t16
[F(__has_trivial_assign(const Int
))];
302 int t17
[F(__has_trivial_assign(NonPODAr
))];
303 int t18
[F(__has_trivial_assign(VirtAr
))];
304 int t19
[F(__has_trivial_assign(void))];
305 int t20
[F(__has_trivial_assign(cvoid
))];
308 void has_trivial_destructor() {
309 int t01
[T(__has_trivial_destructor(Int
))];
310 int t02
[T(__has_trivial_destructor(IntAr
))];
311 int t03
[T(__has_trivial_destructor(Union
))];
312 int t04
[T(__has_trivial_destructor(UnionAr
))];
313 int t05
[T(__has_trivial_destructor(POD
))];
314 int t06
[T(__has_trivial_destructor(Derives
))];
315 int t07
[T(__has_trivial_destructor(ConstIntAr
))];
316 int t08
[T(__has_trivial_destructor(ConstIntArAr
))];
317 int t09
[F(__has_trivial_destructor(HasDest
))];
318 int t10
[T(__has_trivial_destructor(HasPriv
))];
319 int t11
[T(__has_trivial_destructor(HasCons
))];
320 int t12
[T(__has_trivial_destructor(HasRef
))];
321 int t13
[T(__has_trivial_destructor(HasCopy
))];
322 int t14
[T(__has_trivial_destructor(IntRef
))];
323 int t15
[T(__has_trivial_destructor(HasCopyAssign
))];
324 int t16
[T(__has_trivial_destructor(const Int
))];
325 int t17
[T(__has_trivial_destructor(NonPODAr
))];
326 int t18
[T(__has_trivial_destructor(VirtAr
))];
327 int t19
[F(__has_trivial_destructor(void))];
328 int t20
[F(__has_trivial_destructor(cvoid
))];
331 struct A
{ ~A() {} };
332 template<typename
> struct B
: A
{ };
335 int t01
[F(__has_trivial_destructor(A
))];
336 int t02
[F(__has_trivial_destructor(B
<int>))];
339 void has_nothrow_assign() {
340 int t01
[T(__has_nothrow_assign(Int
))];
341 int t02
[T(__has_nothrow_assign(IntAr
))];
342 int t03
[T(__has_nothrow_assign(Union
))];
343 int t04
[T(__has_nothrow_assign(UnionAr
))];
344 int t05
[T(__has_nothrow_assign(POD
))];
345 int t06
[T(__has_nothrow_assign(Derives
))];
346 int t07
[F(__has_nothrow_assign(ConstIntAr
))];
347 int t08
[F(__has_nothrow_assign(ConstIntArAr
))];
348 int t09
[T(__has_nothrow_assign(HasDest
))];
349 int t10
[T(__has_nothrow_assign(HasPriv
))];
350 int t11
[T(__has_nothrow_assign(HasCons
))];
351 int t12
[T(__has_nothrow_assign(HasRef
))];
352 int t13
[T(__has_nothrow_assign(HasCopy
))];
353 int t14
[F(__has_nothrow_assign(IntRef
))];
354 int t15
[F(__has_nothrow_assign(HasCopyAssign
))];
355 int t16
[F(__has_nothrow_assign(const Int
))];
356 int t17
[F(__has_nothrow_assign(NonPODAr
))];
357 int t18
[F(__has_nothrow_assign(VirtAr
))];
358 int t19
[T(__has_nothrow_assign(HasNoThrowCopyAssign
))];
359 int t20
[F(__has_nothrow_assign(HasMultipleCopyAssign
))];
360 int t21
[T(__has_nothrow_assign(HasMultipleNoThrowCopyAssign
))];
361 int t22
[F(__has_nothrow_assign(void))];
362 int t23
[F(__has_nothrow_assign(cvoid
))];
363 int t24
[T(__has_nothrow_assign(HasVirtDest
))];
366 void has_nothrow_copy() {
367 int t01
[T(__has_nothrow_copy(Int
))];
368 int t02
[T(__has_nothrow_copy(IntAr
))];
369 int t03
[T(__has_nothrow_copy(Union
))];
370 int t04
[T(__has_nothrow_copy(UnionAr
))];
371 int t05
[T(__has_nothrow_copy(POD
))];
372 int t06
[T(__has_nothrow_copy(Derives
))];
373 int t07
[T(__has_nothrow_copy(ConstIntAr
))];
374 int t08
[T(__has_nothrow_copy(ConstIntArAr
))];
375 int t09
[T(__has_nothrow_copy(HasDest
))];
376 int t10
[T(__has_nothrow_copy(HasPriv
))];
377 int t11
[T(__has_nothrow_copy(HasCons
))];
378 int t12
[T(__has_nothrow_copy(HasRef
))];
379 int t13
[F(__has_nothrow_copy(HasCopy
))];
380 int t14
[T(__has_nothrow_copy(IntRef
))];
381 int t15
[T(__has_nothrow_copy(HasCopyAssign
))];
382 int t16
[T(__has_nothrow_copy(const Int
))];
383 int t17
[F(__has_nothrow_copy(NonPODAr
))];
384 int t18
[F(__has_nothrow_copy(VirtAr
))];
386 int t19
[T(__has_nothrow_copy(HasNoThrowCopy
))];
387 int t20
[F(__has_nothrow_copy(HasMultipleCopy
))];
388 int t21
[T(__has_nothrow_copy(HasMultipleNoThrowCopy
))];
389 int t22
[F(__has_nothrow_copy(void))];
390 int t23
[F(__has_nothrow_copy(cvoid
))];
391 int t24
[T(__has_nothrow_copy(HasVirtDest
))];
392 int t25
[T(__has_nothrow_copy(HasTemplateCons
))];
395 void has_nothrow_constructor() {
396 int t01
[T(__has_nothrow_constructor(Int
))];
397 int t02
[T(__has_nothrow_constructor(IntAr
))];
398 int t03
[T(__has_nothrow_constructor(Union
))];
399 int t04
[T(__has_nothrow_constructor(UnionAr
))];
400 int t05
[T(__has_nothrow_constructor(POD
))];
401 int t06
[T(__has_nothrow_constructor(Derives
))];
402 int t07
[T(__has_nothrow_constructor(ConstIntAr
))];
403 int t08
[T(__has_nothrow_constructor(ConstIntArAr
))];
404 int t09
[T(__has_nothrow_constructor(HasDest
))];
405 int t10
[T(__has_nothrow_constructor(HasPriv
))];
406 int t11
[F(__has_nothrow_constructor(HasCons
))];
407 int t12
[F(__has_nothrow_constructor(HasRef
))];
408 int t13
[F(__has_nothrow_constructor(HasCopy
))];
409 int t14
[F(__has_nothrow_constructor(IntRef
))];
410 int t15
[T(__has_nothrow_constructor(HasCopyAssign
))];
411 int t16
[T(__has_nothrow_constructor(const Int
))];
412 int t17
[T(__has_nothrow_constructor(NonPODAr
))];
413 // int t18[T(__has_nothrow_constructor(VirtAr))]; // not implemented
415 int t19
[T(__has_nothrow_constructor(HasNoThrowConstructor
))];
416 int t20
[F(__has_nothrow_constructor(HasNoThrowConstructorWithArgs
))];
417 int t21
[F(__has_nothrow_constructor(void))];
418 int t22
[F(__has_nothrow_constructor(cvoid
))];
419 int t23
[T(__has_nothrow_constructor(HasVirtDest
))];
420 int t24
[F(__has_nothrow_constructor(HasTemplateCons
))];
423 void has_virtual_destructor() {
424 int t01
[F(__has_virtual_destructor(Int
))];
425 int t02
[F(__has_virtual_destructor(IntAr
))];
426 int t03
[F(__has_virtual_destructor(Union
))];
427 int t04
[F(__has_virtual_destructor(UnionAr
))];
428 int t05
[F(__has_virtual_destructor(POD
))];
429 int t06
[F(__has_virtual_destructor(Derives
))];
430 int t07
[F(__has_virtual_destructor(ConstIntAr
))];
431 int t08
[F(__has_virtual_destructor(ConstIntArAr
))];
432 int t09
[F(__has_virtual_destructor(HasDest
))];
433 int t10
[F(__has_virtual_destructor(HasPriv
))];
434 int t11
[F(__has_virtual_destructor(HasCons
))];
435 int t12
[F(__has_virtual_destructor(HasRef
))];
436 int t13
[F(__has_virtual_destructor(HasCopy
))];
437 int t14
[F(__has_virtual_destructor(IntRef
))];
438 int t15
[F(__has_virtual_destructor(HasCopyAssign
))];
439 int t16
[F(__has_virtual_destructor(const Int
))];
440 int t17
[F(__has_virtual_destructor(NonPODAr
))];
441 int t18
[F(__has_virtual_destructor(VirtAr
))];
443 int t19
[T(__has_virtual_destructor(HasVirtDest
))];
444 int t20
[T(__has_virtual_destructor(DerivedVirtDest
))];
445 int t21
[F(__has_virtual_destructor(VirtDestAr
))];
446 int t22
[F(__has_virtual_destructor(void))];
447 int t23
[F(__has_virtual_destructor(cvoid
))];
452 class Derived
: Base
{};
453 class Derived2a
: Derived
{};
454 class Derived2b
: Derived
{};
455 class Derived3
: virtual Derived2a
, virtual Derived2b
{};
456 template<typename T
> struct BaseA
{ T a
; };
457 template<typename T
> struct DerivedB
: BaseA
<T
> { };
458 template<typename T
> struct CrazyDerived
: T
{ };
461 class class_forward
; // expected-note {{forward declaration of 'class_forward'}}
463 template <typename Base
, typename Derived
>
465 int t
[T(__is_base_of(Base
, Derived
))];
467 template <typename Base
, typename Derived
>
469 int t
[F(__is_base_of(Base
, Derived
))];
472 template <class T
> class DerivedTemp
: Base
{};
473 template <class T
> class NonderivedTemp
{};
474 template <class T
> class UndefinedTemp
; // expected-note {{declared here}}
477 int t01
[T(__is_base_of(Base
, Derived
))];
478 int t02
[T(__is_base_of(const Base
, Derived
))];
479 int t03
[F(__is_base_of(Derived
, Base
))];
480 int t04
[F(__is_base_of(Derived
, int))];
481 int t05
[T(__is_base_of(Base
, Base
))];
482 int t06
[T(__is_base_of(Base
, Derived3
))];
483 int t07
[T(__is_base_of(Derived
, Derived3
))];
484 int t08
[T(__is_base_of(Derived2b
, Derived3
))];
485 int t09
[T(__is_base_of(Derived2a
, Derived3
))];
486 int t10
[T(__is_base_of(BaseA
<int>, DerivedB
<int>))];
487 int t11
[F(__is_base_of(DerivedB
<int>, BaseA
<int>))];
488 int t12
[T(__is_base_of(Base
, CrazyDerived
<Base
>))];
489 int t13
[F(__is_base_of(Union
, Union
))];
490 int t14
[T(__is_base_of(Empty
, Empty
))];
491 int t15
[T(__is_base_of(class_forward
, class_forward
))];
492 int t16
[F(__is_base_of(Empty
, class_forward
))]; // expected-error {{incomplete type 'class_forward' used in type trait expression}}
493 int t17
[F(__is_base_of(Base
&, Derived
&))];
494 int t18
[F(__is_base_of(Base
[10], Derived
[10]))];
495 int t19
[F(__is_base_of(int, int))];
496 int t20
[F(__is_base_of(long, int))];
497 int t21
[T(__is_base_of(Base
, DerivedTemp
<int>))];
498 int t22
[F(__is_base_of(Base
, NonderivedTemp
<int>))];
499 int t23
[F(__is_base_of(Base
, UndefinedTemp
<int>))]; // expected-error {{implicit instantiation of undefined template 'UndefinedTemp<int>'}}
501 isBaseOfT
<Base
, Derived
>();
502 isBaseOfF
<Derived
, Base
>();
504 isBaseOfT
<Base
, CrazyDerived
<Base
> >();
505 isBaseOfF
<CrazyDerived
<Base
>, Base
>();
507 isBaseOfT
<BaseA
<int>, DerivedB
<int> >();
508 isBaseOfF
<DerivedB
<int>, BaseA
<int> >();
511 struct FromInt
{ FromInt(int); };
512 struct ToInt
{ operator int(); };
513 typedef void Function();
515 void is_convertible_to();
517 PrivateCopy(const PrivateCopy
&);
518 friend void is_convertible_to();
523 template<typename U
> X0(const X0
<U
>&);
526 void is_convertible_to() {
527 int t01
[T(__is_convertible_to(Int
, Int
))];
528 int t02
[F(__is_convertible_to(Int
, IntAr
))];
529 int t03
[F(__is_convertible_to(IntAr
, IntAr
))];
530 int t04
[T(__is_convertible_to(void, void))];
531 int t05
[T(__is_convertible_to(cvoid
, void))];
532 int t06
[T(__is_convertible_to(void, cvoid
))];
533 int t07
[T(__is_convertible_to(cvoid
, cvoid
))];
534 int t08
[T(__is_convertible_to(int, FromInt
))];
535 int t09
[T(__is_convertible_to(long, FromInt
))];
536 int t10
[T(__is_convertible_to(double, FromInt
))];
537 int t11
[T(__is_convertible_to(const int, FromInt
))];
538 int t12
[T(__is_convertible_to(const int&, FromInt
))];
539 int t13
[T(__is_convertible_to(ToInt
, int))];
540 int t14
[T(__is_convertible_to(ToInt
, const int&))];
541 int t15
[T(__is_convertible_to(ToInt
, long))];
542 int t16
[F(__is_convertible_to(ToInt
, int&))];
543 int t17
[F(__is_convertible_to(ToInt
, FromInt
))];
544 int t18
[T(__is_convertible_to(IntAr
&, IntAr
&))];
545 int t19
[T(__is_convertible_to(IntAr
&, const IntAr
&))];
546 int t20
[F(__is_convertible_to(const IntAr
&, IntAr
&))];
547 int t21
[F(__is_convertible_to(Function
, Function
))];
548 int t22
[F(__is_convertible_to(PrivateCopy
, PrivateCopy
))];
549 int t23
[T(__is_convertible_to(X0
<int>, X0
<float>))];