summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/nested2.C
blob: af2d92b0909a8384c98e7617e737a3336e37141c (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
// { dg-do assemble  }
// PRMS Id: 3764 (c/h)
// Bug: g++ gets into an infinite loop trying to find the top-level context

class Menu;
class MenuItem;

class MenuAction {
public:
  virtual void execute (Menu& menu, MenuItem& menuItem) = 0;
protected:
  MenuAction () {}
}; 

class Test {
  class MenuCBA : public MenuAction {
  public:
    typedef void (Test::* MenuCBA_Member) (Menu& menu, MenuItem& menuItem);
    MenuCBA (Test& instance, MenuCBA_Member member)
      : _instance(&instance), _member(member) {	}
    void execute (Menu& menu, MenuItem& menuItem);
  private:
    MenuCBA_Member _member;
    Test* _instance;
  };
};