I found some bad formatting and misleading or incomplete comments
during my spelunking around the c++FE. May as well clean up trunk and
record what I noted.
gcc/cp/
* cp-tree.h: Correct some tree lang flag comments,
reformat some structure definitions. Note some structure
sizes. Clarify some comments.
(yyungetc): Delete. Not been a thing for some time.
* class.c (copy_fndecl_with_name): Comment.
(check_bases_and_members): Unnecessary {}.
(layout_class_type): Comment.
* cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
* decl.c: Fix some formatting & whitespace issues.
(function_requirements_equivalent_p): Note why
substitutions are needed.
* decl2.c (no_linkage_error): Note that heroics about
'typedef struct { ... };' are no longer needed.
* method.c: Whitespace.
* name-lookup.c: Whitespace.
(add_decl_to_level): Reformat a line.
(print_binding_stack): Mark as DEBUG_FUNCTION.
(has_using_namespace_std_directive_p): Delete comment.
* pt.c: Whitespace
* ptree.c: Whitespace.
* rtti.c: Whitespace & comment.
* tree.c: Comment.
* typeck.c (structural_comptypes): Add comment.
12 files changed:
+/* FN is constructor, destructor or operator function. Clone the
+ declaration to create a NAME'd variant. NEED_VTT_PARM_P and
+ OMIT_INHERITED_PARMS_P are relevant if it's a cdtor. */
+
static tree
copy_fndecl_with_name (tree fn, tree name, tree_code code,
bool need_vtt_parm_p, bool omit_inherited_parms_p)
static tree
copy_fndecl_with_name (tree fn, tree name, tree_code code,
bool need_vtt_parm_p, bool omit_inherited_parms_p)
- {
- /* "This class type is not an aggregate." */
- CLASSTYPE_NON_AGGREGATE (t) = 1;
- }
+ /* "This class type is not an aggregate." */
+ CLASSTYPE_NON_AGGREGATE (t) = 1;
/* Compute the 'literal type' property before we
do anything with non-static member functions. */
/* Compute the 'literal type' property before we
do anything with non-static member functions. */
indicates the total number of bits used. Therefore,
rli_size_so_far, rather than rli_size_unit_so_far, is
used to compute TYPE_SIZE_UNIT. */
indicates the total number of bits used. Therefore,
rli_size_so_far, rather than rli_size_unit_so_far, is
used to compute TYPE_SIZE_UNIT. */
+
+ /* Set the size and alignment for the new type. */
tree eoc = end_of_class (t, /*include_virtuals_p=*/0);
TYPE_SIZE_UNIT (base_t)
= size_binop (MAX_EXPR,
tree eoc = end_of_class (t, /*include_virtuals_p=*/0);
TYPE_SIZE_UNIT (base_t)
= size_binop (MAX_EXPR,
/* For template template argument of the form `T::template C'.
TYPE_CONTEXT is `T', the template parameter dependent object.
/* For template template argument of the form `T::template C'.
TYPE_CONTEXT is `T', the template parameter dependent object.
- TYPE_NAME is an IDENTIFIER_NODE for `C', the member class template. */
+ TYPE_NAME is a TEMPLATE_DECL, whose DECL_TEMPLATE_PARMS are any
+ template parms of the instantiation. That decl's DECL_NAME is the
+ IDENTIFIER_NODE for `C', the member class template. */
DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0)
/* A using declaration. USING_DECL_SCOPE contains the specified
DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0)
/* A using declaration. USING_DECL_SCOPE contains the specified
-/* Definitions for C++ parsing and type checking.
+/* Definitions for -*- C++ -*- parsing and type checking.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
Copyright (C) 1987-2020 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
CLEANUP_P (in TRY_BLOCK)
AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF, SCOPE_REF)
CLEANUP_P (in TRY_BLOCK)
AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF, SCOPE_REF)
- PAREN_STRING_LITERAL (in STRING_CST)
+ PAREN_STRING_LITERAL_P (in STRING_CST)
CP_DECL_THREAD_LOCAL_P (in VAR_DECL)
KOENIG_LOOKUP_P (in CALL_EXPR)
STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST).
CP_DECL_THREAD_LOCAL_P (in VAR_DECL)
KOENIG_LOOKUP_P (in CALL_EXPR)
STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST).
CALL_EXPR_REVERSE_ARGS (in CALL_EXPR, AGGR_INIT_EXPR)
CONSTRUCTOR_PLACEHOLDER_BOUNDARY (in CONSTRUCTOR)
6: TYPE_MARKED_P (in _TYPE)
CALL_EXPR_REVERSE_ARGS (in CALL_EXPR, AGGR_INIT_EXPR)
CONSTRUCTOR_PLACEHOLDER_BOUNDARY (in CONSTRUCTOR)
6: TYPE_MARKED_P (in _TYPE)
- DECL_NON_TRIVIALLY_INITIALIZED_P (in VAR_DECL)
+ DECL_NONTRIVIALLY_INITIALIZED_P (in VAR_DECL)
RANGE_FOR_IVDEP (in RANGE_FOR_STMT)
CALL_EXPR_OPERATOR_SYNTAX (in CALL_EXPR, AGGR_INIT_EXPR)
CONSTRUCTOR_IS_DESIGNATED_INIT (in CONSTRUCTOR)
RANGE_FOR_IVDEP (in RANGE_FOR_STMT)
CALL_EXPR_OPERATOR_SYNTAX (in CALL_EXPR, AGGR_INIT_EXPR)
CONSTRUCTOR_IS_DESIGNATED_INIT (in CONSTRUCTOR)
DECL_VLA_CAPTURE_P (in FIELD_DECL)
DECL_ARRAY_PARAMETER_P (in PARM_DECL)
LABEL_DECL_CONTINUE (in LABEL_DECL)
DECL_VLA_CAPTURE_P (in FIELD_DECL)
DECL_ARRAY_PARAMETER_P (in PARM_DECL)
LABEL_DECL_CONTINUE (in LABEL_DECL)
- 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
+ 2: DECL_THIS_EXTERN (in VAR_DECL, FUNCTION_DECL or PARM_DECL)
DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
DECL_CONSTRAINT_VAR_P (in a PARM_DECL)
TEMPLATE_DECL_COMPLEX_ALIAS_P (in TEMPLATE_DECL)
DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
DECL_CONSTRAINT_VAR_P (in a PARM_DECL)
TEMPLATE_DECL_COMPLEX_ALIAS_P (in TEMPLATE_DECL)
DECL_SELF_REFERENCE_P (in a TYPE_DECL)
DECL_INVALID_OVERRIDER_P (in a FUNCTION_DECL)
5: DECL_INTERFACE_KNOWN.
DECL_SELF_REFERENCE_P (in a TYPE_DECL)
DECL_INVALID_OVERRIDER_P (in a FUNCTION_DECL)
5: DECL_INTERFACE_KNOWN.
- 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
+ 6: DECL_THIS_STATIC (in VAR_DECL, FUNCTION_DECL or PARM_DECL)
DECL_FIELD_IS_BASE (in FIELD_DECL)
TYPE_DECL_ALIAS_P (in TYPE_DECL)
7: DECL_THUNK_P (in a member FUNCTION_DECL)
DECL_FIELD_IS_BASE (in FIELD_DECL)
TYPE_DECL_ALIAS_P (in TYPE_DECL)
7: DECL_THUNK_P (in a member FUNCTION_DECL)
/* Iterator for a 1 dimensional overload. Permits iterating over the
outer level of a 2-d overload when explicitly enabled. */
/* Iterator for a 1 dimensional overload. Permits iterating over the
outer level of a 2-d overload when explicitly enabled. */
tree ovl;
const bool allow_inner; /* Only used when checking. */
tree ovl;
const bool allow_inner; /* Only used when checking. */
/* Iterator over a (potentially) 2 dimensional overload, which is
produced by name lookup. */
/* Iterator over a (potentially) 2 dimensional overload, which is
produced by name lookup. */
-class lkp_iterator : public ovl_iterator
-{
+class lkp_iterator : public ovl_iterator {
typedef ovl_iterator parent;
tree outer;
typedef ovl_iterator parent;
tree outer;
/* hash traits for declarations. Hashes potential overload sets via
DECL_NAME. */
/* hash traits for declarations. Hashes potential overload sets via
DECL_NAME. */
-struct named_decl_hash : ggc_remove <tree>
-{
+struct named_decl_hash : ggc_remove <tree> {
typedef tree value_type; /* A DECL or OVERLOAD */
typedef tree compare_type; /* An identifier. */
typedef tree value_type; /* A DECL or OVERLOAD */
typedef tree compare_type; /* An identifier. */
(IDENTIFIER_NODE_CHECK(NODE)->base.protected_flag)
/* Based off of TYPE_UNNAMED_P. */
(IDENTIFIER_NODE_CHECK(NODE)->base.protected_flag)
/* Based off of TYPE_UNNAMED_P. */
-#define LAMBDA_TYPE_P(NODE) \
- (TREE_CODE (NODE) == RECORD_TYPE \
+#define LAMBDA_TYPE_P(NODE) \
+ (TREE_CODE (NODE) == RECORD_TYPE \
&& TYPE_LINKAGE_IDENTIFIER (NODE) \
&& IDENTIFIER_LAMBDA_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
&& TYPE_LINKAGE_IDENTIFIER (NODE) \
&& IDENTIFIER_LAMBDA_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
/* DECL_LANG_SPECIFIC for the above codes. */
struct GTY(()) lang_decl_min {
/* DECL_LANG_SPECIFIC for the above codes. */
struct GTY(()) lang_decl_min {
- struct lang_decl_base base;
+ struct lang_decl_base base; /* 32-bits. */
/* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
THUNK_ALIAS.
/* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
THUNK_ALIAS.
- /* In a non-thunk FUNCTION_DECL or TEMPLATE_DECL, this is
- DECL_CLONED_FUNCTION. */
+ /* In a non-thunk FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */
tree GTY ((tag ("0"))) cloned_function;
/* In a FUNCTION_DECL for which THUNK_P holds this is the
tree GTY ((tag ("0"))) cloned_function;
/* In a FUNCTION_DECL for which THUNK_P holds this is the
/* DECL_LANG_SPECIFIC for namespaces. */
struct GTY(()) lang_decl_ns {
/* DECL_LANG_SPECIFIC for namespaces. */
struct GTY(()) lang_decl_ns {
- struct lang_decl_base base;
+ struct lang_decl_base base; /* 32 bits. */
- /* Inline children. These need to be va_gc, because of PCH. */
+ /* Inline children. Needs to be va_gc, because of PCH. */
vec<tree, va_gc> *inlinees;
/* Hash table of bound decls. It'd be nice to have this inline, but
vec<tree, va_gc> *inlinees;
/* Hash table of bound decls. It'd be nice to have this inline, but
/* DECL_LANG_SPECIFIC for parameters. */
struct GTY(()) lang_decl_parm {
/* DECL_LANG_SPECIFIC for parameters. */
struct GTY(()) lang_decl_parm {
- struct lang_decl_base base;
+ struct lang_decl_base base; /* 32 bits. */
an instantiation of a template -- but, from the point of view of
the language, each instantiation of S results in a wholly unrelated
global function f. In this case, DECL_TEMPLATE_INFO for S<int>::f
an instantiation of a template -- but, from the point of view of
the language, each instantiation of S results in a wholly unrelated
global function f. In this case, DECL_TEMPLATE_INFO for S<int>::f
- will be non-NULL, but DECL_USE_TEMPLATE will be zero. */
+ will be non-NULL, but DECL_USE_TEMPLATE will be zero.
+
+ In a friend declaration, TI_TEMPLATE can be an overload set, or
+ identifier. */
#define DECL_TEMPLATE_INFO(NODE) \
(DECL_LANG_SPECIFIC (TEMPLATE_INFO_DECL_CHECK (NODE)) \
->u.min.template_info)
#define DECL_TEMPLATE_INFO(NODE) \
(DECL_LANG_SPECIFIC (TEMPLATE_INFO_DECL_CHECK (NODE)) \
->u.min.template_info)
template parameters at each level. Each element in the vector is a
TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
non-type parameter), or a TYPE_DECL (if the parameter is a type
template parameters at each level. Each element in the vector is a
TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
non-type parameter), or a TYPE_DECL (if the parameter is a type
+ parameter) or a TEMPLATE_DECL (if the parameter is a template
parameter). The TREE_PURPOSE is the default value, if any. The
TEMPLATE_PARM_INDEX for the parameter is available as the
DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
parameter). The TREE_PURPOSE is the default value, if any. The
TEMPLATE_PARM_INDEX for the parameter is available as the
DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
function, two inside the body of a function in a local class, etc.) */
extern int function_depth;
function, two inside the body of a function in a local class, etc.) */
extern int function_depth;
-/* Nonzero if we are inside eq_specializations, which affects comparison of
- PARM_DECLs in cp_tree_equal. */
+/* Nonzero if we are inside eq_specializations, which affects
+ comparison of PARM_DECLs in cp_tree_equal and alias specializations
+ in structrual_comptypes. */
extern int comparing_specializations;
/* In parser.c. */
extern int comparing_specializations;
/* In parser.c. */
extern void init_reswords (void);
/* Various flags for the overloaded operator information. */
extern void init_reswords (void);
/* Various flags for the overloaded operator information. */
-enum ovl_op_flags
- {
- OVL_OP_FLAG_NONE = 0, /* Don't care. */
- OVL_OP_FLAG_UNARY = 1, /* Is unary. */
- OVL_OP_FLAG_BINARY = 2, /* Is binary. */
- OVL_OP_FLAG_AMBIARY = 3, /* May be unary or binary. */
- OVL_OP_FLAG_ALLOC = 4, /* operator new or delete. */
- OVL_OP_FLAG_DELETE = 1, /* operator delete. */
- OVL_OP_FLAG_VEC = 2 /* vector new or delete. */
- };
+enum ovl_op_flags {
+ OVL_OP_FLAG_NONE = 0, /* Don't care. */
+ OVL_OP_FLAG_UNARY = 1, /* Is unary. */
+ OVL_OP_FLAG_BINARY = 2, /* Is binary. */
+ OVL_OP_FLAG_AMBIARY = 3, /* May be unary or binary. */
+ OVL_OP_FLAG_ALLOC = 4, /* operator new or delete. */
+ OVL_OP_FLAG_DELETE = 1, /* operator delete. */
+ OVL_OP_FLAG_VEC = 2 /* vector new or delete. */
+};
/* Compressed operator codes. Order is determined by operators.def
and does not match that of tree_codes. */
/* Compressed operator codes. Order is determined by operators.def
and does not match that of tree_codes. */
-enum ovl_op_code
- {
- OVL_OP_ERROR_MARK,
- OVL_OP_NOP_EXPR,
+enum ovl_op_code {
+ OVL_OP_ERROR_MARK,
+ OVL_OP_NOP_EXPR,
#define DEF_OPERATOR(NAME, CODE, MANGLING, FLAGS) OVL_OP_##CODE,
#define DEF_ASSN_OPERATOR(NAME, CODE, MANGLING) /* NOTHING */
#include "operators.def"
#define DEF_OPERATOR(NAME, CODE, MANGLING, FLAGS) OVL_OP_##CODE,
#define DEF_ASSN_OPERATOR(NAME, CODE, MANGLING) /* NOTHING */
#include "operators.def"
struct GTY(()) ovl_op_info_t {
/* The IDENTIFIER_NODE for the operator. */
struct GTY(()) ovl_op_info_t {
/* The IDENTIFIER_NODE for the operator. */
/* in lex.c */
extern void cxx_dup_lang_specific_decl (tree);
/* in lex.c */
extern void cxx_dup_lang_specific_decl (tree);
-extern void yyungetc (int, int);
-
extern tree unqualified_name_lookup_error (tree,
location_t = UNKNOWN_LOCATION);
extern tree unqualified_fn_lookup_error (cp_expr);
extern tree unqualified_name_lookup_error (tree,
location_t = UNKNOWN_LOCATION);
extern tree unqualified_fn_lookup_error (cp_expr);
extern bool decl_tls_wrapper_p (tree);
extern tree mangle_ref_init_variable (tree);
extern tree mangle_template_parm_object (tree);
extern bool decl_tls_wrapper_p (tree);
extern tree mangle_ref_init_variable (tree);
extern tree mangle_template_parm_object (tree);
-extern char * get_mangled_vtable_map_var_name (tree);
+extern char *get_mangled_vtable_map_var_name (tree);
extern bool mangle_return_type_p (tree);
extern tree mangle_decomp (tree, vec<tree> &);
extern bool mangle_return_type_p (tree);
extern tree mangle_decomp (tree, vec<tree> &);
extern bool morph_fn_to_coro (tree, tree *, tree *);
/* Inline bodies. */
extern bool morph_fn_to_coro (tree, tree *, tree *);
/* Inline bodies. */
inline tree
ovl_first (tree node)
{
inline tree
ovl_first (tree node)
{
tree reqs2 = get_trailing_function_requirements (oldfn);
if ((reqs1 != NULL_TREE) != (reqs2 != NULL_TREE))
return false;
tree reqs2 = get_trailing_function_requirements (oldfn);
if ((reqs1 != NULL_TREE) != (reqs2 != NULL_TREE))
return false;
+
+ /* Substitution is needed when friends are involved. */
reqs1 = maybe_substitute_reqs_for (reqs1, newfn);
reqs2 = maybe_substitute_reqs_for (reqs2, oldfn);
reqs1 = maybe_substitute_reqs_for (reqs1, newfn);
reqs2 = maybe_substitute_reqs_for (reqs2, oldfn);
return cp_tree_equal (reqs1, reqs2);
}
return cp_tree_equal (reqs1, reqs2);
}
/* Merge parameter attributes. */
tree oldarg, newarg;
/* Merge parameter attributes. */
tree oldarg, newarg;
- for (oldarg = DECL_ARGUMENTS(olddecl), newarg = DECL_ARGUMENTS(newdecl);
+ for (oldarg = DECL_ARGUMENTS(olddecl), newarg = DECL_ARGUMENTS(newdecl);
oldarg && newarg;
oldarg = DECL_CHAIN(oldarg), newarg = DECL_CHAIN(newarg))
{
oldarg && newarg;
oldarg = DECL_CHAIN(oldarg), newarg = DECL_CHAIN(newarg))
{
TREE_USED (newdecl) = 1;
else if (TREE_USED (newdecl))
TREE_USED (olddecl) = 1;
TREE_USED (newdecl) = 1;
else if (TREE_USED (newdecl))
TREE_USED (olddecl) = 1;
if (VAR_P (newdecl))
{
if (DECL_READ_P (olddecl))
if (VAR_P (newdecl))
{
if (DECL_READ_P (olddecl))
else if (DECL_READ_P (newdecl))
DECL_READ_P (olddecl) = 1;
}
else if (DECL_READ_P (newdecl))
DECL_READ_P (olddecl) = 1;
}
if (DECL_PRESERVE_P (olddecl))
DECL_PRESERVE_P (newdecl) = 1;
else if (DECL_PRESERVE_P (newdecl))
if (DECL_PRESERVE_P (olddecl))
DECL_PRESERVE_P (newdecl) = 1;
else if (DECL_PRESERVE_P (newdecl))
-/* Install DECL as a builtin function at current (global) scope.
- Return the new decl (if we found an existing version). Also
- installs it into ::std, if it's not '_*'. */
+/* Install DECL as a builtin function at current global scope. Return
+ the new decl (if we found an existing version). Also installs it
+ into ::std, if it's not '_*'. */
tree
cxx_builtin_function (tree decl)
tree
cxx_builtin_function (tree decl)
in-class defaulted functions, but that breaks grokfndecl.
So set it here. */
funcdef_flag = true;
in-class defaulted functions, but that breaks grokfndecl.
So set it here. */
funcdef_flag = true;
if (template_class_depth (current_class_type) == 0)
{
decl = check_explicit_specialization
if (template_class_depth (current_class_type) == 0)
{
decl = check_explicit_specialization
emitted; they may be referred to from other object files. */
if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_REALLY_EXTERN (decl))
return true;
emitted; they may be referred to from other object files. */
if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_REALLY_EXTERN (decl))
return true;
/* Functions marked "dllexport" must be emitted so that they are
visible to other DLLs. */
if (flag_keep_inline_dllexport
/* Functions marked "dllexport" must be emitted so that they are
visible to other DLLs. */
if (flag_keep_inline_dllexport
determine_visibility_from_class (decl, class_type);
if (decl_anon_ns_mem_p (decl))
determine_visibility_from_class (decl, class_type);
if (decl_anon_ns_mem_p (decl))
- /* Names in an anonymous namespace get internal linkage.
- This might change once we implement export. */
+ /* Names in an anonymous namespace get internal linkage. */
constrain_visibility (decl, VISIBILITY_ANON, false);
else if (TREE_CODE (decl) != TYPE_DECL)
{
constrain_visibility (decl, VISIBILITY_ANON, false);
else if (TREE_CODE (decl) != TYPE_DECL)
{
&& TREE_NO_WARNING (decl))))
/* In C++11 it's ok if the decl is defined. */
return;
&& TREE_NO_WARNING (decl))))
/* In C++11 it's ok if the decl is defined. */
return;
tree t = no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false);
if (t == NULL_TREE)
/* The type that got us on no_linkage_decls must have gotten a name for
linkage purposes. */;
else if (CLASS_TYPE_P (t) && TYPE_BEING_DEFINED (t))
tree t = no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false);
if (t == NULL_TREE)
/* The type that got us on no_linkage_decls must have gotten a name for
linkage purposes. */;
else if (CLASS_TYPE_P (t) && TYPE_BEING_DEFINED (t))
+ // FIXME: This is now invalid, as a DR to c++98
/* The type might end up having a typedef name for linkage purposes. */
vec_safe_push (no_linkage_decls, decl);
else if (TYPE_UNNAMED_P (t))
/* The type might end up having a typedef name for linkage purposes. */
vec_safe_push (no_linkage_decls, decl);
else if (TYPE_UNNAMED_P (t))
if (!DECL_BASE_CONSTRUCTOR_P (fn)
|| !CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn)))
return false;
if (!DECL_BASE_CONSTRUCTOR_P (fn)
|| !CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn)))
return false;
if (FUNCTION_FIRST_USER_PARMTYPE (DECL_ORIGIN (fn)) == void_list_node)
/* No user-declared parameters to omit. */
return false;
if (FUNCTION_FIRST_USER_PARMTYPE (DECL_ORIGIN (fn)) == void_list_node)
/* No user-declared parameters to omit. */
return false;
tree binfo = inherited_ctor_binfo (fn);
for (; binfo; binfo = BINFO_INHERITANCE_CHAIN (binfo))
if (BINFO_VIRTUAL_P (binfo))
return true;
tree binfo = inherited_ctor_binfo (fn);
for (; binfo; binfo = BINFO_INHERITANCE_CHAIN (binfo))
if (BINFO_VIRTUAL_P (binfo))
return true;
TREE_CHAIN (decl) = b->names;
b->names = decl;
TREE_CHAIN (decl) = b->names;
b->names = decl;
- /* If appropriate, add decl to separate list of statics. We
- include extern variables because they might turn out to be
- static later. It's OK for this list to contain a few false
- positives. */
+ /* If appropriate, add decl to separate list of statics. We include
+ extern variables because they might turn out to be static later.
+ It's OK for this list to contain a few false positives. */
if (b->kind == sk_namespace
if (b->kind == sk_namespace
- && ((VAR_P (decl)
- && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
+ && ((VAR_P (decl) && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL
&& (!TREE_PUBLIC (decl)
|| decl_anon_ns_mem_p (decl)
|| (TREE_CODE (decl) == FUNCTION_DECL
&& (!TREE_PUBLIC (decl)
|| decl_anon_ns_mem_p (decl)
+ /* Restore to incoming length. */
vec_safe_truncate (queue, length);
return found;
vec_safe_truncate (queue, length);
return found;
no existing MEMBER_VEC and fewer than 8 fields, do nothing. We
know there must be at least 1 field -- the self-reference
TYPE_DECL, except for anon aggregates, which will have at least
no existing MEMBER_VEC and fewer than 8 fields, do nothing. We
know there must be at least 1 field -- the self-reference
TYPE_DECL, except for anon aggregates, which will have at least
void
set_class_bindings (tree klass, unsigned extra)
void
set_class_bindings (tree klass, unsigned extra)
fprintf (stderr, "<nil>\n");
}
fprintf (stderr, "<nil>\n");
}
static void
print_other_binding_stack (cp_binding_level *stack)
{
static void
print_other_binding_stack (cp_binding_level *stack)
{
print_binding_stack (void)
{
cp_binding_level *b;
print_binding_stack (void)
{
cp_binding_level *b;
static bool
has_using_namespace_std_directive_p ()
{
static bool
has_using_namespace_std_directive_p ()
{
- /* Look at local using-directives. */
for (cp_binding_level *level = current_binding_level;
level;
level = level->level_chain)
for (cp_binding_level *level = current_binding_level;
level;
level = level->level_chain)
gcc_checking_assert (DECL_TEMPLATE_RESULT (tmpl) == decl);
gcc_checking_assert (DECL_TEMPLATE_RESULT (tmpl) == decl);
if (new_template_p)
{
/* Push template declarations for global functions and types.
if (new_template_p)
{
/* Push template declarations for global functions and types.
if (!CODE_CONTAINS_STRUCT (TREE_CODE (node), TS_DECL_COMMON)
|| !DECL_LANG_SPECIFIC (node))
return;
if (!CODE_CONTAINS_STRUCT (TREE_CODE (node), TS_DECL_COMMON)
|| !DECL_LANG_SPECIFIC (node))
return;
if (TREE_CODE (node) == FUNCTION_DECL)
{
int flags = TFF_DECL_SPECIFIERS|TFF_RETURN_TYPE
if (TREE_CODE (node) == FUNCTION_DECL)
{
int flags = TFF_DECL_SPECIFIERS|TFF_RETURN_TYPE
print_node (file, "optype", BASELINK_OPTYPE (node), indent + 4);
break;
case OVERLOAD:
print_node (file, "optype", BASELINK_OPTYPE (node), indent + 4);
break;
case OVERLOAD:
- print_node (file, "function", OVL_FUNCTION (node), indent+4);
- print_node (file, "next", OVL_CHAIN (node), indent+4);
+ print_node (file, "function", OVL_FUNCTION (node), indent + 4);
+ print_node (file, "next", OVL_CHAIN (node), indent + 4);
break;
case TEMPLATE_PARM_INDEX:
print_node (file, "decl", TEMPLATE_PARM_DECL (node), indent+4);
break;
case TEMPLATE_PARM_INDEX:
print_node (file, "decl", TEMPLATE_PARM_DECL (node), indent+4);
/* Auxiliary data we hold for each type_info derived object we need. */
struct GTY (()) tinfo_s {
/* Auxiliary data we hold for each type_info derived object we need. */
struct GTY (()) tinfo_s {
- tree type; /* The RECORD_TYPE for this type_info object */
+ tree type; /* The (const-qualified) RECORD_TYPE for this type_info object */
tree vtable; /* The VAR_DECL of the vtable. Only filled at end of
translation. */
tree vtable; /* The VAR_DECL of the vtable. Only filled at end of
translation. */
DECL_IGNORED_P (d) = 1;
TREE_READONLY (d) = 1;
TREE_STATIC (d) = 1;
DECL_IGNORED_P (d) = 1;
TREE_READONLY (d) = 1;
TREE_STATIC (d) = 1;
/* Mark the variable as undefined -- but remember that we can
define it later if we need to do so. */
DECL_EXTERNAL (d) = 1;
/* Mark the variable as undefined -- but remember that we can
define it later if we need to do so. */
DECL_EXTERNAL (d) = 1;
-/* NODE is an OVL_HIDDEN_P node which is now revealed. */
+/* NODE is an OVL_HIDDEN_P node that is now revealed. */
tree
ovl_iterator::reveal_node (tree overload, tree node)
tree
ovl_iterator::reveal_node (tree overload, tree node)
case METHOD_TYPE:
case FUNCTION_TYPE:
case METHOD_TYPE:
case FUNCTION_TYPE:
+ /* Exception specs and memfn_rquals were checked above. */
if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
return false;
if (!compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2)))
if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
return false;
if (!compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2)))