summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/member.C
blob: 1abbdec1fe3d9cf31b52e42c1dff9750a69c1905 (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
32
33
34
35
// { dg-do assemble  }
// GROUPS passed member-pointers error-reporting
struct Y
{
  struct X
    {
      int A;
      int Y::X::* foo () { undef1(1); return &Y::X::A; }// { dg-error "" } foo().*
      int bar () { return A; }
    };
};

int Y::X::* foo ()
{
  undef2(1);// { dg-error "" } foo().*
  return &Y::X::A;
}

int Y::X::* (* foo2 ())()
{
  undef3(1);// { dg-error "" } foo().*
  return foo;
}

int (Y::X::* bar2 ()) ()
{
  undef4(1);// { dg-error "" } foo\(\).*
  return Y::X::bar;// { dg-error "" } foo\(\).*
}

int Y::X::* (Y::X::* foo3 ())()
{
  undef5(1);// { dg-error "" } foo().*
  return Y::X::foo;// { dg-error "" } foo().*
}