OSDN Git Service

fix
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / conv6.C
1 // Test for composite pointer types, as defined in [expr.rel],
2 // and common pointer to member types, as defined in [expr.eq].
3
4 struct A { int i; };
5 struct B : public A { };
6
7 int main ()
8 {
9   B b;
10
11   // The composite type is `A const *'
12         A* ap = &b;
13   const B* bp = &b;
14   if (ap != bp)         // gets bogus error - distinct types
15     return 1;
16
17   // The composite type is `B const *const *'
18   B       *const * p = 0;
19   B const *      * q = 0;
20   if (p != q)           // gets bogus error - distinct types
21     return 1;
22
23   // The common type is `int const B::*'
24   const int A::*apm = &A::i;
25         int B::*bpm = &A::i;
26   if (apm != bpm)       // gets bogus error - distinct types
27     return 1;
28 }