This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH Re: remove C++ warning about all private c/dtors and nofriends?
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 Jan 2003 04:14:24 -0500
- Subject: PATCH Re: remove C++ warning about all private c/dtors and nofriends?
- References: <wvlr8bqgkog.fsf@prospero.boston.redhat.com>
It turns out that the code for the warning already tried to handle this
case, but failed due to a bug. The fix is simple, so I've made it rather
than remove the warning entirely.
Test in g++.dg/warn/private1.C. Tested i686-pc-linux-gnu, applied to 3.3
and trunk.
2003-01-13 Jason Merrill <jason@redhat.com>
* class.c (maybe_warn_about_overly_private_class): Don't stop
searching when we find a nonprivate method.
*** class.c.~1~ Sun Jan 12 22:55:58 2003
--- class.c Sun Jan 12 22:51:24 2003
*************** maybe_warn_about_overly_private_class (t
*** 1833,1839 ****
return;
has_nonprivate_method = 1;
! break;
}
else if (!DECL_CONSTRUCTOR_P (fn) && !DECL_DESTRUCTOR_P (fn))
has_member_fn = 1;
--- 1835,1841 ----
return;
has_nonprivate_method = 1;
! /* Keep searching for a static member function. */
}
else if (!DECL_CONSTRUCTOR_P (fn) && !DECL_DESTRUCTOR_P (fn))
has_member_fn = 1;