1 // { dg-options "-fdiagnostics-show-caret" }
6 int get_doubled_field () const { return m_field * 2; }
7 int get_guarded_field_1 () const { if (m_field) return m_field; else return 42; }
8 int get_guarded_field_2 () const { return m_field ? m_field : 42; }
9 int with_unreachable () const { __builtin_unreachable (); return m_field; }
13 int m_field; // { dg-line field_decl }
18 return ptr->m_field; // { dg-error ".int t1::m_field. is private within this context" }
19 /* { dg-begin-multiline-output "" }
22 { dg-end-multiline-output "" } */
24 // { dg-message "declared private here" "" { target *-*-* } field_decl }
25 /* { dg-begin-multiline-output "" }
28 { dg-end-multiline-output "" } */
30 /* We shouldn't issue a suggestion: none of the member functions are suitable returns. */