class.c (maybe_warn_about_overly_private_class): Don't stop searching when we find...
authorJason Merrill <jason@gcc.gnu.org>
Mon, 13 Jan 2003 09:15:29 +0000 (04:15 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 13 Jan 2003 09:15:29 +0000 (04:15 -0500)
        * 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 [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/warn/private1.C b/gcc/testsuite/g++.dg/warn/private1.C
new file mode 100644 (file)
index 0000000..c42d6b7
--- /dev/null
@@ -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;
+}