blob: 1fdc28d2c8800fef54c0073f1d80a0824591266f [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only %s
Reid Spencer5f016e22007-07-11 17:01:13 +00002
3char *const_cast_test(const char *var)
4{
5 return const_cast<char*>(var);
6}
7
8#if 0
9// FIXME: Uncomment when C++ is supported more.
10struct A {
11 virtual ~A() {}
12};
13
14struct B : public A {
15};
16
17struct B *dynamic_cast_test(struct A *a)
18{
19 return dynamic_cast<struct B*>(a);
20}
21#endif
22
23char *reinterpret_cast_test()
24{
25 return reinterpret_cast<char*>(0xdeadbeef);
26}
27
28double static_cast_test(int i)
29{
30 return static_cast<double>(i);
31}
Argyrios Kyrtzidisb348b812008-08-16 19:45:32 +000032
33char postfix_expr_test()
34{
35 return reinterpret_cast<char*>(0xdeadbeef)[0];
Daniel Dunbard7d5f022009-03-24 02:24:46 +000036}