summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-casting.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-23 06:12:15 +0000
committerChris Lattner <sabre@nondot.org>2007-01-23 06:12:15 +0000
commit3e30f7c70f43835adac87c655c09db901663232b (patch)
tree7da4994b53f477ad089e1cb768479b767c01b503 /clang/test/Parser/cxx-casting.cpp
parentfb072463e5307b1ce0adfc96bba71e4a65739f87 (diff)
downloadbcm5719-llvm-3e30f7c70f43835adac87c655c09db901663232b.tar.gz
bcm5719-llvm-3e30f7c70f43835adac87c655c09db901663232b.zip
add a testcase for c++ casting operators, by Bill
llvm-svn: 39285
Diffstat (limited to 'clang/test/Parser/cxx-casting.cpp')
-rw-r--r--clang/test/Parser/cxx-casting.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-casting.cpp b/clang/test/Parser/cxx-casting.cpp
new file mode 100644
index 00000000000..1e06e981e4c
--- /dev/null
+++ b/clang/test/Parser/cxx-casting.cpp
@@ -0,0 +1,31 @@
+// RUN: clang -fsyntax-only %s
+
+char *const_cast_test(const char *var)
+{
+ return const_cast<char*>(var);
+}
+
+#if 0
+// FIXME: Uncomment when C++ is supported more.
+struct A {
+ virtual ~A() {}
+};
+
+struct B : public A {
+};
+
+struct B *dynamic_cast_test(struct A *a)
+{
+ return dynamic_cast<struct B*>(a);
+}
+#endif
+
+char *reinterpret_cast_test()
+{
+ return reinterpret_cast<char*>(0xdeadbeef);
+}
+
+double static_cast_test(int i)
+{
+ return static_cast<double>(i);
+}
OpenPOWER on IntegriCloud