summaryrefslogtreecommitdiffstats
path: root/test/PCH/cxx_exprs.cpp
blob: 0f0fe88dc54aa83a9509c05662699d89cbdfa5d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Test this without pch.
// RUN: %clang_cc1 -include %S/cxx_exprs.h -std=c++0x -fsyntax-only -verify %s

// Test with pch.
// RUN: %clang_cc1 -x c++-header -std=c++0x -emit-pch -o %t %S/cxx_exprs.h
// RUN: %clang_cc1 -std=c++0x -include-pch %t -fsyntax-only -verify %s 

int integer;
double floating;
char character;
bool boolean;

// CXXStaticCastExpr
static_cast_result void_ptr = &integer;

// CXXDynamicCastExpr
Derived *d;
dynamic_cast_result derived_ptr = d;

// CXXReinterpretCastExpr
reinterpret_cast_result void_ptr2 = &integer;

// CXXConstCastExpr
const_cast_result char_ptr = &character;

// CXXFunctionalCastExpr
functional_cast_result *double_ptr = &floating;

// CXXBoolLiteralExpr
bool_literal_result *bool_ptr = &boolean;
static_assert(true_value, "true_value is true");
static_assert(!false_value, "false_value is false");

// CXXNullPtrLiteralExpr
cxx_null_ptr_result null_ptr = nullptr;
OpenPOWER on IntegriCloud