[cfe-commits] r39285 - /cfe/cfe/trunk/test/Parser/cxx-casting.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:42:29 PDT 2007
Author: sabre
Date: Wed Jul 11 11:42:28 2007
New Revision: 39285
URL: http://llvm.org/viewvc/llvm-project?rev=39285&view=rev
Log:
add a testcase for c++ casting operators, by Bill
Added:
cfe/cfe/trunk/test/Parser/cxx-casting.cpp (with props)
Added: cfe/cfe/trunk/test/Parser/cxx-casting.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/cxx-casting.cpp?rev=39285&view=auto
==============================================================================
--- cfe/cfe/trunk/test/Parser/cxx-casting.cpp (added)
+++ cfe/cfe/trunk/test/Parser/cxx-casting.cpp Wed Jul 11 11:42:28 2007
@@ -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);
+}
Propchange: cfe/cfe/trunk/test/Parser/cxx-casting.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/cfe/trunk/test/Parser/cxx-casting.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
More information about the cfe-commits
mailing list