1 class foo 2 { 3 public: get_singleton()4 static foo& get_singleton () { return s_singleton; } 5 6 private: 7 static foo s_singleton; 8 }; 9 test_access_singleton()10foo & test_access_singleton () 11 { 12 return foo::s_singleton; // { dg-error ".foo foo::s_singleton. is private within this context" } 13 // { dg-message "declared private here" "" { target *-*-* } 7 } 14 // We don't yet support generating a fix-it hint for this case. 15 } 16