summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.old-deja/g++.other/loop2.C
blob: 7fd90c714b63fc6b377114a72d16384c68e6aa98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Build don't link:
// Special g++ Options: -O

class foo {
public:
  operator const char*() const { return a; }
  char *a;
};

class bar {
public:
  ~bar();
  void operator++(int);
  bool b() const;
protected:
  void* c() const;
};

class baz : public bar {
public:
  foo const &d() const { return *(foo *)bar::c(); }
};

extern int tst (const char *, const char *) throw();

void die(const foo& x)
{
  for (baz hi; hi.b(); hi++)
    if (tst (hi.d(), x) == 0)
      return;
}
OpenPOWER on IntegriCloud