cxx_exprs.cpp revision eb7f96141f754150a92433286fa385910a22f494
1// Test this without pch.
2// RUN: %clang_cc1 -include %S/cxx_exprs.h -std=c++0x -fsyntax-only -verify %s
3
4// Test with pch.
5// RUN: %clang_cc1 -x c++-header -std=c++0x -emit-pch -o %t %S/cxx_exprs.h
6// RUN: %clang_cc1 -std=c++0x -include-pch %t -fsyntax-only -verify %s
7
8int integer;
9double floating;
10char character;
11bool boolean;
12
13// CXXStaticCastExpr
14static_cast_result void_ptr = &integer;
15
16// CXXDynamicCastExpr
17Derived *d;
18dynamic_cast_result derived_ptr = d;
19
20// CXXReinterpretCastExpr
21reinterpret_cast_result void_ptr2 = &integer;
22
23// CXXConstCastExpr
24const_cast_result char_ptr = &character;
25
26// CXXFunctionalCastExpr
27functional_cast_result *double_ptr = &floating;
28
29// CXXBoolLiteralExpr
30bool_literal_result *bool_ptr = &boolean;
31static_assert(true_value, "true_value is true");
32static_assert(!false_value, "false_value is false");
33
34// CXXNullPtrLiteralExpr
35cxx_null_ptr_result null_ptr = nullptr;
36