static void maybe_warn_about_overly_private_class (tree);
static int method_name_cmp (const void *, const void *);
static int resort_method_name_cmp (const void *, const void *);
-static void add_implicitly_declared_members (tree, int, int, int, int);
+static void add_implicitly_declared_members (tree, int, int);
static tree fixed_type_or_null (tree, int *, int *);
static tree build_simple_base_path (tree expr, tree binfo);
static tree build_vtbl_ref_1 (tree, tree);
static int count_fields (tree);
static int add_fields_to_record_type (tree, struct sorted_fields_type*, int);
static bool check_bitfield_decl (tree);
-static void check_field_decl (tree, tree, int *, int *, int *, int *, int *);
-static void check_field_decls (tree, tree *, int *, int *, int *, int *);
+static void check_field_decl (tree, tree, int *, int *, int *);
+static void check_field_decls (tree, tree *, int *, int *);
static tree *build_base_field (record_layout_info, tree, splay_tree, tree *);
static void build_base_fields (record_layout_info, splay_tree, tree *);
static void check_methods (tree);
static void remove_zero_width_bit_fields (tree);
-static void check_bases (tree, int *, int *, int *, int *);
+static void check_bases (tree, int *, int *);
static void check_bases_and_members (tree);
static tree create_vtable_ptr (tree, tree *);
static void include_empty_classes (record_layout_info);
static void
check_bases (tree t,
int* cant_have_const_ctor_p,
- int* no_const_asn_ref_p,
- int* cant_have_lazy_ctor,
- int* cant_have_lazy_opeq)
+ int* no_const_asn_ref_p)
{
int i;
int seen_non_virtual_nearly_empty_base_p;
if (TYPE_HAS_COPY_ASSIGN (basetype)
&& !TYPE_HAS_CONST_COPY_ASSIGN (basetype))
*no_const_asn_ref_p = 1;
- if (TYPE_HAS_USER_CONSTRUCTOR (basetype))
- *cant_have_lazy_ctor = 1;
- if (TYPE_HAS_USER_OPEQ (basetype))
- *cant_have_lazy_opeq = 1;
if (BINFO_VIRTUAL_P (base_binfo))
/* A virtual base does not effect nearly emptiness. */
static void
add_implicitly_declared_members (tree t,
int cant_have_const_cctor,
- int cant_have_const_assignment,
- int cant_have_lazy_ctor,
- int cant_have_lazy_opeq)
+ int cant_have_const_assignment)
{
/* Destructor. */
if (!CLASSTYPE_DESTRUCTORS (t))
CLASSTYPE_LAZY_MOVE_ASSIGN (t) = 1;
}
- /* If a base or member type has a user-declared constructor or operator=,
- we need to declare ours now to avoid issues with circular lazy
- declarations (cpp0x/implicit6.C). */
- if (cant_have_lazy_ctor)
- {
- if (CLASSTYPE_LAZY_DEFAULT_CTOR (t))
- lazily_declare_fn (sfk_constructor, t);
- if (CLASSTYPE_LAZY_COPY_CTOR (t))
- lazily_declare_fn (sfk_copy_constructor, t);
- if (CLASSTYPE_LAZY_MOVE_CTOR (t))
- lazily_declare_fn (sfk_move_constructor, t);
- }
- if (cant_have_lazy_opeq)
- {
- if (CLASSTYPE_LAZY_COPY_ASSIGN (t))
- lazily_declare_fn (sfk_copy_assignment, t);
- if (CLASSTYPE_LAZY_MOVE_ASSIGN (t))
- lazily_declare_fn (sfk_move_assignment, t);
- }
-
/* We can't be lazy about declaring functions that might override
a virtual function from a base class. */
if (TYPE_POLYMORPHIC_P (t)
tree t,
int* cant_have_const_ctor,
int* no_const_asn_ref,
- int* any_default_members,
- int* cant_have_lazy_ctor,
- int* cant_have_lazy_opeq)
+ int* any_default_members)
{
tree type = strip_array_types (TREE_TYPE (field));
for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields))
if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field))
check_field_decl (fields, t, cant_have_const_ctor,
- no_const_asn_ref, any_default_members,
- cant_have_lazy_ctor, cant_have_lazy_opeq);
+ no_const_asn_ref, any_default_members);
}
/* Check members with class type for constructors, destructors,
etc. */
if (TYPE_HAS_COPY_ASSIGN (type)
&& !TYPE_HAS_CONST_COPY_ASSIGN (type))
*no_const_asn_ref = 1;
-
- if (TYPE_HAS_USER_CONSTRUCTOR (type))
- *cant_have_lazy_ctor = 1;
- if (TYPE_HAS_USER_OPEQ (type))
- *cant_have_lazy_opeq = 1;
}
if (DECL_INITIAL (field) != NULL_TREE)
{
static void
check_field_decls (tree t, tree *access_decls,
int *cant_have_const_ctor_p,
- int *no_const_asn_ref_p,
- int *cant_have_lazy_ctor_p,
- int *cant_have_lazy_opeq_p)
+ int *no_const_asn_ref_p)
{
tree *field;
tree *next;
check_field_decl (x, t,
cant_have_const_ctor_p,
no_const_asn_ref_p,
- &any_default_members,
- cant_have_lazy_ctor_p,
- cant_have_lazy_opeq_p);
+ &any_default_members);
/* If any field is const, the structure type is pseudo-const. */
if (CP_TYPE_CONST_P (type))
/* Nonzero if the implicitly generated assignment operator
should take a non-const reference argument. */
int no_const_asn_ref;
- int cant_have_lazy_ctor = 0;
- int cant_have_lazy_opeq = 0;
tree access_decls;
bool saved_complex_asn_ref;
bool saved_nontrivial_dtor;
/* Check all the base-classes. */
check_bases (t, &cant_have_const_ctor,
- &no_const_asn_ref, &cant_have_lazy_ctor,
- &cant_have_lazy_opeq);
+ &no_const_asn_ref);
/* Check all the method declarations. */
check_methods (t);
being set appropriately. */
check_field_decls (t, &access_decls,
&cant_have_const_ctor,
- &no_const_asn_ref,
- &cant_have_lazy_ctor,
- &cant_have_lazy_opeq);
+ &no_const_asn_ref);
/* A nearly-empty class has to be vptr-containing; a nearly empty
class contains just a vptr. */
/* Synthesize any needed methods. */
add_implicitly_declared_members (t,
cant_have_const_ctor,
- no_const_asn_ref,
- cant_have_lazy_ctor,
- cant_have_lazy_opeq);
+ no_const_asn_ref);
/* Check defaulted declarations here so we have cant_have_const_ctor
and don't need to worry about clones. */
#define same_type_p(TYPE1, TYPE2) \
comptypes ((TYPE1), (TYPE2), COMPARE_STRICT)
-/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
- top-level qualifiers. */
-#define same_type_ignoring_top_level_qualifiers_p(TYPE1, TYPE2) \
- same_type_p (TYPE_MAIN_VARIANT (TYPE1), TYPE_MAIN_VARIANT (TYPE2))
-
/* Nonzero if we are presently building a statement tree, rather
than expanding each statement as we encounter it. */
#define building_stmt_tree() (cur_stmt_list != NULL_TREE)
unsigned lazy_move_assign : 1;
unsigned has_complex_move_ctor : 1;
unsigned has_complex_move_assign : 1;
- unsigned has_user_opeq : 1;
/* When adding a flag here, consider whether or not it ought to
apply to a template instance if it applies to the template. If
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 3;
+ unsigned dummy : 4;
tree primary_base;
VEC(tree_pair_s,gc) *vcall_indices;
user-declared constructor. */
#define TYPE_HAS_USER_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1 (NODE))
-/* ...or a user-declared operator=. */
-#define TYPE_HAS_USER_OPEQ(NODE) \
- (LANG_TYPE_CLASS_CHECK (NODE)->has_user_opeq)
-
/* When appearing in an INDIRECT_REF, it means that the tree structure
underneath is actually a call to a constructor. This is needed
when the constructor must initialize local storage (which can
enum { ce_derived, ce_normal, ce_exact };
extern bool comp_except_specs (const_tree, const_tree, int);
extern bool comptypes (tree, tree, int);
+extern bool same_type_ignoring_top_level_qualifiers_p (tree, tree);
extern bool compparms (const_tree, const_tree);
extern int comp_cv_qualification (const_tree, const_tree);
extern int comp_cv_qual_signature (tree, tree);