re PR c++/5453 (Compiled program crash - inheritance/template/friend class problem)
authorJason Merrill <jason@gcc.gnu.org>
Wed, 23 Jan 2002 12:49:48 +0000 (07:49 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 23 Jan 2002 12:49:48 +0000 (07:49 -0500)
        PR c++/5453
        * class.c (fixed_type_or_null): Fix thinko.

From-SVN: r49135

gcc/testsuite/g++.dg/inherit/null1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/inherit/null1.C b/gcc/testsuite/g++.dg/inherit/null1.C
new file mode 100644 (file)
index 0000000..0908a01
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/5453: Test that we don't assume that the pointer target of a
+// reference is non-null just because we know the reference isn't.
+
+// { dg-do run }
+
+struct V { };
+struct A: virtual public V { };
+
+A* ap;
+A*& apr (ap);
+
+int main ()
+{
+  V* vp = apr;
+}