Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / torture / accessor-fixits-7.C
blob3b5babdc5136a52808aea18f6df9c80e3636ae66
1 class foo
3 public:
4   double get_ratio() const;
6 private:
7   double m_ratio; // { dg-line field_decl }
8 };
10 double
11 foo::get_ratio() const
13   return m_ratio;
16 void test(foo *ptr)
18   if (ptr->m_ratio >= 0.5) // { dg-error "'double foo::m_ratio' is private within this context" }
19     ;
20   // { dg-message "declared private here" "" { target *-*-* } field_decl }
21   // { dg-message "'double foo::m_ratio' can be accessed via 'double foo::get_ratio\\(\\) const'" "" { target *-*-* } .-3 }