1 // Header for PCH test cxx_exprs.cpp
5 typedef __typeof__(static_cast<void *>(0)) static_cast_result
;
8 struct Base
{ Base(int); virtual void f(int x
= 492); ~Base(); };
9 struct Derived
: Base
{ Derived(); void g(); };
11 typedef __typeof__(dynamic_cast<Derived
*>(base_ptr
)) dynamic_cast_result
;
13 // CXXReinterpretCastExpr
14 typedef __typeof__(reinterpret_cast<void *>(0)) reinterpret_cast_result
;
17 const char *const_char_ptr_value
;
18 typedef __typeof__(const_cast<char *>(const_char_ptr_value
)) const_cast_result
;
20 // CXXFunctionalCastExpr
22 typedef __typeof__(double(int_value
)) functional_cast_result
;
25 typedef __typeof__(true) bool_literal_result
;
26 const bool true_value
= true;
27 const bool false_value
= false;
29 // CXXNullPtrLiteralExpr
30 typedef __typeof__(nullptr) cxx_null_ptr_result
;
32 void foo(Derived
*P
) {
38 // FIXME: This is a hack until <typeinfo> works completely.
43 // CXXTypeidExpr - Both expr and type forms.
44 typedef __typeof__(typeid(int))* typeid_result1
;
45 typedef __typeof__(typeid(2))* typeid_result2
;
49 Derived::Derived() : Base(4) {
55 this->f(1); // Explicit
64 const Derived
&X
= foo();
66 // FIXME: How do I make a CXXBindReferenceExpr, CXXConstructExpr?
68 int A
= int(0.5); // CXXFunctionalCastExpr
69 A
= int(); // CXXZeroInitValueExpr
71 Base
*b
= new Base(4); // CXXNewExpr
72 delete b
; // CXXDeleteExpr
76 // FIXME: The comment on CXXTemporaryObjectExpr is broken, this doesn't make
78 struct CtorStruct
{ CtorStruct(int, float); };
80 CtorStruct
create_CtorStruct() {
81 return CtorStruct(1, 3.14f
); // CXXTemporaryObjectExpr
84 // CharacterLiteral variants
85 const char char_value
= 'a';
86 const wchar_t wchar_t_value
= L
'ı';
87 const char16_t char16_t_value
= u
'ç';
88 const char32_t char32_t_value
= U
'∂';