mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-05 13:51:57 +08:00
class.c (maybe_warn_about_overly_private_class): Improve error messages for class with only private constructors.
* class.c (maybe_warn_about_overly_private_class): Improve error messages for class with only private constructors. From-SVN: r23111
This commit is contained in:
parent
45869a6cab
commit
ce0a595295
@ -1,3 +1,15 @@
|
||||
1998-10-15 Mark Mitchell <mark@markmitchell.com>
|
||||
|
||||
* class.c (maybe_warn_about_overly_private_class): Improve error
|
||||
messages for class with only private constructors.
|
||||
|
||||
* cp-tree.def (TYPENAME_TYPE): Add to documentation.
|
||||
* cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
|
||||
(build_typename_type): New function.
|
||||
* decl.c (build_typename_type): Broken out from ...
|
||||
(make_typename_type): Use it.
|
||||
* search.c (lookup_field): Likewise.
|
||||
|
||||
1998-10-14 Benjamin Kosnik <bkoz@rhino.cygnus.com>
|
||||
|
||||
* pt.c (convert_nontype_argument): Check against type_referred_to.
|
||||
|
@ -2013,12 +2013,18 @@ maybe_warn_about_overly_private_class (t)
|
||||
has_nonprivate_method = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
else if (!DECL_CONSTRUCTOR_P (fn) && !DECL_DESTRUCTOR_P (fn))
|
||||
has_member_fn = 1;
|
||||
}
|
||||
|
||||
if (!has_nonprivate_method && has_member_fn)
|
||||
{
|
||||
/* There are no non-private methods, and there's at least one
|
||||
private member function that isn't a constructor or
|
||||
destructor. (If all the private members are
|
||||
constructors/destructors we want to use the code below that
|
||||
issues error messages specifically referring to
|
||||
constructors/destructors.) */
|
||||
int i;
|
||||
tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
|
||||
for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); i++)
|
||||
|
Loading…
Reference in New Issue
Block a user