aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/covariant5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/abi/covariant5.C')
-rw-r--r--gcc/testsuite/g++.dg/abi/covariant5.C52
1 files changed, 0 insertions, 52 deletions
diff --git a/gcc/testsuite/g++.dg/abi/covariant5.C b/gcc/testsuite/g++.dg/abi/covariant5.C
deleted file mode 100644
index 03e55583d03..00000000000
--- a/gcc/testsuite/g++.dg/abi/covariant5.C
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation, Inc.
-// Contributed by Nathan Sidwell 4 Apr 2005 <nathan@codesourcery.com>
-
-// { dg-do run }
-
-// PR 20746: Covariant return pointer could be null.
-
-// Origin: yanliu@ca.ibm.com
-// nathan@codesourcery.com
-
-struct A {
- virtual void One ();
-};
-struct B {
- virtual B *Two ();
- virtual B &Three ();
-};
-
-struct C : A, B
-{
- virtual C *Two ();
- virtual C &Three ();
-};
-void A::One () {}
-B *B::Two() {return this;}
-B &B::Three() {return *this;}
-C *C::Two () {return 0;}
-C &C::Three () {return *(C *)0;}
-
-B *Foo (B *b)
-{
- return b->Two ();
-}
-
-B &Bar (B *b)
-{
- return b->Three ();
-}
-
-int main ()
-{
- C c;
-
- /* We should not adjust a null pointer. */
- if (Foo (&c))
- return 1;
- /* But we should adjust a (bogus) null reference. */
- if (!&Bar (&c))
- return 2;
-
- return 0;
-}