1// Test this without pch.
2// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -include %S/cxx_exprs.h -std=c++11 -fsyntax-only -verify %s -ast-dump
3
4// Test with pch. Use '-ast-dump' to force deserialization of function bodies.
5// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -x c++-header -std=c++11 -emit-pch -o %t %S/cxx_exprs.h
6// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-dump
7
8// expected-no-diagnostics
9
10int integer;
11double floating;
12char character;
13bool boolean;
14
15// CXXStaticCastExpr
16static_cast_result void_ptr = &integer;
17
18// CXXDynamicCastExpr
19Derived *d;
20dynamic_cast_result derived_ptr = d;
21
22// CXXReinterpretCastExpr
23reinterpret_cast_result void_ptr2 = &integer;
24
25// CXXConstCastExpr
26const_cast_result char_ptr = &character;
27
28// CXXFunctionalCastExpr
29functional_cast_result *double_ptr = &floating;
30
31// CXXBoolLiteralExpr
32bool_literal_result *bool_ptr = &boolean;
33static_assert(true_value, "true_value is true");
34static_assert(!false_value, "false_value is false");
35
36// CXXNullPtrLiteralExpr
37cxx_null_ptr_result null_ptr = nullptr;
38
39// CXXTypeidExpr
40typeid_result1 typeid_1 = 0;
41typeid_result2 typeid_2 = 0;
42
43// CharacterLiteral variants
44static_assert(char_value == 97, "char_value is correct");
45static_assert(wchar_t_value == 305, "wchar_t_value is correct");
46static_assert(char16_t_value == 231, "char16_t_value is correct");
47static_assert(char32_t_value == 8706, "char32_t_value is correct");
48