aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bogus-dynamic-cast/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bogus-dynamic-cast/main.cpp')
-rw-r--r--tests/bogus-dynamic-cast/main.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/bogus-dynamic-cast/main.cpp b/tests/bogus-dynamic-cast/main.cpp
deleted file mode 100644
index bca5b416..00000000
--- a/tests/bogus-dynamic-cast/main.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <QtCore/QObject>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-struct A
-{
- virtual void foo() { }
-};
-
-struct B : public A
-{
-
-};
-
-void test()
-{
- A *a = new A();
- B *b = new B();
-
- dynamic_cast<A*>(b); // warning: Casting to base
- dynamic_cast<A*>(a); // warning: Casting to itself
- dynamic_cast<B*>(a); // OK
- dynamic_cast<B*>(b); // warning: Casting to itself
-}
-
-class MyObj : public QObject
-{
-public:
-};
-
-void testQObjectCast(QObject *o)
-{
- dynamic_cast<MyObj*>(o); // OK
-}