aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/warning2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/warning2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/warning2.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/warning2.C b/gcc/testsuite/g++.old-deja/g++.jason/warning2.C
new file mode 100644
index 00000000000..778a6158a8c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/warning2.C
@@ -0,0 +1,14 @@
+// g++ ought to warn about casting a base pointer to a derived reference.
+// Build don't link:
+
+struct A {
+ virtual int f () = 0;
+};
+
+struct B: public A { int f () { } };
+
+main()
+{
+ B* bp;
+ A& ar = (A&)bp; // WARNING -
+}