Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/parse/access4.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 compile } |
2 | |
3 // Origin: Mike Reed <mike.reed@amadron.com> | |
4 | |
5 // PR c++/11174: Access checking of pointer-to-member function | |
6 | |
7 class A { | |
8 protected: | |
9 void foo() {} // { dg-message "protected" } | |
10 public: | |
11 A(); | |
12 }; | |
13 | |
14 class B : public A { | |
15 void bar() { | |
16 A a; | |
17 void (A::*pmf)() = &A::foo; // { dg-error "this context" } | |
18 (a.*pmf)(); | |
19 } | |
20 }; |