From: Jason Merrill Date: Mon, 13 Jan 2003 09:15:29 +0000 (-0500) Subject: class.c (maybe_warn_about_overly_private_class): Don't stop searching when we find... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae;p=gcc.git class.c (maybe_warn_about_overly_private_class): Don't stop searching when we find a nonprivate method. * class.c (maybe_warn_about_overly_private_class): Don't stop searching when we find a nonprivate method. From-SVN: r61248 --- diff --git a/gcc/testsuite/g++.dg/warn/private1.C b/gcc/testsuite/g++.dg/warn/private1.C new file mode 100644 index 00000000000..c42d6b7e328 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/private1.C @@ -0,0 +1,16 @@ +// g++ should not complain about A having private [cd]tors. + +class A +{ + A(); + ~A(); +public: + int dummy(); // needed to get bogus warning + static A* get_A (); +}; + +A* A::get_A() +{ + static A a; + return &a; +}