From b8b0126f617808155127ac3ceef7166af3edb5fa Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 24 Mar 1999 22:28:05 -0500 Subject: [PATCH] new From-SVN: r25968 --- gcc/testsuite/g++.old-deja/g++.other/conv6.C | 28 +++++++++++++++++++ .../g++.old-deja/g++.other/lookup11.C | 12 ++++++++ .../g++.old-deja/g++.other/ptrmem4.C | 12 ++++++++ 3 files changed, 52 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/conv6.C create mode 100644 gcc/testsuite/g++.old-deja/g++.other/lookup11.C create mode 100644 gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv6.C b/gcc/testsuite/g++.old-deja/g++.other/conv6.C new file mode 100644 index 00000000000..918e69742d8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/conv6.C @@ -0,0 +1,28 @@ +// Test for composite pointer types, as defined in [expr.rel], +// and common pointer to member types, as defined in [expr.eq]. + +struct A { int i; }; +struct B : public A { }; + +int main () +{ + B b; + + // The composite type is `A const *' + A* ap = &b; + const B* bp = &b; + if (ap != bp) // gets bogus error - distinct types XFAIL *-*-* + return 1; + + // The composite type is `B const *const *' + B *const * p = 0; + B const * * q = 0; + if (p != q) // gets bogus error - distinct types XFAIL *-*-* + return 1; + + // The common type is `int const B::*' + const int A::*apm = &A::i; + int B::*bpm = &A::i; + if (apm != bpm) // gets bogus error - distinct types XFAIL *-*-* + return 1; +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup11.C b/gcc/testsuite/g++.old-deja/g++.other/lookup11.C new file mode 100644 index 00000000000..61a6e91d545 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/lookup11.C @@ -0,0 +1,12 @@ +// Build don't link: + +namespace A { + int i; +} +using namespace A; +namespace B { + int i; +} +using namespace B; + +int i; diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C new file mode 100644 index 00000000000..dc378b23e6f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C @@ -0,0 +1,12 @@ +// Test to make sure g++ can handle target types that aren't identical +// with pointers to members. + +struct A { int i; }; +struct B : public A { }; + +int main () +{ + int A::*p = &A::i; + const int B::*q = &A::i; + return p != q; +} -- 2.30.2