From e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 13 Jan 2003 04:15:29 -0500 Subject: [PATCH] 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 --- gcc/testsuite/g++.dg/warn/private1.C | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/warn/private1.C 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; +} -- 2.30.2