Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/p3060c.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do assemble } |
2 // A new problem with my pointer to member function work. | |
3 // prms-id: 3060 | |
4 | |
5 class Foo | |
6 { | |
7 public: | |
8 int x; | |
9 int y; | |
10 Foo (int i, int j) { x = i; y = j; } | |
11 operator int (); | |
12 }; | |
13 | |
14 int Foo::operator int() { return x; } // { dg-error "return" } can't specify return type | |
15 | |
16 Foo foo(10, 11); | |
17 | |
18 int | |
19 main() | |
20 { | |
21 int Foo::* pmi = &Foo::y; | |
22 return foo.*pmi; | |
23 } |