OSDN Git Service

* cp-tree.h (TYPE_NOTHROW_P): New macro.
[pf3gnuchains/gcc-fork.git] / gcc / cp / cp-tree.h
index b255933..209d95b 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for C++ parsing and type checking.
-   Copyright (C) 1987, 92-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc.
    Hacked by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -23,27 +23,28 @@ Boston, MA 02111-1307, USA.  */
 #define _CP_TREE_H
 
 /* Usage of TREE_LANG_FLAG_?:
-   0: TREE_NONLOCAL_FLAG (in TREE_LIST or _TYPE).
-      BINFO_MARKED (BINFO nodes).
+   0: BINFO_MARKED (BINFO nodes).
       COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
       NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
       DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
       LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
       TREE_NEGATED_INT (in INTEGER_CST).
+      TREE_INDIRECT_USING (in NAMESPACE_DECL).
       IDENTIFIER_MARKED (used by search routines).
       LOCAL_BINDING_P (in CPLUS_BINDING)
-   1:  IDENTIFIER_VIRTUAL_P.
+   1: IDENTIFIER_VIRTUAL_P.
       TI_PENDING_TEMPLATE_FLAG.
       TEMPLATE_PARMS_FOR_INLINE.
       DELETE_EXPR_USE_VEC (in DELETE_EXPR).
       (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
       TYPE_USES_COMPLEX_INHERITANCE (in _TYPE).
       C_DECLARED_LABEL_FLAG.
+      INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
+      BASELINK_P (in TREE_LIST)
    2: IDENTIFIER_OPNAME_P.
       BINFO_VBASE_MARKED.
       BINFO_FIELDS_MARKED.
       TYPE_VIRTUAL_P.
-      PARM_DECL_EXPR (in SAVE_EXPR).
    3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
       BINFO_VTABLE_PATH_MARKED.
       BINFO_PUSHDECLS_MARKED.
@@ -87,6 +88,9 @@ Boston, MA 02111-1307, USA.  */
      For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME.
      For a TEMPLATE_TEMPLATE_PARM, this is
      TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
+
+   DECL_SAVED_INSNS/DECL_FIELD_SIZE
+     For a static VAR_DECL, this is DECL_INIT_PRIORITY.
 */
 
 /* Language-dependent contents of an identifier.  */
@@ -104,7 +108,7 @@ struct lang_identifier
 struct lang_id2
 {
   tree label_value, implicit_decl;
-  tree type_desc, as_list, error_locus;
+  tree error_locus;
 };
 
 typedef struct 
@@ -134,12 +138,16 @@ typedef struct ptrmem_cst
    or namespace scope.  */
 #define LOCAL_BINDING_P(NODE) TREE_LANG_FLAG_0(NODE)
 
+/* Nonzero if BINDING_VALUE is from a base class of the class which is
+   currently being defined.  */
+#define INHERITED_VALUE_BINDING_P(NODE) TREE_LANG_FLAG_1(NODE)
+
 /* For a binding between a name and an entity at a non-local scope,
    defines the scope where the binding is declared.  (Either a class
    _TYPE node, or a NAMESPACE_DECL.)  This macro should be used only
    for namespace-level bindings; on the IDENTIFIER_BINDING list
    BINDING_LEVEL is used instead.  */
-#define BINDING_SCOPE(NODE) ((tree) ((struct tree_binding*)NODE)->scope)
+#define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope.scope)
 
 /* This is the declaration bound to the name. Possible values:
    variable, overloaded function, namespace, template, enumerator.  */
@@ -160,7 +168,10 @@ typedef struct ptrmem_cst
 struct tree_binding
 {
   char common[sizeof (struct tree_common)];
-  void* scope;
+  union {
+    tree scope;
+    struct binding_level *level;
+  } scope;
   tree value;
 };
 
@@ -183,6 +194,14 @@ struct tree_overload
   tree function;
 };
 
+/* A `baselink' is a TREE_LIST whose TREE_PURPOSE is a BINFO
+   indicating a particular base class, and whose TREE_VALUE is a
+   (possibly overloaded) function from that base class.  */
+#define BASELINK_P(NODE) \
+  (TREE_CODE ((NODE)) == TREE_LIST && TREE_LANG_FLAG_1 ((NODE)))
+#define SET_BASELINK_P(NODE) \
+  (TREE_LANG_FLAG_1 ((NODE)) = 1)
+
 #define WRAPPER_PTR(NODE) (((struct tree_wrapper*)NODE)->u.ptr)
 #define WRAPPER_INT(NODE) (((struct tree_wrapper*)NODE)->u.i)
 
@@ -232,10 +251,10 @@ struct tree_srcloc
    ? BINDING_VALUE (IDENTIFIER_BINDING (NODE)) \
    : NULL_TREE)
 
-/* If we are currently in class scope, then IDENTIFIER_CLASS_VALUE
-   indicates the class-scoped binding of NODE.  This is just a pointer
-   to the BINDING_VALUE of one of the bindings in the
-   IDENTIFIER_BINDINGs list, so any time that this is set so is
+/* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
+   class, and IDENTIFIER_CLASS_VALUE is the value binding.  This is
+   just a pointer to the BINDING_VALUE of one of the bindings in the
+   IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
    IDENTIFIER_BINDING.  */
 #define IDENTIFIER_CLASS_VALUE(NODE) \
   (((struct lang_identifier *) (NODE))->class_value)
@@ -275,14 +294,6 @@ struct tree_srcloc
 #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
        SET_LANG_ID(NODE, VALUE, implicit_decl)
 
-#define IDENTIFIER_AS_DESC(NODE)           LANG_ID_FIELD(type_desc, NODE)
-#define SET_IDENTIFIER_AS_DESC(NODE,DESC)      \
-       SET_LANG_ID(NODE, DESC, type_desc)
-
-#define IDENTIFIER_AS_LIST(NODE)           LANG_ID_FIELD(as_list, NODE)
-#define SET_IDENTIFIER_AS_LIST(NODE,LIST)      \
-       SET_LANG_ID(NODE, LIST, as_list)
-
 #define IDENTIFIER_ERROR_LOCUS(NODE)       LANG_ID_FIELD(error_locus, NODE)
 #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \
        SET_LANG_ID(NODE, VALUE, error_locus)
@@ -293,10 +304,12 @@ struct tree_srcloc
 /* Nonzero if this identifier is the prefix for a mangled C++ operator name.  */
 #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
 
-#define IDENTIFIER_TYPENAME_P(NODE)    \
-  (! strncmp (IDENTIFIER_POINTER (NODE),                       \
-             IDENTIFIER_POINTER (ansi_opname[(int) TYPE_EXPR]),        \
-             IDENTIFIER_LENGTH (ansi_opname[(int) TYPE_EXPR])))
+/* Nonzero if this identifier is the name of a type-conversion
+   operator.  */
+#define IDENTIFIER_TYPENAME_P(NODE)                    \
+  (! strncmp (IDENTIFIER_POINTER (NODE),               \
+              OPERATOR_TYPENAME_FORMAT,                        \
+             strlen (OPERATOR_TYPENAME_FORMAT)))
 
 /* Nonzero means reject anything that ANSI standard C forbids.  */
 extern int pedantic;
@@ -382,10 +395,6 @@ extern int flag_gnu_xref;
 
 extern int flag_gnu_binutils;
 
-/* Nonzero means ignore `#ident' directives.  */
-
-extern int flag_no_ident;
-
 /* Nonzero means warn about implicit declarations.  */
 
 extern int warn_implicit;
@@ -547,7 +556,12 @@ extern int flag_vtable_gc;
 
 /* Nonzero means make the default pedwarns warnings instead of errors.
    The value of this flag is ignored if -pedantic is specified.  */
-int flag_permissive;
+extern int flag_permissive;
+
+/* Nonzero if we want to obey access control semantics.  */
+
+extern int flag_access_control;
+
 \f
 /* C++ language-specific tree codes.  */
 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
@@ -677,12 +691,12 @@ struct lang_type
     {
       unsigned has_type_conversion : 1;
       unsigned has_init_ref : 1;
-      unsigned has_assignment : 1;
       unsigned has_default_ctor : 1;
       unsigned uses_multiple_inheritance : 1;
       unsigned const_needs_init : 1;
       unsigned ref_needs_init : 1;
       unsigned has_const_assign_ref : 1;
+      unsigned anon_union : 1;
 
       unsigned has_nonpublic_ctor : 2;
       unsigned has_nonpublic_assign_ref : 2;
@@ -715,28 +729,29 @@ struct lang_type
       unsigned has_opaque_typedecls : 1;
       unsigned sigtable_has_been_generated : 1;
       unsigned was_anonymous : 1;
-      unsigned has_real_assignment : 1;
       unsigned has_real_assign_ref : 1;
       unsigned has_const_init_ref : 1;
-
       unsigned has_complex_init_ref : 1;
+
       unsigned has_complex_assign_ref : 1;
       unsigned has_abstract_assign_ref : 1;
       unsigned non_aggregate : 1;
+      unsigned is_partial_instantiation : 1;
+      unsigned has_mutable : 1;
+      unsigned com_interface : 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 so, make sure to copy it in instantiate_class_template!  */
 
       /* The MIPS compiler gets it wrong if this struct also
         does not fill out to a multiple of 4 bytes.  Add a
         member `dummy' with new bits if you go over the edge.  */
-      unsigned dummy : 12;
+      unsigned dummy : 10;
     } type_flags;
 
-  int n_ancestors;
-  int n_vancestors;
   int vsize;
-  int max_depth;
   int vfield_parent;
 
-  union tree_node *baselink_vec;
   union tree_node *vfields;
   union tree_node *vbases;
 
@@ -749,11 +764,7 @@ struct lang_type
 
   union tree_node *size;
 
-  union tree_node *base_init_list;
   union tree_node *abstract_virtuals;
-  union tree_node *as_list;
-  union tree_node *id_as_list;
-  union tree_node *binfo_as_list;
   union tree_node *friend_classes;
 
   union tree_node *rtti;
@@ -763,8 +774,8 @@ struct lang_type
   union tree_node *signature;
   union tree_node *signature_pointer_to;
   union tree_node *signature_reference_to;
-
   union tree_node *template_info;
+  tree befriending_classes;
 };
 
 /* Indicates whether or not (and how) a template was expanded for this class.
@@ -780,13 +791,6 @@ struct lang_type
 /* List of friends which were defined inline in this class definition.  */
 #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
 
-/* Nonzero for _CLASSTYPE means that the _CLASSTYPE either has
-   a special meaning for the assignment operator ("operator="),
-   or one of its fields (or base members) has a special meaning
-   defined.  */
-#define TYPE_HAS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assignment)
-#define TYPE_HAS_REAL_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assignment)
-
 /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
    respectively.  */
 #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)
@@ -801,9 +805,6 @@ struct lang_type
   (TYPE_NEEDS_DESTRUCTOR (NODE) \
    || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
 
-/* Nonzero for TREE_LIST or _TYPE node means that this node is class-local.  */
-#define TREE_NONLOCAL_FLAG(NODE) (TREE_LANG_FLAG_0 (NODE))
-
 /* Nonzero means that this _CLASSTYPE node defines ways of converting
    itself to other types.  */
 #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)
@@ -862,7 +863,7 @@ 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 rtti.  */
+/* The is the basetype that contains NODE's rtti.  */
 #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
 
 /* Nonzero means that this _CLASSTYPE node overloads operator().  */
@@ -885,11 +886,11 @@ struct lang_type
 #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
 
 /* Vector member functions defined in this class.  Each element is
-   either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD.  The first
+   either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD.  All
+   functions with the same name end up in the same slot.  The first
    two elements are for constructors, and destructors, respectively.
-   Any user-defined conversion operators follow these.  These are
-   followed by ordinary member functions.  There may be empty entries
-   at the end of the vector.  */
+   These are followed by ordinary member functions.  There may be
+   empty entries at the end of the vector.  */
 #define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods)
 
 /* The first type conversion operator in the class (the others can be
@@ -900,10 +901,6 @@ struct lang_type
     ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
     : 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)
-
 /* Mark bits for depth-first and breath-first searches.  */
 
 /* Get the value of the Nth mark bit.  */
@@ -974,17 +971,6 @@ struct lang_type
 #define CLASSTYPE_N_BASECLASSES(NODE) \
   (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
 
-/* Memoize the number of super classes (base classes) that this node
-   has.  That way we can know immediately (albeit conservatively how
-   large a multiple-inheritance matrix we need to build to find
-   derivation information.  */
-#define CLASSTYPE_N_SUPERCLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_ancestors)
-#define CLASSTYPE_N_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_vancestors)
-
-/* Record how deep the inheritance is for this class so `void*' conversions
-   are less favorable than a conversion to the most base type.  */
-#define CLASSTYPE_MAX_DEPTH(NODE) (TYPE_LANG_SPECIFIC(NODE)->max_depth)
-
 /* Used for keeping search-specific information.  Any search routine
    which uses this must define what exactly this slot is used for.  */
 #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
@@ -994,17 +980,6 @@ struct lang_type
 #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
 #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
 
-/* A cons list of structure elements which either have constructors
-   to be called, or virtual function table pointers which
-   need initializing.  Depending on what is being initialized,
-   the TREE_PURPOSE and TREE_VALUE fields have different meanings:
-
-   Member initialization: <FIELD_DECL, TYPE>
-   Base class construction: <NULL_TREE, BASETYPE>
-   Base class initialization: <BASE_INITIALIZATION, THESE_INITIALIZATIONS>
-   Whole type: <MEMBER_INIT, BASE_INIT>.  */
-#define CLASSTYPE_BASE_INIT_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->base_init_list)
-
 /* A cons list of virtual functions which cannot be inherited by
    derived classes.  When deriving from this type, the derived
    class must provide its own definition for each of these functions.  */
@@ -1034,21 +1009,23 @@ struct lang_type
 /* Ditto, for operator=.  */
 #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_assign_ref)
 
-/* Many routines need to cons up a list of basetypes for access
-   checking.  This field contains a TREE_LIST node whose TREE_VALUE
-   is the main variant of the type, and whose TREE_VIA_PUBLIC
-   and TREE_VIA_VIRTUAL bits are correctly set.  */
-#define CLASSTYPE_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->as_list)
-/* Same, but cache a list whose value is the name of this type.  */
-#define CLASSTYPE_ID_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->id_as_list)
-/* 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)
-
-/* A list of class types with which this type is a friend.  The
+/* Nonzero means that this type contains a mutable member */
+#define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable)
+#define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
+
+/* Nonzero means that this type is meant for communication via COM.  */
+#define CLASSTYPE_COM_INTERFACE(NODE) \
+  (TYPE_LANG_SPECIFIC(NODE)->type_flags.com_interface)
+
+/* A list of class types of which this type is a friend.  The
    TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
    case of a template friend.  */
 #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
 
+/* A list of the classes which grant friendship to this class.  */
+#define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \
+  (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
+
 /* 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)
 
@@ -1078,11 +1055,16 @@ struct lang_type
    gcc/tree.h.  In particular if D is derived from B then the BINFO
    for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
    D.  In tree.h, this pointer is described as pointing in other
-   direction.  
+   direction.  There is a different BINFO for each path to a virtual
+   base; BINFOs for virtual bases are not shared.  In addition, shared
+   versions of each of the virtual class BINFOs are stored in
+   CLASSTYPE_VBASECLASSES.
 
-   After a call to get_vbase_types, the vbases are chained together in
-   depth-first order via TREE_CHAIN.  Other than that, TREE_CHAIN is
-   unused.  */
+   We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private
+   inheritance is indicated by the absence of the other two flags, not
+   by TREE_VIAR_PRIVATE, which is unused.
+
+   The TREE_CHAIN is for scratch space in search.c.  */
 
 /* Nonzero means marked by DFS or BFS search, including searches
    by `get_binfo' and `get_base_distance'.  */
@@ -1148,9 +1130,23 @@ struct lang_type
    equivalently, no throw specification.  */
 #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
 
+/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'.  */
+#define TYPE_NOTHROW_P(NODE) \
+  (TYPE_RAISES_EXCEPTIONS (NODE) \
+   && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE)
+
 /* The binding level associated with the namespace.  */
 #define NAMESPACE_LEVEL(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.level)
 \f
+
+/* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
+   a lang_decl (which has lang_decl_flags as its initial prefix).  A
+   FUNCTION_DECL, NAMESPACE_DECL, TYPE_DECL, or USING_DECL may have a
+   full lang_decl.  A FIELD_DECL, or a static data member VAR_DECL,
+   will have only lang_decl_flags.  Thus, one should only access the
+   members of lang_decl that are not in lang_decl_flags for DECLs that
+   are not FIELD_DECLs or VAR_DECLs.  */
+
 struct lang_decl_flags
 {
 #ifdef ONLY_INT_FIELDS
@@ -1161,8 +1157,6 @@ struct lang_decl_flags
 
   unsigned operator_attr : 1;
   unsigned constructor_attr : 1;
-  unsigned returns_first_arg : 1;
-  unsigned preserves_first_arg : 1;
   unsigned friend_attr : 1;
   unsigned static_function : 1;
   unsigned const_memfunc : 1;
@@ -1183,7 +1177,7 @@ struct lang_decl_flags
   unsigned needs_final_overrider : 1;
   unsigned bitfield : 1;
   unsigned defined_in_class : 1;
-  unsigned dummy : 1;
+  unsigned dummy : 3;
 
   tree access;
   tree context;
@@ -1197,6 +1191,7 @@ struct lang_decl
   struct lang_decl_flags decl_flags;
 
   tree main_decl_variant;
+  tree befriending_classes;
   struct pending_inline *pending_inline_info;
 };
 
@@ -1232,20 +1227,20 @@ struct lang_decl
    for an object with virtual baseclasses.  */
 #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
 
+/* Non-zero for a FUNCTION_DECL that declares a type-info function.  */
+#define DECL_TINFO_FN_P(NODE)                                  \
+  (TREE_CODE (NODE) == FUNCTION_DECL                           \
+   && DECL_ARTIFICIAL (NODE)                                   \
+   && DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
+
+/* Mark NODE as a type-info function.  */
+#define SET_DECL_TINFO_FN_P(NODE) \
+  (DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1)
+
 /* For FUNCTION_DECLs: nonzero means that this function is a default
    implementation of a signature method.  */
 #define IS_DEFAULT_IMPLEMENTATION(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.is_default_implementation)
 
-/* For FUNCTION_DECLs: nonzero means that the constructor
-   is known to return a non-zero `this' unchanged.  */
-#define DECL_RETURNS_FIRST_ARG(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.returns_first_arg)
-
-/* Nonzero for FUNCTION_DECL means that this constructor is known to
-   not make any assignment to `this', and therefore can be trusted
-   to return it unchanged.  Otherwise, we must re-assign `current_class_ptr'
-   after performing base initializations.  */
-#define DECL_PRESERVES_THIS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.preserves_first_arg)
-
 /* Nonzero for _DECL means that this decl appears in (or will appear
    in) as a member in a RECORD_TYPE or UNION_TYPE node.  It is also for
    detecting circularity in case members are multiply defined.  In the
@@ -1263,6 +1258,10 @@ struct lang_decl
    member functions for this class.  */
 #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)
 
+/* A TREE_LIST of the types which have befriended this FUNCTION_DECL.  */
+#define DECL_BEFRIENDING_CLASSES(NODE) \
+  (DECL_LANG_SPECIFIC(NODE)->befriending_classes)
+
 /* Nonzero for FUNCTION_DECL means that this decl is a static
    member function.  */
 #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)
@@ -1291,6 +1290,12 @@ struct lang_decl
    has `this' as volatile X *const.  */
 #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)
 
+/* Nonzero for a DECL means that this member is a non-static member.  */
+#define DECL_NONSTATIC_MEMBER_P(NODE)          \
+  ((TREE_CODE (NODE) == FUNCTION_DECL          \
+    && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE))        \
+   || TREE_CODE (NODE) == FIELD_DECL)
+
 /* Nonzero for _DECL means that this member object type
    is mutable.  */
 #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
@@ -1353,6 +1358,11 @@ struct lang_decl
 #define ORIGINAL_NAMESPACE(NODE)  \
   (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
 
+/* In a non-local VAR_DECL with static storage duration, this is the
+   initialization priority.  If this value is zero, the NODE will be
+   initialized at the DEFAULT_INIT_PRIORITY.  */
+#define DECL_INIT_PRIORITY(NODE) (DECL_FIELD_SIZE ((NODE)))
+
 /* In a TREE_LIST concatenating using directives, indicate indirekt
    directives  */
 #define TREE_INDIRECT_USING(NODE) ((NODE)->common.lang_flag_0)
@@ -1658,8 +1668,63 @@ extern int flag_new_for_scope;
 
 /* 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)
-#define TYPE_PTRMEMFUNC_FLAG(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
+#define TYPE_PTRMEMFUNC_P(NODE) \
+  (TREE_CODE(NODE) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (NODE))
+#define TYPE_PTRMEMFUNC_FLAG(NODE) \
+  (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
+
+/* A pointer-to-function member type looks like:
+
+   struct {
+     short __delta;
+     short __index;
+     union {
+       P __pfn;
+       short __delta2;
+     } __pfn_or_delta2;
+   };
+
+   where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
+   pointer to member.  The fields are used as follows:
+
+     If __INDEX is -1, then the function to call is non-virtual, and
+     is located at the address given by __PFN.
+
+     If __INDEX is zero, then this a NULL pointer-to-member.
+
+     Otherwise, the function to call is virtual.  Then, __DELTA2 gives
+     the offset from an instance of the object to the virtual function
+     table, and __INDEX - 1 is the index into the vtable to use to
+     find the function.
+
+     The value to use for the THIS parameter is the address of the
+     object plus __DELTA.
+
+   For example, given:
+
+     struct B1 {
+       int i;
+     };
+
+     struct B2 {
+       double d;
+       void f();
+     };
+
+     struct S : public B1, B2 {};
+
+   the pointer-to-member for `&S::f' looks like:
+
+     { 4, -1, { &f__2B2 } };
+
+   The `4' means that given an `S*' you have to add 4 bytes to get to
+   the address of the `B2*'.  Then, the -1 indicates that this is a
+   non-virtual function.  Of course, `&f__2B2' is the name of that
+   function.
+
+   (Of course, the exactl values may differ depending on the mangling
+   scheme, sizes of types, and such.).  */
+     
 /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
    pointer to member function.  TYPE_PTRMEMFUNC_P _must_ be true,
    before using this macro.  */
@@ -1674,8 +1739,8 @@ extern int flag_new_for_scope;
 #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
 #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
 /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P.  */
-#define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), delta2_identifier, NULL_TREE, 0))
-#define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), pfn_identifier, NULL_TREE, 0))
+#define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
+#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
 
 /* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
    `X'.  */
@@ -1696,19 +1761,20 @@ extern int flag_new_for_scope;
    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))
-
 /* Nonzero in FUNCTION_DECL means it is really an operator.
    Just used to communicate formatting information to dbxout.c.  */
 #define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr)
 
 #define ANON_UNION_P(NODE) (DECL_NAME (NODE) == 0)
 
-/* Nonzero if TYPE is an anonymous union type.  */
-#define ANON_UNION_TYPE_P(TYPE) \
-  (TREE_CODE (TYPE) == UNION_TYPE \
-   && ANON_AGGRNAME_P (TYPE_IDENTIFIER (TYPE)))
+/* Nonzero if TYPE is an anonymous union type.  We have to use a flag for
+   this because "A union for which objects or pointers are declared is not
+   an anonymous union" [class.union].  */
+#define ANON_UNION_TYPE_P(NODE)                                \
+  (TYPE_LANG_SPECIFIC (NODE)                           \
+   && TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_union)
+#define SET_ANON_UNION_TYPE_P(NODE)                            \
+  (TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_union = 1)
 
 #define UNKNOWN_TYPE LANG_TYPE
 
@@ -1742,6 +1808,8 @@ extern int flag_new_for_scope;
    the TREE_PUROSE will be the class type, and the TREE_VALUE will be
    NULL_TREE.  */
 #define DECL_FRIENDLIST(NODE)          (DECL_INITIAL (NODE))
+#define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
+#define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
 
 /* The DECL_ACCESS, if non-NULL, is a TREE_LIST.  The TREE_PURPOSE of
    each node is a type; the TREE_VALUE is the access granted for this
@@ -1913,6 +1981,12 @@ extern int flag_new_for_scope;
 #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
   (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
 
+/* Non-zero if TYPE is a partial instantiation of a template class,
+   i.e., an instantiation whose instantiation arguments involve
+   template types.  */
+#define PARTIAL_INSTANTIATION_P(TYPE) \
+  (TYPE_LANG_SPECIFIC (TYPE)->type_flags.is_partial_instantiation)
+
 /* Non-zero iff we are currently processing a declaration for an
    entity with its own template parameter list, and which is not a
    full specialization.  */
@@ -2189,12 +2263,6 @@ extern int current_function_parms_stored;
 #define OPERATOR_ASSIGN_FORMAT "__a%s"
 #define OPERATOR_FORMAT "__%s"
 #define OPERATOR_TYPENAME_FORMAT "__op"
-#define OPERATOR_TYPENAME_P(ID_NODE) \
-  (IDENTIFIER_POINTER (ID_NODE)[0] == '_'      \
-   && IDENTIFIER_POINTER (ID_NODE)[1] == '_'   \
-   && IDENTIFIER_POINTER (ID_NODE)[2] == 'o'   \
-   && IDENTIFIER_POINTER (ID_NODE)[3] == 'p')
-
 
 /* Cannot use '$' up front, because this confuses gdb
    (names beginning with '$' are gdb-local identifiers).
@@ -2360,10 +2428,11 @@ extern int current_function_parms_stored;
 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
 
 /* Store the vbase pointer field name for type TYPE into pointer BUF.  */
-#define FORMAT_VBASE_NAME(BUF,TYPE) do {                               \
-  BUF = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE)             \
+#define FORMAT_VBASE_NAME(BUF,TYPE) do {                               \
+  char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE)      \
                         + sizeof (VBASE_NAME) + 1);                    \
-  sprintf (BUF, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
+  sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE));        \
+  (BUF) = wbuf;                                                                \
 } while (0)
 
 /* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
@@ -2577,6 +2646,16 @@ extern tree current_class_name;  /* IDENTIFIER_NODE: name of current class */
 #define COMPARE_REDECLARATION 4 /* The comparsion is being done when
                                   another declaration of an existing
                                   entity is seen.  */
+#define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore
+                                  extra-linguistic type attributes.  */
+
+/* Used with push_overloaded_decl.  */
+#define PUSH_GLOBAL          0  /* Push the DECL into namespace scope,
+                                  regardless of the current scope.  */
+#define PUSH_LOCAL           1  /* Push the DECL into the current
+                                  scope.  */
+#define PUSH_USING           2  /* We are pushing this DECL as the
+                                  result of a using declaration.  */
 
 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
    sense of `same'.  */
@@ -2589,9 +2668,6 @@ extern tree current_class_name;   /* IDENTIFIER_NODE: name of current class */
 #define same_or_base_type_p(type1, type2) \
   comptypes ((type1), (type2), COMPARE_BASE)
 
-#define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
-#define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
-
 /* These macros are used to access a TEMPLATE_PARM_INDEX.  */
 #define TEMPLATE_PARM_IDX(NODE) (((template_parm_index*) NODE)->index)
 #define TEMPLATE_PARM_LEVEL(NODE) (((template_parm_index*) NODE)->level)
@@ -2636,9 +2712,10 @@ extern tree build_op_new_call                    PROTO((enum tree_code, tree, tree, int));
 extern tree build_op_delete_call               PROTO((enum tree_code, tree, tree, int, tree));
 extern int can_convert                         PROTO((tree, tree));
 extern int can_convert_arg                     PROTO((tree, tree, tree));
-extern void enforce_access                      PROTO((tree, tree));
-extern tree convert_default_arg                 PROTO((tree, tree));
+extern int enforce_access                       PROTO((tree, tree));
+extern tree convert_default_arg                 PROTO((tree, tree, tree));
 extern tree convert_arg_to_ellipsis             PROTO((tree));
+extern int is_properly_derived_from             PROTO((tree, tree));
 
 /* in class.c */
 extern tree build_vbase_path                   PROTO((enum tree_code, tree, tree, tree, int));
@@ -2649,25 +2726,28 @@ extern int currently_open_class                 PROTO((tree));
 extern tree get_vfield_offset                  PROTO((tree));
 extern void duplicate_tag_error                        PROTO((tree));
 extern tree finish_struct                      PROTO((tree, tree, int));
-extern tree finish_struct_1                    PROTO((tree, int));
+extern void finish_struct_1                    PROTO((tree, int));
 extern int resolves_to_fixed_type_p            PROTO((tree, int *));
 extern void init_class_processing              PROTO((void));
 extern int is_empty_class                      PROTO((tree));
 extern void pushclass                          PROTO((tree, int));
-extern void popclass                           PROTO((int));
+extern void popclass                           PROTO((void));
 extern void push_nested_class                  PROTO((tree, int));
-extern void pop_nested_class                   PROTO((int));
+extern void pop_nested_class                   PROTO((void));
 extern void push_lang_context                  PROTO((tree));
 extern void pop_lang_context                   PROTO((void));
 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 *));
-extern tree build_self_reference               PROTO((void));
+extern unsigned HOST_WIDE_INT skip_rtti_stuff  PROTO((tree *, tree));
+extern void build_self_reference               PROTO((void));
 extern void warn_hidden                                PROTO((tree));
 extern tree get_enclosing_class                        PROTO((tree));
 int is_base_of_enclosing_class                 PROTO((tree, tree));
 extern void unreverse_member_declarations       PROTO((tree));
+extern void invalidate_class_lookup_cache       PROTO((void));
+extern void maybe_note_name_used_in_class       PROTO((tree, tree));
+extern void note_name_declared_in_class         PROTO((tree, tree));
 
 /* in cvt.c */
 extern tree convert_to_reference               PROTO((tree, tree, int, int, tree));
@@ -2678,7 +2758,7 @@ extern tree ocp_convert                           PROTO((tree, tree, int, int));
 extern tree cp_convert                         PROTO((tree, tree));
 extern tree convert                            PROTO((tree, tree));
 extern tree convert_force                      PROTO((tree, tree, int));
-extern tree build_type_conversion              PROTO((enum tree_code, tree, tree, int));
+extern tree build_type_conversion              PROTO((tree, tree, int));
 extern tree build_expr_type_conversion         PROTO((int, tree, int));
 extern tree type_promotes_to                   PROTO((tree));
 extern tree perform_qualification_conversions   PROTO((tree, tree));
@@ -2688,6 +2768,7 @@ extern tree perform_qualification_conversions   PROTO((tree, tree));
 extern void set_identifier_local_value         PROTO((tree, tree));
 extern int global_bindings_p                   PROTO((void));
 extern int toplevel_bindings_p                 PROTO((void));
+extern int namespace_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));
@@ -2704,7 +2785,6 @@ extern void insert_block                  PROTO((tree));
 extern void add_block_current_level            PROTO((tree));
 extern void set_block                          PROTO((tree));
 extern void pushlevel_class                    PROTO((void));
-extern tree poplevel_class                     PROTO((int));
 extern void print_binding_stack                        PROTO((void));
 extern void print_binding_level                        PROTO((struct binding_level *));
 extern void push_namespace                     PROTO((tree));
@@ -2730,7 +2810,6 @@ extern tree pushdecl_namespace_level            PROTO((tree));
 extern tree push_using_decl                     PROTO((tree, tree));
 extern tree push_using_directive                PROTO((tree));
 extern void push_class_level_binding           PROTO((tree, tree));
-extern tree push_using_decl                     PROTO((tree, tree));
 extern tree implicitly_declare                 PROTO((tree));
 extern tree lookup_label                       PROTO((tree));
 extern tree shadow_label                       PROTO((tree));
@@ -2764,8 +2843,8 @@ extern tree auto_function                 PROTO((tree, tree, enum built_in_function));
 extern void init_decl_processing               PROTO((void));
 extern int init_type_desc                      PROTO((void));
 extern tree define_function
-       PROTO((char *, tree, enum built_in_function,
-              void (*) (tree), char *));
+       PROTO((const char *, tree, enum built_in_function,
+              void (*) (tree), const char *));
 extern tree check_tag_decl                     PROTO((tree));
 extern void shadow_tag                         PROTO((tree));
 extern tree groktypename                       PROTO((tree));
@@ -2799,18 +2878,32 @@ extern tree maybe_build_cleanup_and_delete      PROTO((tree));
 extern tree maybe_build_cleanup                        PROTO((tree));
 extern void cplus_expand_expr_stmt             PROTO((tree));
 extern void finish_stmt                                PROTO((void));
-extern int id_in_current_class                 PROTO((tree));
 extern void push_cp_function_context           PROTO((tree));
 extern void pop_cp_function_context            PROTO((tree));
 extern int in_function_p                       PROTO((void));
 extern void replace_defarg                     PROTO((tree, tree));
 extern void print_other_binding_stack          PROTO((struct binding_level *));
 extern void revert_static_member_fn             PROTO((tree*, tree*, tree*));
-extern void cat_namespace_levels                PROTO((void));
 extern void fixup_anonymous_union               PROTO((tree));
 extern int check_static_variable_definition     PROTO((tree, tree));
-extern void push_local_binding                  PROTO((tree, tree));
-extern void push_class_binding                  PROTO((tree, tree));
+extern void push_local_binding                  PROTO((tree, tree, int));
+extern int push_class_binding                   PROTO((tree, tree));
+extern tree check_default_argument              PROTO((tree, tree));
+extern tree push_overloaded_decl               PROTO((tree, int));
+extern void clear_identifier_class_values       PROTO((void));
+extern void storetags                           PROTO((tree));
+extern int vtable_decl_p                        PROTO((tree, void *));
+extern int vtype_decl_p                         PROTO((tree, void *));
+extern int sigtable_decl_p                      PROTO((tree, void *));
+typedef int (*walk_globals_pred)                PROTO((tree, void *));
+typedef int (*walk_globals_fn)                  PROTO((tree *, void *));
+extern int walk_globals                         PROTO((walk_globals_pred,
+                                                      walk_globals_fn,
+                                                      void *));
+typedef int (*walk_namespaces_fn)               PROTO((tree, void *));
+extern int walk_namespaces                      PROTO((walk_namespaces_fn,
+                                                      void *));
+extern int wrapup_globals_for_namespace         PROTO((tree, void *));
 
 /* in decl2.c */
 extern int check_java_method                   PROTO((tree));
@@ -2841,16 +2934,13 @@ extern tree get_temp_name                       PROTO((tree, int));
 extern tree get_temp_regvar                    PROTO((tree, tree));
 extern void finish_anon_union                  PROTO((tree));
 extern tree finish_table                       PROTO((tree, tree, tree, int));
-extern void finish_builtin_type                        PROTO((tree, char *, tree *, int, tree));
+extern void finish_builtin_type                        PROTO((tree, const char *,
+                                                      tree *, int, tree));
 extern tree coerce_new_type                    PROTO((tree));
 extern tree coerce_delete_type                 PROTO((tree));
 extern void comdat_linkage                     PROTO((tree));
 extern void import_export_class                        PROTO((tree));
 extern void import_export_vtable               PROTO((tree, tree, int));
-extern int walk_vtables                                PROTO((void (*)(tree, tree),
-                                                      int (*)(tree, tree)));
-extern void walk_sigtables                     PROTO((void (*)(tree, tree),
-                                                      void (*)(tree, tree)));
 extern void import_export_decl                 PROTO((tree));
 extern tree build_cleanup                      PROTO((tree));
 extern void finish_file                                PROTO((void));
@@ -2860,7 +2950,7 @@ extern tree build_expr_from_tree          PROTO((tree));
 extern tree reparse_decl_as_expr               PROTO((tree, tree));
 extern tree finish_decl_parsing                        PROTO((tree));
 extern tree check_cp_case_value                        PROTO((tree));
-extern void set_decl_namespace                  PROTO((tree, tree));
+extern void set_decl_namespace                  PROTO((tree, tree, int));
 extern tree current_decl_namespace              PROTO((void));
 extern void push_decl_namespace                 PROTO((tree));
 extern void pop_decl_namespace                  PROTO((void));
@@ -2875,16 +2965,19 @@ extern void check_default_args                  PROTO((tree));
 extern void mark_used                          PROTO((tree));
 extern tree handle_class_head                  PROTO((tree, tree, tree));
 extern tree lookup_arg_dependent                PROTO((tree, tree, tree));
+extern void finish_static_data_member_decl      PROTO((tree, tree, tree, int, int));
 
 /* in errfn.c */
-extern void cp_error                           ();
-extern void cp_error_at                                ();
-extern void cp_warning                         ();
-extern void cp_warning_at                      ();
-extern void cp_pedwarn                         ();
-extern void cp_pedwarn_at                      ();
-extern void cp_compiler_error                  ();
-extern void cp_sprintf                         ();
+/* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */
+extern void cp_error                           PVPROTO((const char *, ...));
+extern void cp_error_at                                PVPROTO((const char *, ...));
+extern void cp_warning                         PVPROTO((const char *, ...));
+extern void cp_warning_at                      PVPROTO((const char *, ...));
+extern void cp_pedwarn                         PVPROTO((const char *, ...));
+extern void cp_pedwarn_at                      PVPROTO((const char *, ...));
+extern void cp_compiler_error                  PVPROTO((const char *, ...));
+extern void cp_sprintf                         PVPROTO((const char *, ...));
+extern void cp_deprecated                       PROTO((const char*));
 
 /* in error.c */
 extern void init_error                         PROTO((void));
@@ -2926,6 +3019,8 @@ extern void do_case                               PROTO((tree, tree));
 /* friend.c */
 extern int is_friend                           PROTO((tree, tree));
 extern void make_friend_class                  PROTO((tree, tree));
+extern void add_friend                          PROTO((tree, tree));
+extern void add_friends                         PROTO((tree, tree, tree));
 extern tree do_friend                          PROTO((tree, tree, tree, tree, enum overload_flags, tree, int));
 
 /* in init.c */
@@ -2954,7 +3049,7 @@ extern tree build_vec_delete                      PROTO((tree, tree, tree, tree, int));
 /* in input.c */
 
 /* in lex.c */
-extern char *file_name_nondirectory            PROTO((char *));
+extern char *file_name_nondirectory            PROTO((const char *));
 extern tree make_pointer_declarator            PROTO((tree, tree));
 extern tree make_reference_declarator          PROTO((tree, tree));
 extern tree make_call_declarator               PROTO((tree, tree, tree, tree));
@@ -2962,7 +3057,6 @@ extern void set_quals_and_spec                    PROTO((tree, tree, tree));
 extern char *operator_name_string              PROTO((tree));
 extern void lang_init                          PROTO((void));
 extern void lang_finish                                PROTO((void));
-extern void init_filename_times                        PROTO((void));
 #if 0
 extern void reinit_lang_specific               PROTO((void));
 #endif
@@ -2989,12 +3083,14 @@ extern tree identifier_typedecl_value           PROTO((tree));
 extern int real_yylex                          PROTO((void));
 extern int is_rid                              PROTO((tree));
 extern tree build_lang_decl                    PROTO((enum tree_code, tree, tree));
+extern void retrofit_lang_decl                 PROTO((tree));
 extern tree build_lang_field_decl              PROTO((enum tree_code, tree, tree));
 extern void copy_lang_decl                     PROTO((tree));
 extern tree make_lang_type                     PROTO((enum tree_code));
 extern void dump_time_statistics               PROTO((void));
-/* extern void compiler_error                  PROTO((char *, HOST_WIDE_INT, HOST_WIDE_INT)); */
-extern void yyerror                            PROTO((char *));
+extern void compiler_error                     PVPROTO((const char *, ...))
+  ATTRIBUTE_PRINTF_1;
+extern void yyerror                            PROTO((const char *));
 extern void clear_inline_text_obstack          PROTO((void));
 extern void maybe_snarf_defarg                 PROTO((void));
 extern tree snarf_defarg                       PROTO((void));
@@ -3026,9 +3122,9 @@ extern tree get_id_2                              PROTO((char *, tree));
 /* in pt.c */
 extern void check_template_shadow              PROTO ((tree));
 extern tree innermost_args                     PROTO ((tree));
-extern tree tsubst                             PROTO ((tree, tree, tree));
-extern tree tsubst_expr                                PROTO ((tree, tree, tree));
-extern tree tsubst_copy                                PROTO ((tree, tree, tree));
+extern tree tsubst                             PROTO ((tree, tree, int, tree));
+extern tree tsubst_expr                                PROTO ((tree, tree, int, tree));
+extern tree tsubst_copy                                PROTO ((tree, tree, int, tree));
 extern void maybe_begin_member_template_processing PROTO((tree));
 extern void maybe_end_member_template_processing PROTO((void));
 extern tree finish_member_template_decl         PROTO((tree));
@@ -3038,7 +3134,6 @@ extern void reset_specialization                PROTO((void));
 extern void end_specialization                  PROTO((void));
 extern void begin_explicit_instantiation        PROTO((void));
 extern void end_explicit_instantiation          PROTO((void));
-extern tree determine_specialization            PROTO((tree, tree, tree *, int, int));
 extern tree check_explicit_specialization       PROTO((tree, tree, int, int));
 extern tree process_template_parm              PROTO((tree, tree));
 extern tree end_template_parm_list             PROTO((tree));
@@ -3053,8 +3148,7 @@ extern int uses_template_parms                    PROTO((tree));
 extern tree instantiate_class_template         PROTO((tree));
 extern tree instantiate_template               PROTO((tree, tree));
 extern void overload_template_name             PROTO((tree));
-extern int fn_type_unification                  PROTO((tree, tree, tree, tree, tree, unification_kind_t, tree));
-extern int type_unification                    PROTO((tree, tree, tree, tree, tree, unification_kind_t, int));
+extern int fn_type_unification                  PROTO((tree, tree, tree, tree, tree, unification_kind_t));
 struct tinst_level *tinst_for_decl             PROTO((void));
 extern void mark_decl_instantiated             PROTO((tree, int));
 extern int more_specialized                    PROTO((tree, tree, tree));
@@ -3082,6 +3176,7 @@ extern void maybe_process_partial_specialization PROTO((tree));
 extern void maybe_check_template_type           PROTO((tree));
 extern tree most_specialized_instantiation      PROTO((tree, tree));
 extern void print_candidates                    PROTO((tree));
+extern int instantiate_pending_templates        PROTO((void));
 
 extern int processing_specialization;
 extern int processing_explicit_instantiation;
@@ -3090,7 +3185,7 @@ extern int processing_template_parmlist;
 /* in repo.c */
 extern void repo_template_used                 PROTO((tree));
 extern void repo_template_instantiated         PROTO((tree, int));
-extern void init_repo                          PROTO((char*));
+extern void init_repo                          PROTO((const char *));
 extern void finish_repo                                PROTO((void));
 
 /* in rtti.c */
@@ -3109,16 +3204,14 @@ extern int types_overlap_p                      PROTO((tree, tree));
 extern tree get_vbase                          PROTO((tree, tree));
 extern tree get_binfo                          PROTO((tree, tree, int));
 extern int get_base_distance                   PROTO((tree, tree, int, tree *));
-extern tree compute_access                     PROTO((tree, tree));
+extern int accessible_p                         PROTO((tree, tree));
 extern tree lookup_field                       PROTO((tree, tree, int, int));
-extern tree lookup_nested_field                        PROTO((tree, int));
+extern int lookup_fnfields_1                    PROTO((tree, tree));
 extern tree lookup_fnfields                    PROTO((tree, tree, int));
 extern tree lookup_member                      PROTO((tree, tree, int, int));
 extern tree lookup_nested_tag                  PROTO((tree, tree));
 extern tree get_matching_virtual               PROTO((tree, tree, int));
 extern tree get_abstract_virtuals              PROTO((tree));
-extern tree get_baselinks                      PROTO((tree, tree, tree));
-extern tree next_baselink                      PROTO((tree));
 extern tree init_vbase_pointers                        PROTO((tree, tree));
 extern void expand_indirect_vtbls_init         PROTO((tree, tree, tree));
 extern void clear_search_slots                 PROTO((tree));
@@ -3132,8 +3225,13 @@ 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));
-extern tree get_template_base                  PROTO((tree, tree));
 extern tree binfo_for_vtable                   PROTO((tree));
+extern tree dfs_walk                            PROTO((tree, 
+                                                      tree (*)(tree, void *),
+                                                      tree (*) (tree, void *),
+                                                      void *));
+extern tree dfs_unmark                          PROTO((tree, void *));
+extern tree markedp                             PROTO((tree, void *));
 
 /* in semantics.c */
 extern void finish_expr_stmt                    PROTO((tree));
@@ -3194,9 +3292,10 @@ extern tree finish_template_type_parm           PROTO((tree, tree));
 extern tree finish_template_template_parm       PROTO((tree, tree));
 extern tree finish_parmlist                     PROTO((tree, int));
 extern tree begin_class_definition              PROTO((tree));
-extern tree finish_class_definition             PROTO((tree, tree, int));
+extern tree finish_class_definition             PROTO((tree, tree, int, int));
 extern void finish_default_args                 PROTO((void));
 extern void begin_inline_definitions            PROTO((void));
+extern void finish_inline_definitions           PROTO((void));
 extern tree finish_member_class_template        PROTO((tree));
 extern void finish_template_decl                PROTO((tree));
 extern tree finish_template_type                PROTO((tree, tree, int));
@@ -3229,7 +3328,7 @@ extern tree build_min                             PVPROTO((enum tree_code, tree, ...));
 extern tree build_min_nt                       PVPROTO((enum tree_code, ...));
 extern tree min_tree_cons                      PROTO((tree, tree, tree));
 extern int lvalue_p                            PROTO((tree));
-extern int lvalue_or_else                      PROTO((tree, char *));
+extern int lvalue_or_else                      PROTO((tree, const char *));
 extern tree build_cplus_new                    PROTO((tree, tree));
 extern tree get_target_expr                    PROTO((tree));
 extern tree break_out_cleanups                 PROTO((tree));
@@ -3240,10 +3339,9 @@ extern tree build_cplus_array_type               PROTO((tree, tree));
 extern int layout_basetypes                    PROTO((tree, int));
 extern tree build_vbase_pointer_fields         PROTO((tree));
 extern tree build_base_fields                  PROTO((tree));
-extern tree hash_tree_cons                     PROTO((int, int, int, tree, tree, tree));
+extern tree hash_tree_cons                     PROTO((tree, tree, tree));
 extern tree hash_tree_chain                    PROTO((tree, tree));
 extern tree hash_chainon                       PROTO((tree, tree));
-extern tree get_decl_list                      PROTO((tree));
 extern tree make_binfo                         PROTO((tree, tree, tree, tree));
 extern tree binfo_value                                PROTO((tree, tree));
 extern tree reverse_path                       PROTO((tree));
@@ -3251,6 +3349,7 @@ extern int count_functions                        PROTO((tree));
 extern int is_overloaded_fn                    PROTO((tree));
 extern tree get_first_fn                       PROTO((tree));
 extern tree binding_init                        PROTO((struct tree_binding*));
+extern int bound_pmf_p                         PROTO((tree));
 extern tree ovl_cons                            PROTO((tree, tree));
 extern tree scratch_ovl_cons                    PROTO((tree, tree));
 extern int ovl_member                           PROTO((tree, tree));
@@ -3272,13 +3371,13 @@ extern tree break_out_target_exprs              PROTO((tree));
 extern tree get_type_decl                      PROTO((tree));
 extern tree vec_binfo_member                   PROTO((tree, tree));
 extern tree hack_decl_function_context                 PROTO((tree));
+extern tree decl_namespace_context             PROTO((tree));
 extern tree lvalue_type                                PROTO((tree));
 extern tree error_type                         PROTO((tree));
 extern tree make_temp_vec                      PROTO((int));
 extern tree build_ptr_wrapper                  PROTO((void *));
 extern tree build_expr_ptr_wrapper             PROTO((void *));
 extern tree build_int_wrapper                  PROTO((int));
-extern tree build_srcloc                       PROTO((char *, int));
 extern tree build_srcloc_here                  PROTO((void));
 extern int varargs_function_p                  PROTO((tree));
 extern int really_overloaded_fn                        PROTO((tree));
@@ -3291,21 +3390,23 @@ extern void push_expression_obstack             PROTO((void));
 extern tree build_dummy_object                 PROTO((tree));
 extern tree maybe_dummy_object                 PROTO((tree, tree *));
 extern int is_dummy_object                     PROTO((tree));
+extern tree search_tree                         PROTO((tree, tree (*)(tree)));
+extern int cp_valid_lang_attribute             PROTO((tree, tree, tree, tree));
+
 #define scratchalloc expralloc
 #define scratch_tree_cons expr_tree_cons
 #define build_scratch_list build_expr_list
 #define make_scratch_vec make_temp_vec
 #define push_scratch_obstack push_expression_obstack
-#define hash_tree_cons_simple(PURPOSE, VALUE, CHAIN) \
-  hash_tree_cons (0, 0, 0, (PURPOSE), (VALUE), (CHAIN))
 
 /* in typeck.c */
 extern int string_conv_p                       PROTO((tree, tree, int));
 extern tree condition_conversion               PROTO((tree));
 extern tree target_type                                PROTO((tree));
 extern tree require_complete_type              PROTO((tree));
+extern tree require_complete_type_in_void      PROTO((tree));
 extern tree complete_type                      PROTO((tree));
-extern tree complete_type_or_else               PROTO((tree));
+extern tree complete_type_or_else               PROTO((tree, tree));
 extern int type_unknown_p                      PROTO((tree));
 extern int fntype_p                            PROTO((tree));
 extern tree commonparms                                PROTO((tree, tree));
@@ -3333,8 +3434,8 @@ extern tree build_object_ref                      PROTO((tree, tree, tree));
 extern tree build_component_ref_1              PROTO((tree, tree, int));
 extern tree build_component_ref                        PROTO((tree, tree, tree, int));
 extern tree build_x_component_ref              PROTO((tree, tree, tree, int));
-extern tree build_x_indirect_ref               PROTO((tree, char *));
-extern tree build_indirect_ref                 PROTO((tree, char *));
+extern tree build_x_indirect_ref               PROTO((tree, const char *));
+extern tree build_indirect_ref                 PROTO((tree, const char *));
 extern tree build_array_ref                    PROTO((tree, tree));
 extern tree build_x_function_call              PROTO((tree, tree, tree));
 extern tree get_member_function_from_ptrfunc   PROTO((tree *, tree));
@@ -3343,9 +3444,8 @@ extern tree build_function_call                   PROTO((tree, tree));
 extern tree build_function_call_maybe          PROTO((tree, tree));
 extern tree convert_arguments                  PROTO((tree, tree, tree, int));
 extern tree build_x_binary_op                  PROTO((enum tree_code, tree, tree));
-extern tree build_binary_op                    PROTO((enum tree_code, tree, tree, int));
+extern tree build_binary_op                    PROTO((enum tree_code, tree, tree));
 extern tree build_binary_op_nodefault          PROTO((enum tree_code, tree, tree, enum tree_code));
-extern tree build_component_addr               PROTO((tree, tree, char *));
 extern tree build_x_unary_op                   PROTO((enum tree_code, tree));
 extern tree build_unary_op                     PROTO((enum tree_code, tree, int));
 extern tree unary_complex_lvalue               PROTO((enum tree_code, tree));
@@ -3360,8 +3460,7 @@ extern tree build_const_cast                      PROTO((tree, tree));
 extern tree build_c_cast                       PROTO((tree, tree));
 extern tree build_x_modify_expr                        PROTO((tree, enum tree_code, tree));
 extern tree build_modify_expr                  PROTO((tree, enum tree_code, tree));
-extern void warn_for_assignment                        PROTO((char *, char *, char *, tree, int, int));
-extern tree convert_for_initialization         PROTO((tree, tree, tree, int, char *, tree, int));
+extern tree convert_for_initialization         PROTO((tree, tree, tree, int, const char *, tree, int));
 extern void c_expand_asm_operands              PROTO((tree, tree, tree, tree, int, char *, int));
 extern void c_expand_return                    PROTO((tree));
 extern tree c_expand_start_case                        PROTO((tree));
@@ -3369,13 +3468,18 @@ extern int comp_ptr_ttypes                      PROTO((tree, tree));
 extern int ptr_reasonably_similar              PROTO((tree, tree));
 extern tree build_ptrmemfunc                   PROTO((tree, tree, int));
 extern int cp_type_quals                        PROTO((tree));
+extern int cp_has_mutable_p                     PROTO((tree));
 extern int at_least_as_qualified_p              PROTO((tree, tree));
 extern int more_qualified_p                     PROTO((tree, tree));
+extern tree build_ptrmemfunc1                   PROTO((tree, tree, tree, tree, tree));
+extern void expand_ptrmemfunc_cst               PROTO((tree, tree *, tree *, tree *, tree *));
+extern tree delta2_from_ptrmemfunc              PROTO((tree));
+extern tree pfn_from_ptrmemfunc                 PROTO((tree));
 
 /* in typeck2.c */
 extern tree error_not_base_type                        PROTO((tree, tree));
 extern tree binfo_or_else                      PROTO((tree, tree));
-extern void readonly_error                     PROTO((tree, char *, int));
+extern void readonly_error                     PROTO((tree, const char *, int));
 extern void abstract_virtuals_error            PROTO((tree, tree));
 extern void signature_error                    PROTO((tree, tree));
 extern void incomplete_type_error              PROTO((tree, tree));
@@ -3390,18 +3494,18 @@ extern tree build_m_component_ref               PROTO((tree, tree));
 extern tree build_functional_cast              PROTO((tree, tree));
 extern char *enum_name_string                  PROTO((tree, tree));
 extern void report_case_error                  PROTO((int, tree, tree, tree));
-extern void check_for_new_type                 PROTO((char *,flagged_type_tree));
+extern void check_for_new_type                 PROTO((const char *, flagged_type_tree));
 extern tree initializer_constant_valid_p       PROTO((tree, tree));
 
 /* in xref.c */
-extern void GNU_xref_begin                     PROTO((char *));
+extern void GNU_xref_begin                     PROTO((const char *));
 extern void GNU_xref_end                       PROTO((int));
-extern void GNU_xref_file                      PROTO((char *));
+extern void GNU_xref_file                      PROTO((const char *));
 extern void GNU_xref_start_scope               PROTO((HOST_WIDE_INT));
 extern void GNU_xref_end_scope                 PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int));
-extern void GNU_xref_ref                       PROTO((tree, char *));
+extern void GNU_xref_ref                       PROTO((tree, const char *));
 extern void GNU_xref_decl                      PROTO((tree, tree));
-extern void GNU_xref_call                      PROTO((tree, char *));
+extern void GNU_xref_call                      PROTO((tree, const char *));
 extern void GNU_xref_function                  PROTO((tree, tree));
 extern void GNU_xref_assign                    PROTO((tree));
 extern void GNU_xref_hier                      PROTO((tree, tree, int, int, int));