--- gcc/cp/cp-tree.h 2018/04/24 18:20:22 1.1.1.1 +++ gcc/cp/cp-tree.h 2018/04/24 18:27:21 1.1.1.2 @@ -1,5 +1,5 @@ /* Definitions for C++ parsing and type checking. - Copyright (C) 1987, 1993 Free Software Foundation, Inc. + Copyright (C) 1987, 1993, 1994, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GNU CC. @@ -16,7 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #ifndef _CP_TREE_H #define _CP_TREE_H @@ -114,6 +115,14 @@ extern int pedantic; /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type) + +/* Record in each node resulting from a binary operator + what operator was specified for it. */ +#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp)) + +/* Store a value in that field. */ +#define C_SET_EXP_ORIGINAL_CODE(exp, code) \ + (TREE_COMPLEXITY (exp) = (int)(code)) /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the next exception handler. */ @@ -271,7 +280,8 @@ extern int interface_only, interface_unk extern int flag_elide_constructors; -/* Nonzero means handle things in ANSI, instead of GNU fashion. */ +/* Nonzero means enable obscure ANSI features and disable GNU extensions + that might cause ANSI-compliant code to be miscompiled. */ extern int flag_ansi; @@ -369,9 +379,6 @@ enum languages { lang_c, lang_cplusplus #define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 1, (tree *)0) >= 0) #define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) != -1) -enum conversion_type { ptr_conv, constptr_conv, int_conv, - real_conv, last_conversion_type }; - /* Statistics show that while the GNU C++ compiler may generate thousands of different types during a compilation run, it generates relatively few (tens) of classtypes. Because of this, @@ -408,7 +415,7 @@ struct lang_type unsigned interface_only : 1; unsigned interface_unknown : 1; unsigned needs_virtual_reinit : 1; - unsigned declared_exception : 1; + unsigned vec_delete_takes_size : 1; unsigned declared_class : 1; unsigned being_defined : 1; unsigned redefined : 1; @@ -442,8 +449,8 @@ struct lang_type unsigned has_const_init_ref : 1; unsigned has_complex_init_ref : 1; unsigned has_complex_assign_ref : 1; - unsigned vec_delete_takes_size : 1; unsigned has_abstract_assign_ref : 1; + unsigned non_aggregate : 1; /* The MIPS compiler gets it wrong if this struct also does not fill out to a multiple of 4 bytes. Add a @@ -488,14 +495,11 @@ struct lang_type union tree_node *as_list; union tree_node *id_as_list; union tree_node *binfo_as_list; - union tree_node *vtbl_ptr; - union tree_node *instance_variable; union tree_node *friend_classes; char *mi_matrix; - union tree_node *conversions[last_conversion_type]; - union tree_node *dossier; + union tree_node *rtti; union tree_node *methods; @@ -629,8 +633,8 @@ struct lang_type signature reference type. */ #define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to) -/* The is the VAR_DECL that contains NODE's dossier. */ -#define CLASSTYPE_DOSSIER(NODE) (TYPE_LANG_SPECIFIC(NODE)->dossier) +/* The is the VAR_DECL that contains NODE's rtti. */ +#define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti) /* List of all explicit methods (chained using DECL_NEXT_METHOD), in order they were parsed. */ @@ -658,6 +662,14 @@ struct lang_type /* List of lists of member functions defined in this class. */ #define CLASSTYPE_METHOD_VEC(NODE) TYPE_METHODS(NODE) +/* The first type conversion operator in the class (the others can be + searched with TREE_CHAIN), or the first non-constructor function if + there are no type conversion operators. */ +#define CLASSTYPE_FIRST_CONVERSION(NODE) \ + TREE_VEC_LENGTH (CLASSTYPE_METHOD_VEC (NODE)) > 1 \ + ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 1) \ + : NULL_TREE; + /* Pointer from any member function to the head of the list of member functions of the type that member function belongs to. */ #define CLASSTYPE_BASELINK_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->baselink_vec) @@ -795,12 +807,6 @@ struct lang_type /* Same, but cache a list whose value is the binfo of this type. */ #define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list) -/* Slot in which to cache a copy of the local vtable pointer. */ -#define CLASSTYPE_VTBL_PTR(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtbl_ptr) - -/* Hold the instance object associated with this method. */ -#define CLASSTYPE_INST_VAR(NODE) (TYPE_LANG_SPECIFIC(NODE)->instance_variable) - /* A list of class types with which this type is a friend. */ #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes) @@ -808,16 +814,8 @@ struct lang_type a type is derived from another or not. */ #define CLASSTYPE_MI_MATRIX(NODE) (TYPE_LANG_SPECIFIC(NODE)->mi_matrix) -/* If there is exactly one conversion to a non-void, non-const pointer type, - remember that here. If there are more than one, put - `error_mark_node' here. If there are none, this holds NULL_TREE. */ -#define CLASSTYPE_CONVERSION(NODE,KIND) \ - (TYPE_LANG_SPECIFIC(NODE)->conversions[(int) KIND]) - /* Say whether this node was declared as a "class" or a "struct". */ #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class) -/* Say whether this node was declared as a "class" or a "struct". */ -#define CLASSTYPE_DECLARED_EXCEPTION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_exception) /* whether this can be globalized. */ #define CLASSTYPE_NO_GLOBALIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.no_globalize) @@ -840,6 +838,9 @@ struct lang_type /* Nonzero if a _DECL node requires us to output debug info for this class. */ #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested) + +#define TYPE_INCOMPLETE(NODE) \ + (TYPE_SIZE (NODE) == NULL_TREE && TREE_CODE (NODE) != TEMPLATE_TYPE_PARM) /* Additional macros for inheritance information. */ @@ -921,6 +922,9 @@ struct lang_type /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that this type can raise. */ #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE) + +/* The binding level associated with the namespace. */ +#define NAMESPACE_LEVEL(NODE) ((NODE)->decl.arguments) struct lang_decl_flags { @@ -947,7 +951,11 @@ struct lang_decl_flags unsigned saved_inline : 1; unsigned use_template : 2; - unsigned dummy : 8; + unsigned c_static : 1; + unsigned nonconverting : 1; + unsigned declared_inline : 1; + unsigned not_really_extern : 1; + unsigned dummy : 4; tree access; tree context; @@ -1032,6 +1040,10 @@ struct lang_decl is mutable. */ #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag) +/* Nonzero for _DECL means that this constructor is a non-converting + constructor. */ +#define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting) + /* Nonzero for FUNCTION_DECL means that this member function exists as part of an abstract class's interface. */ #define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual) @@ -1043,6 +1055,9 @@ struct lang_decl class where a virtual function instance is actually defined, and the lexical scope of a friend function defined in a class body. */ #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context) +#define DECL_REAL_CONTEXT(NODE) \ + ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \ + ? DECL_CLASS_CONTEXT (NODE) : DECL_CONTEXT (NODE)) /* For a FUNCTION_DECL: the chain through which the next method in the method chain is found. We now use TREE_CHAIN to @@ -1056,6 +1071,10 @@ struct lang_decl /* Next method in CLASSTYPE_METHODS list. */ #define DECL_NEXT_METHOD(NODE) (DECL_LANG_SPECIFIC(NODE)->next_method) +/* In a VAR_DECL for a variable declared in a for statement, + this is the shadowed variable. */ +#define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(NODE) + /* Points back to the decl which caused this lang_decl to be allocated. */ #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant) @@ -1117,7 +1136,7 @@ struct lang_decl #if 0 /* Same, but tells if this field is private in current context. */ -#define DECL_PRIVATE(NODE) (DECL_LANG_FLAG_5 (NODE)) +#define DECL_PRIVATE(NODE) (FOO) /* Same, but tells if this field is private in current context. */ #define DECL_PROTECTED(NODE) (DECL_LANG_FLAG_6 (NODE)) @@ -1125,9 +1144,18 @@ struct lang_decl #define DECL_PUBLIC(NODE) (DECL_LANG_FLAG_7 (NODE)) #endif +extern int flag_new_for_scope; + +/* This flag is true of a local VAR_DECL if it was declared in a for + statement, but we are no longer in the scope of the for. */ +#define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (NODE) + +/* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL + if we already emitted a warning about using it. */ +#define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (NODE) + /* This _DECL represents a compiler-generated entity. */ -#define DECL_ARTIFICIAL(NODE) (DECL_SOURCE_LINE (NODE) == 0) -#define SET_DECL_ARTIFICIAL(NODE) (DECL_SOURCE_LINE (NODE) = 0) +#define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1) /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp)) @@ -1194,6 +1222,13 @@ struct lang_decl #define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_LANG_FLAG_3(NODE)) #endif +/* Nonzero means that an object of this type can not be initialized using + an initializer list. */ +#define CLASSTYPE_NON_AGGREGATE(NODE) \ + (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate) +#define TYPE_NON_AGGREGATE_CLASS(NODE) \ + (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE)) + /* Nonzero if there is a user-defined X::op=(x&) for this class. */ #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref) #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref) @@ -1205,6 +1240,16 @@ struct lang_decl of ARRAY_TYPE is the type of the elements needs a destructor. */ #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE)) +/* Nonzero for class type means that initialization of this type can use + a bitwise copy. */ +#define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \ + (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE)) + +/* Nonzero for class type means that assignment of this type can use + a bitwise copy. */ +#define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \ + (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE)) + /* Nonzero for _TYPE node means that this type is a pointer to member function type. */ #define TYPE_PTRMEMFUNC_P(NODE) (TREE_CODE(NODE) == RECORD_TYPE && TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag) @@ -1221,10 +1266,14 @@ struct lang_decl #define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, 0, 0), delta2_identifier, 0, 0)) #define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, 0, 0), pfn_identifier, 0, 0)) -/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `external' was +/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was specified in its declaration. */ #define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE)) +/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was + specified in its declaration. */ +#define DECL_THIS_STATIC(NODE) (DECL_LANG_FLAG_6(NODE)) + /* Nonzero for SAVE_EXPR if used to initialize a PARM_DECL. */ #define PARM_DECL_EXPR(NODE) (TREE_LANG_FLAG_2(NODE)) @@ -1322,6 +1371,30 @@ struct lang_decl #define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE(NODE) = 3) +/* We know what we're doing with this decl now. */ +#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE) + +/* This decl was declared or deduced to have internal linkage. This is + only meaningful if TREE_PUBLIC is set. */ +#define DECL_C_STATIC(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.c_static) + +/* This function was declared inline. This flag controls the linkage + semantics of 'inline'; whether or not the function is inlined is + controlled by DECL_INLINE. */ +#define DECL_THIS_INLINE(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline) + +/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted, + so that assemble_external will work properly. So we have this flag to + tell us whether the decl is really not external. */ +#define DECL_NOT_REALLY_EXTERN(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern) + +#define DECL_PUBLIC(NODE) \ + (TREE_CODE (NODE) == FUNCTION_DECL \ + ? ! DECL_C_STATIC (NODE) : TREE_PUBLIC (NODE)) + #define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i) /* ...and for unexpanded-parameterized-type nodes. */ @@ -1330,7 +1403,7 @@ struct lang_decl /* An enumeration of the kind of tags that C++ accepts. */ enum tag_types { record_type, class_type, union_type, enum_type, - exception_type, signature_type }; + signature_type }; /* Zero means prototype weakly, as in ANSI C (no args means nothing). Each language context defines how this variable should be set. */ @@ -1352,7 +1425,7 @@ extern int warn_overloaded_virtual; /* in c-common.c */ extern void declare_function_name PROTO((void)); -extern void decl_attributes PROTO((tree, tree)); +extern void decl_attributes PROTO((tree, tree, tree)); extern void init_function_format_info PROTO((void)); extern void record_function_format PROTO((tree, tree, int, int, int)); extern void check_function_format PROTO((tree, tree, tree)); @@ -1387,8 +1460,14 @@ extern tree void_zero_node; extern tree default_function_type; extern tree vtable_entry_type; extern tree sigtable_entry_type; -extern tree __t_desc_type_node, __i_desc_type_node, __m_desc_type_node; -extern tree Type_info_type_node; +extern tree __t_desc_type_node; +extern tree __tp_desc_type_node; +extern tree __access_mode_type_node; +extern tree __bltn_desc_type_node, __user_desc_type_node; +extern tree __class_desc_type_node, __attr_desc_type_node; +extern tree __ptr_desc_type_node, __func_desc_type_node; +extern tree __ptmf_desc_type_node, __ptmd_desc_type_node; +extern tree type_info_type_node; extern tree class_star_type_node; extern tree this_identifier; extern tree pfn_identifier; @@ -1396,17 +1475,20 @@ extern tree index_identifier; extern tree delta_identifier; extern tree delta2_identifier; extern tree pfn_or_delta2_identifier; +extern tree tag_identifier; +extern tree vb_off_identifier; +extern tree vt_off_identifier; /* A node that is a list (length 1) of error_mark_nodes. */ extern tree error_mark_list; extern tree ptr_type_node, const_ptr_type_node; extern tree class_type_node, record_type_node, union_type_node, enum_type_node; -extern tree exception_type_node, unknown_type_node; +extern tree unknown_type_node; extern tree opaque_type_node, signature_type_node; /* Node for "pointer to (virtual) function". - This may be distinct from ptr_type_node so gdb can distinuish them. */ + This may be distinct from ptr_type_node so gdb can distinguish them. */ #define vfunc_ptr_type_node \ (flag_vtable_thunks ? vtable_entry_type : ptr_type_node) @@ -1417,12 +1499,7 @@ extern tree delta_type_node; extern tree long_long_integer_type_node, long_long_unsigned_type_node; /* For building calls to `delete'. */ extern tree integer_two_node, integer_three_node; -extern tree bool_type_node, true_node, false_node; - -/* in except.c */ -extern tree current_exception_type; -extern tree current_exception_decl; -extern tree current_exception_object; +extern tree boolean_type_node, boolean_true_node, boolean_false_node; /* in pt.c */ /* PARM_VEC is a vector of template parameters, either IDENTIFIER_NODEs or @@ -1456,8 +1533,6 @@ struct tinst_level struct tinst_level *next; }; -extern struct tinst_level *current_tinst_level; - /* in class.c */ extern tree current_class_name; extern tree current_class_type; @@ -1470,7 +1545,6 @@ extern tree current_lang_name, lang_name extern tree original_function_name; extern tree current_class_name, current_class_type, current_class_decl, C_C_D; -extern tree current_vtable_decl; /* in init.c */ extern tree global_base_init_list; @@ -1610,7 +1684,6 @@ extern int current_function_parms_stored #define SIGNATURE_FIELD_NAME_FORMAT "__s_%s" #define SIGNATURE_OPTR_NAME "__optr" #define SIGNATURE_SPTR_NAME "__sptr" -#define SIGNATURE_VPTR_NAME "__vptr" #define SIGNATURE_POINTER_NAME "__sp_" #define SIGNATURE_POINTER_NAME_FORMAT "__%s%ssp_%s" #define SIGNATURE_REFERENCE_NAME "__sr_" @@ -1619,9 +1692,9 @@ extern int current_function_parms_stored #define SIGTABLE_PTR_TYPE "__sigtbl_ptr_type" #define SIGTABLE_NAME_FORMAT "__st_%s_%s" #define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d" -#define SIGTABLE_CODE_NAME "__code" -#define SIGTABLE_OFFSET_NAME "__offset" -#define SIGTABLE_PFN_NAME "__pfn" +#define SIGTABLE_TAG_NAME "__tag" +#define SIGTABLE_VB_OFF_NAME "__vb_off" +#define SIGTABLE_VT_OFF_NAME "__vt_off" #define EXCEPTION_CLEANUP_NAME "exception cleanup" #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0) @@ -1715,9 +1788,9 @@ extern int flag_int_enum_equivalence; extern int flag_gc; -/* Nonzero means generate 'dossiers' that give run-time type information. */ +/* Nonzero means generate 'rtti' that give run-time type information. */ -extern int flag_dossier; +extern int flag_rtti; /* Nonzero means do emit exported implementations of functions even if they can be inlined. */ @@ -1732,7 +1805,7 @@ extern int flag_external_templates; extern int flag_alt_external_templates; -/* Nonzero means implicit template instantatiations are emitted. */ +/* Nonzero means implicit template instantiations are emitted. */ extern int flag_implicit_templates; @@ -1770,6 +1843,10 @@ extern tree current_class_type; /* _TYPE as well as the space of member functions. LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already in the parameter list. + LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried. + LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are + after. Note, LOOKUP_COMPLAIN is checked and error messages printed + before LOOKUP_SPECULATIVELY is checked. LOOKUP_NO_CONVERSION means that user-defined conversions are not permitted. Built-in conversions are permitted. LOOKUP_DESTRUCTOR means explicit call to destructor. */ @@ -1782,7 +1859,8 @@ extern tree current_class_type; /* _TYPE #define LOOKUP_GLOBAL (16) #define LOOKUP_HAS_IN_CHARGE (32) #define LOOKUP_SPECULATIVELY (64) -/* 128 & 256 are free */ +#define LOOKUP_ONLYCONVERTING (128) +/* 256 is free */ #define LOOKUP_NO_CONVERSION (512) #define LOOKUP_DESTRUCTOR (512) @@ -1791,18 +1869,34 @@ extern tree current_class_type; /* _TYPE CONV_STATIC : Perform the explicit conversions for static_cast. CONV_CONST : Perform the explicit conversions for const_cast. CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast. - CONV_PRIVATE : Perform upcasts to private bases. */ + CONV_PRIVATE : Perform upcasts to private bases. + CONV_NONCONVERTING : Allow non-converting constructors to be used. + CONV_FORCE_TEMP : Require a new temporary when converting to the same + aggregate type. */ #define CONV_IMPLICIT 1 #define CONV_STATIC 2 #define CONV_CONST 4 #define CONV_REINTERPRET 8 #define CONV_PRIVATE 16 -#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC) +#define CONV_NONCONVERTING 32 +#define CONV_FORCE_TEMP 64 +#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP) #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ | CONV_REINTERPRET) #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ - | CONV_REINTERPRET | CONV_PRIVATE) + | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP) + +/* Used by build_expr_type_conversion to indicate which types are + acceptable as arguments to the expression under consideration. */ + +#define WANT_INT 1 /* integer types, including bool */ +#define WANT_FLOAT 2 /* floating point types */ +#define WANT_ENUM 4 /* enumerated types */ +#define WANT_POINTER 8 /* pointer types */ +#define WANT_NULL 16 /* null pointer constant */ + +#define WANT_ARITH (WANT_INT | WANT_FLOAT) /* Anatomy of a DECL_FRIENDLIST (which is a TREE_LIST): purpose = friend name (IDENTIFIER_NODE); @@ -1849,6 +1943,7 @@ extern tree build_overload_call PROTO( extern tree build_overload_call_maybe PROTO((tree, tree, int, struct candidate *)); /* in class.c */ +extern char *dont_allow_type_definitions; extern tree build_vbase_pointer PROTO((tree, tree)); extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int)); extern tree build_vtable_entry PROTO((tree, tree)); @@ -1869,6 +1964,7 @@ extern int root_lang_context_p PROTO(( extern tree instantiate_type PROTO((tree, tree, int)); extern void print_class_statistics PROTO((void)); extern void maybe_push_cache_obstack PROTO((void)); +extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *)); /* in cvt.c */ extern tree convert_to_reference PROTO((tree, tree, int, int, tree)); @@ -1878,14 +1974,16 @@ extern tree convert_pointer_to PROTO(( extern tree convert_pointer_to_real PROTO((tree, tree)); extern tree convert_pointer_to_vbase PROTO((tree, tree)); extern tree convert PROTO((tree, tree)); -extern tree convert_force PROTO((tree, tree)); +extern tree cp_convert PROTO((tree, tree, int, int)); +extern tree convert_force PROTO((tree, tree, int)); extern tree build_type_conversion PROTO((enum tree_code, tree, tree, int)); +extern tree build_expr_type_conversion PROTO((int, tree, int)); extern int build_default_binary_type_conversion PROTO((enum tree_code, tree *, tree *)); -extern int build_default_unary_type_conversion PROTO((enum tree_code, tree *)); extern tree type_promotes_to PROTO((tree)); /* decl.c */ extern int global_bindings_p PROTO((void)); +extern int toplevel_bindings_p PROTO((void)); extern void keep_next_level PROTO((void)); extern int kept_level_p PROTO((void)); extern void declare_parm_level PROTO((void)); @@ -1919,6 +2017,7 @@ extern tree pushdecl_top_level PROTO(( extern void push_class_level_binding PROTO((tree, tree)); extern void push_overloaded_decl_top_level PROTO((tree, int)); extern tree pushdecl_class_level PROTO((tree)); +extern tree pushdecl_nonclass_level PROTO((tree)); extern int overloaded_globals_p PROTO((tree)); extern tree push_overloaded_decl PROTO((tree, int)); extern tree implicitly_declare PROTO((tree)); @@ -1931,6 +2030,7 @@ extern tree gettags PROTO((void)); extern void set_current_level_tags_transparency PROTO((int)); extern tree typedecl_for_tag PROTO((tree)); extern tree lookup_name PROTO((tree, int)); +extern tree lookup_namespace_name PROTO((tree, tree)); extern tree lookup_name_current_level PROTO((tree)); extern void init_decl_processing PROTO((void)); /* skipped define_function */ @@ -1938,22 +2038,24 @@ extern void shadow_tag PROTO((tree)); extern int grok_ctor_properties PROTO((tree, tree)); extern tree groktypename PROTO((tree)); extern tree start_decl PROTO((tree, tree, int, tree)); -extern void finish_decl PROTO((tree, tree, tree, int)); +extern void cp_finish_decl PROTO((tree, tree, tree, int, int)); extern void expand_static_init PROTO((tree, tree)); extern int complete_array_type PROTO((tree, tree, int)); extern tree build_ptrmemfunc_type PROTO((tree)); -extern tree grokdeclarator (); /* PROTO((tree, tree, enum decl_context, int, tree)); */ +/* the grokdeclarator prototype is in decl.h */ extern int parmlist_is_exprlist PROTO((tree)); -extern tree xref_defn_tag PROTO((tree, tree, tree)); extern tree xref_tag PROTO((tree, tree, tree, int)); +extern void xref_basetypes PROTO((tree, tree, tree, tree)); extern tree start_enum PROTO((tree)); extern tree finish_enum PROTO((tree, tree)); extern tree build_enumerator PROTO((tree, tree)); extern tree grok_enum_decls PROTO((tree, tree)); -extern int start_function PROTO((tree, tree, tree, int)); +extern int start_function PROTO((tree, tree, tree, tree, int)); extern void store_parm_decls PROTO((void)); +extern void expand_start_early_try_stmts PROTO((void)); +extern void store_in_parms PROTO((struct rtx_def *)); extern void store_return_init PROTO((tree, tree)); -extern void finish_function PROTO((int, int)); +extern void finish_function PROTO((int, int, int)); extern tree start_method PROTO((tree, tree, tree)); extern tree finish_method PROTO((tree)); extern void hack_incomplete_structures PROTO((tree)); @@ -1971,12 +2073,13 @@ extern void grokclassfn PROTO((tree, extern tree grok_alignof PROTO((tree)); extern tree grok_array_decl PROTO((tree, tree)); extern tree delete_sanity PROTO((tree, tree, int, int)); -extern void check_classfn PROTO((tree, tree, tree)); -extern tree grokfield PROTO((tree, tree, tree, tree, tree)); +extern tree check_classfn PROTO((tree, tree, tree)); +extern tree grokfield PROTO((tree, tree, tree, tree, tree, tree)); extern tree grokbitfield PROTO((tree, tree, tree)); extern tree groktypefield PROTO((tree, tree)); extern tree grokoptypename PROTO((tree, tree)); extern tree build_push_scope PROTO((tree, tree)); +extern void cplus_decl_attributes PROTO((tree, tree, tree)); extern tree constructor_name_full PROTO((tree)); extern tree constructor_name PROTO((tree)); extern void setup_vtbl_ptr PROTO((void)); @@ -1992,7 +2095,7 @@ extern tree coerce_delete_type PROTO(( extern void walk_vtables PROTO((void (*)(), void (*)())); extern void walk_sigtables PROTO((void (*)(), void (*)())); extern void finish_file PROTO((void)); -extern void warn_if_unknown_interface PROTO((void)); +extern void warn_if_unknown_interface PROTO((tree)); extern tree grok_x_components PROTO((tree, tree)); extern tree reparse_absdcl_as_expr PROTO((tree, tree)); extern tree reparse_absdcl_as_casts PROTO((tree, tree)); @@ -2000,13 +2103,19 @@ extern tree reparse_decl_as_expr PROTO( extern tree finish_decl_parsing PROTO((tree)); extern tree lookup_name_nonclass PROTO((tree)); extern tree check_cp_case_value PROTO((tree)); +extern tree do_toplevel_using_decl PROTO((tree)); +extern tree do_class_using_decl PROTO((tree)); +extern tree current_namespace_id PROTO((tree)); +extern tree get_namespace_id PROTO((void)); +extern void check_default_args PROTO((tree)); /* in edsel.c */ /* in except.c */ - +extern tree protect_list; extern void start_protect PROTO((void)); extern void end_protect PROTO((tree)); +extern void end_protect_partials (); extern void expand_exception_blocks PROTO((void)); extern void expand_start_try_stmts PROTO((void)); extern void expand_end_try_stmts PROTO((void)); @@ -2015,15 +2124,20 @@ extern void expand_end_all_catch PROTO( extern void start_catch_block PROTO((tree, tree)); extern void end_catch_block PROTO((void)); extern void expand_throw PROTO((tree)); -extern int build_exception_table PROTO((void)); +extern int might_have_exceptions_p PROTO((void)); +extern void emit_exception_table PROTO((void)); extern tree build_throw PROTO((tree)); extern void init_exception_processing PROTO((void)); +extern void expand_builtin_throw PROTO((void)); +extern void expand_start_eh_spec PROTO((void)); +extern void expand_end_eh_spec PROTO((tree)); /* in expr.c */ /* skip cplus_expand_expr */ extern void init_cplus_expand PROTO((void)); extern void fixup_result_decl PROTO((tree, struct rtx_def *)); extern int decl_in_memory_p PROTO((tree)); +extern tree unsave_expr_now PROTO((tree)); /* in gc.c */ extern int type_needs_gc_entry PROTO((tree)); @@ -2048,14 +2162,14 @@ extern void check_base_init PROTO((tre extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree)); extern void do_member_init PROTO((tree, tree, tree)); extern void expand_member_init PROTO((tree, tree, tree)); -extern void expand_aggr_init PROTO((tree, tree, int)); +extern void expand_aggr_init PROTO((tree, tree, int, int)); extern int is_aggr_typedef PROTO((tree, int)); extern tree get_aggr_from_typedef PROTO((tree, int)); extern tree get_type_value PROTO((tree)); extern tree build_member_call PROTO((tree, tree, tree)); extern tree build_offset_ref PROTO((tree, tree)); extern tree get_member_function PROTO((tree *, tree, tree)); -extern tree get_member_function_from_ptrfunc PROTO((tree *, tree, tree)); +extern tree get_member_function_from_ptrfunc PROTO((tree *, tree)); extern tree resolve_offset_ref PROTO((tree)); extern tree decl_constant_value PROTO((tree)); extern int is_friend_type PROTO((tree, tree)); @@ -2137,6 +2251,7 @@ extern char *code_as_string PROTO((enu extern char *language_as_string PROTO((enum languages, int)); extern char *parm_as_string PROTO((int, int)); extern char *op_as_string PROTO((enum tree_code, int)); +extern char *cv_as_string PROTO((tree, int)); /* in method.c */ extern void init_method PROTO((void)); @@ -2159,6 +2274,7 @@ extern tree hack_identifier PROTO((tre extern tree build_component_type_expr PROTO((tree, tree, tree, int)); /* in pt.c */ +extern tree tsubst PROTO ((tree, tree*, int, tree)); extern void begin_template_parm_list PROTO((void)); extern tree process_template_parm PROTO((tree, tree)); extern tree end_template_parm_list PROTO((tree)); @@ -2218,6 +2334,7 @@ extern void print_search_statistics PRO extern void init_search_processing PROTO((void)); extern void reinit_search_statistics PROTO((void)); extern tree current_scope PROTO((void)); +extern tree lookup_conversions PROTO((tree)); /* in sig.c */ extern tree build_signature_pointer_type PROTO((tree, int, int)); @@ -2226,7 +2343,6 @@ extern tree build_signature_pointer_cons extern tree build_signature_method_call PROTO((tree, tree, tree, tree)); extern tree build_optr_ref PROTO((tree)); extern tree build_sptr_ref PROTO((tree)); -extern tree build_vptr_ref PROTO((tree)); /* in spew.c */ extern void init_spew PROTO((void)); @@ -2255,7 +2371,6 @@ extern tree hash_chainon PROTO((tree, extern tree get_decl_list PROTO((tree)); extern tree list_hash_lookup_or_cons PROTO((tree)); extern tree make_binfo PROTO((tree, tree, tree, tree, tree)); -extern tree copy_binfo PROTO((tree)); extern tree binfo_value PROTO((tree, tree)); extern tree reverse_path PROTO((tree)); extern tree virtual_member PROTO((tree, tree)); @@ -2272,15 +2387,18 @@ extern int promotes_to_aggr_type PROTO( extern int is_aggr_type_2 PROTO((tree, tree)); extern void message_2_types PROTO((void (*)(), char *, tree, tree)); extern char *lang_printable_name PROTO((tree)); -extern tree build_exception_variant PROTO((tree, tree, tree)); +extern tree build_exception_variant PROTO((tree, tree)); extern tree copy_to_permanent PROTO((tree)); extern void print_lang_statistics PROTO((void)); /* skip __eprintf */ extern tree array_type_nelts_total PROTO((tree)); extern tree array_type_nelts_top PROTO((tree)); +extern tree break_out_target_exprs PROTO((tree)); +extern tree build_unsave_expr PROTO((tree)); +extern int cp_expand_decl_cleanup PROTO((tree, tree)); /* in typeck.c */ -extern tree bool_truthvalue_conversion PROTO((tree)); +extern tree condition_conversion PROTO((tree)); extern tree target_type PROTO((tree)); extern tree require_complete_type PROTO((tree)); extern int type_unknown_p PROTO((tree)); @@ -2301,6 +2419,7 @@ extern tree signed_or_unsigned_type PRO extern tree c_sizeof PROTO((tree)); extern tree c_sizeof_nowarn PROTO((tree)); extern tree c_alignof PROTO((tree)); +extern tree decay_conversion PROTO((tree)); extern tree default_conversion PROTO((tree)); extern tree build_object_ref PROTO((tree, tree, tree)); extern tree build_component_ref_1 PROTO((tree, tree, int)); @@ -2329,7 +2448,7 @@ extern tree build_compound_expr PROTO( extern tree build_static_cast PROTO((tree, tree)); extern tree build_reinterpret_cast PROTO((tree, tree)); extern tree build_const_cast PROTO((tree, tree)); -extern tree build_c_cast PROTO((tree, tree)); +extern tree build_c_cast PROTO((tree, tree, int)); extern tree build_modify_expr PROTO((tree, enum tree_code, tree)); extern int language_lvalue_valid PROTO((tree)); extern void warn_for_assignment PROTO((char *, char *, char *, tree, int, int));