2 // { dg-options "-fdiagnostics-show-caret" }
9 bool get_field() const {
14 bool thingy(const S & s) {
15 return s.field; // { dg-error "'bool S::field' is private within this context" }
16 /* { dg-begin-multiline-output "" }
19 { dg-end-multiline-output "" } */
21 // { dg-message "declared private here" "" { target *-*-* } 6 }
22 /* { dg-begin-multiline-output "" }
25 { dg-end-multiline-output "" } */
27 // { dg-message "field 'bool S::field' can be accessed via 'bool S::get_field\\(\\) const'" "" { target *-*-* } .-12 }
28 /* { dg-begin-multiline-output "" }
32 { dg-end-multiline-output "" } */