OSDN Git Service

500937b0ed1c9255d60b4974c33c3da601e8246b
[pf3gnuchains/gcc-fork.git] / gcc / cp / cp-tree.h
1 /* Definitions for C++ parsing and type checking.
2    Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
3    Free Software Foundation, Inc.
4    Contributed by Michael Tiemann (tiemann@cygnus.com)
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 #include "c-common.h"
24 #include "function.h"
25 #include "splay-tree.h"
26 #include "varray.h"
27
28 #ifndef _CP_TREE_H
29 #define _CP_TREE_H
30
31 /* Usage of TREE_LANG_FLAG_?:
32    0: BINFO_MARKED (BINFO nodes).
33       COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
34       NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
35       DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
36       LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
37       TREE_NEGATED_INT (in INTEGER_CST).
38       TREE_INDIRECT_USING (in NAMESPACE_DECL).
39       IDENTIFIER_MARKED (used by search routines).
40       LOCAL_BINDING_P (in CPLUS_BINDING)
41       ICS_USER_FLAG (in _CONV)
42       CLEANUP_P (in TRY_BLOCK)
43       AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
44       SCOPE_BEGIN_P (in SCOPE_STMT)
45       CTOR_BEGIN_P (in CTOR_STMT)
46    1: IDENTIFIER_VIRTUAL_P.
47       TI_PENDING_TEMPLATE_FLAG.
48       TEMPLATE_PARMS_FOR_INLINE.
49       DELETE_EXPR_USE_VEC (in DELETE_EXPR).
50       (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
51       TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (in _TYPE).
52       C_DECLARED_LABEL_FLAG (in LABEL_DECL)
53       INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
54       BASELINK_P (in TREE_LIST)
55       ICS_ELLIPSIS_FLAG (in _CONV)
56       STMT_IS_FULL_EXPR_P (in _STMT)
57    2: IDENTIFIER_OPNAME_P.
58       BINFO_VBASE_MARKED.
59       BINFO_FIELDS_MARKED.
60       TYPE_POLYMORHPIC_P (in _TYPE)
61       ICS_THIS_FLAG (in _CONV)
62       STMT_LINENO_FOR_FN_P (in _STMT)
63       BINDING_HAS_LEVEL_P (in CPLUS_BINDING)
64    3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
65       BINFO_VTABLE_PATH_MARKED.
66       BINFO_PUSHDECLS_MARKED.
67       (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
68       ICS_BAD_FLAG (in _CONV)
69       FN_TRY_BLOCK_P (in TRY_BLOCK)
70       SCOPE_NO_CLEANUPS_P (in SCOPE_STMT)
71    4: BINFO_NEW_VTABLE_MARKED.
72       TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
73           or FIELD_DECL).
74       NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
75       SCOPE_PARTIAL_P (in SCOPE_STMT)
76    5: BINFO_PRIMARY_MARKED_P (in BINFO)
77    6: BINFO_VBASE_PRIMARY_P (in BINFO)
78
79    Usage of TYPE_LANG_FLAG_?:
80    0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
81    1: TYPE_HAS_CONSTRUCTOR.
82    2: TYPE_HAS_DESTRUCTOR.
83    3: TYPE_FOR_JAVA.
84    4: TYPE_NEEDS_DESTRUCTOR.
85    5: IS_AGGR_TYPE.
86    6: TYPE_BUILT_IN.
87
88    Usage of DECL_LANG_FLAG_?:
89    0: DECL_ERROR_REPORTED (in VAR_DECL).
90       DECL_TEMPLATE_PARM_P (in CONST_DECL, TYPE_DECL, or TEMPLATE_DECL)
91       DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL)
92    1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
93       DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
94    2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
95       DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
96    3: DECL_IN_AGGR_P.
97    4: DECL_MAYBE_TEMPLATE.
98    5: DECL_INTERFACE_KNOWN.
99    6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
100    7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
101
102    Usage of language-independent fields in a language-dependent manner:
103    
104    TYPE_ALIAS_SET
105      This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so
106      forth as a substitute for the mark bits provided in `lang_type'.
107      At present, only the six low-order bits are used.
108
109    TYPE_BINFO
110      For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO.
111      For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME.
112      For a TEMPLATE_TEMPLATE_PARM, this is
113      TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
114
115    DECL_SAVED_INSNS/DECL_FIELD_SIZE
116      For a static VAR_DECL, this is DECL_INIT_PRIORITY.
117
118    BINFO_VIRTUALS
119      For a binfo, this is a TREE_LIST.  The BV_DELTA of each node
120      gives the amount by which to adjust the `this' pointer when
121      calling the function.  If the method is an overriden version of a
122      base class method, then it is assumed that, prior to adjustment,
123      the this pointer points to an object of the base class.
124
125      The BV_VCALL_INDEX of each node, if non-NULL, gives the vtable
126      index of the vcall offset for this entry.
127
128      The BV_FN is the declaration for the virtual function itself.
129      When CLASSTYPE_COM_INTERFACE_P does not hold, the first entry
130      does not have a BV_FN; it is just an offset.
131
132      The BV_OVERRIDING_BASE is the binfo for the final overrider for
133      this function.  (This binfo's BINFO_TYPE will always be the same
134      as the DECL_CLASS_CONTEXT for the function.)
135
136    DECL_ARGUMENTS
137      For a VAR_DECL this is DECL_ANON_UNION_ELEMS.  
138
139    DECL_VINDEX
140      This field is NULL for a non-virtual function.  For a virtual
141      function, it is eventually set to an INTEGER_CST indicating the
142      index in the vtable at which this function can be found.  When
143      a virtual function is declared, but before it is known what
144      function is overriden, this field is the error_mark_node.
145
146      Temporarily, it may be set to a TREE_LIST whose TREE_VALUE is 
147      the virtual function this one overrides, and whose TREE_CHAIN is
148      the old DECL_VINDEX.  */
149
150 /* Language-specific tree checkers. */
151
152 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
153
154 #define VAR_OR_FUNCTION_DECL_CHECK(NODE)                        \
155 ({  const tree __t = NODE;                                      \
156     enum tree_code __c = TREE_CODE(__t);                        \
157     if (__c != VAR_DECL && __c != FUNCTION_DECL)                \
158       tree_check_failed (__t, VAR_DECL, __FILE__,               \
159                          __LINE__, __PRETTY_FUNCTION__);        \
160     __t; })
161
162 #define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE)                   \
163 ({  const tree __t = NODE;                                      \
164     enum tree_code __c = TREE_CODE(__t);                        \
165     if (__c != VAR_DECL                                         \
166         && __c != FUNCTION_DECL                                 \
167         && __c != PARM_DECL)                                    \
168       tree_check_failed (__t, VAR_DECL, __FILE__,               \
169                          __LINE__, __PRETTY_FUNCTION__);        \
170     __t; })
171
172 #define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE)             \
173 ({  const tree __t = NODE;                                      \
174     enum tree_code __c = TREE_CODE(__t);                        \
175     if (__c != VAR_DECL                                         \
176         && __c != FUNCTION_DECL                                 \
177         && __c != TYPE_DECL                                     \
178         && __c != TEMPLATE_DECL)                                \
179       tree_check_failed (__t, VAR_DECL, __FILE__,               \
180                          __LINE__, __PRETTY_FUNCTION__);        \
181     __t; })
182
183 #define RECORD_OR_UNION_TYPE_CHECK(NODE)                        \
184 ({  const tree __t = NODE;                                      \
185     enum tree_code __c = TREE_CODE(__t);                        \
186     if (__c != RECORD_TYPE && __c != UNION_TYPE)                \
187       tree_check_failed (__t, RECORD_TYPE, __FILE__,            \
188                          __LINE__, __PRETTY_FUNCTION__);        \
189     __t; })
190
191 #else /* not ENABLE_TREE_CHECKING, or not gcc */
192
193 #define VAR_OR_FUNCTION_DECL_CHECK(NODE)        NODE
194 #define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE)   NODE
195 #define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE)     NODE
196 #define RECORD_OR_UNION_TYPE_CHECK(NODE)        NODE
197
198 #endif
199 \f
200 /* ABI control.  */
201
202 /* Nonzero to enable experimental ABI changes.  */
203
204 extern int flag_new_abi;
205
206 /* Nonzero to use __cxa_atexit, rather than atexit, to register
207    destructors for local statics and global objects.  */
208
209 extern int flag_use_cxa_atexit;
210
211 /* Nonzero to not ignore namespace std. */
212
213 extern int flag_honor_std;
214
215 /* Nonzero means generate 'rtti' that give run-time type information.  */
216
217 extern int flag_rtti;
218
219 /* Nonzero if virtual base class offsets are stored in the virtual
220    function table.  Zero if, instead, a pointer to the virtual base is
221    stored in the object itself.  */
222 #define vbase_offsets_in_vtable_p() (flag_new_abi)
223
224 /* Nonzero if displacements to the `this' pointer to use when calling
225    virtual functions in a virtual base class are present in the
226    vtable.  */
227 #define vcall_offsets_in_vtable_p() (flag_new_abi)
228
229 /* Nonzero if a derived class that needs a vptr should always get one,
230    even if a non-primary base class already has one.  For example,
231    given:
232
233      struct S { int i; virtual void f(); };
234      struct T : virtual public S {};
235
236    one could either reuse the vptr in `S' for `T', or create a new
237    vptr for `T'.  If this flag is nonzero we choose the latter
238    alternative; otherwise, we choose the former.  */
239 #define vptrs_present_everywhere_p() (flag_new_abi)
240
241 /* Nonzero if the vtable for a derived class should contain the
242    virtual functions from the primary base and all virtual functions
243    present in the class itself.  Zero if, instead, it should contain
244    only those virtual functions from the primary base together with
245    the functions declared in the derived class (but not in any base
246    class).  */
247 #define all_overridden_vfuns_in_vtables_p() (flag_new_abi)
248
249 /* Nonzero if we use access type_info objects directly, and use the
250    cross-vendor layout for them. Zero if we use an accessor function
251    to get the type_info object address.  */
252 #define new_abi_rtti_p() (flag_new_abi)
253
254 /* Nonzero if primary and secondary vtables are combined into a single
255    vtable.  */
256 #define merge_primary_and_secondary_vtables_p() (flag_new_abi)
257
258 \f
259 /* Language-dependent contents of an identifier.  */
260
261 struct lang_identifier
262 {
263   struct tree_identifier ignore;
264   tree namespace_bindings;
265   tree bindings;
266   tree class_value;
267   tree class_template_info;
268   struct lang_id2 *x;
269 };
270
271 #define LANG_IDENTIFIER_CAST(NODE) \
272         ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
273
274 struct lang_id2
275 {
276   tree label_value, implicit_decl;
277   tree error_locus;
278 };
279
280 typedef struct 
281 {
282   tree t;
283   int new_type_flag;
284   tree lookups;
285 } flagged_type_tree;
286
287 typedef struct 
288 {
289   char common[sizeof (struct tree_common)];
290   HOST_WIDE_INT index;
291   HOST_WIDE_INT level;
292   HOST_WIDE_INT orig_level;
293   tree decl;
294 } template_parm_index;
295
296 typedef struct ptrmem_cst
297 {
298   char common[sizeof (struct tree_common)];
299   /* This isn't used, but the middle-end expects all constants to have 
300      this field.  */
301   struct rtx_def *rtl;
302   tree member;
303 }* ptrmem_cst_t;
304
305 /* Nonzero if this binding is for a local scope, as opposed to a class
306    or namespace scope.  */
307 #define LOCAL_BINDING_P(NODE) TREE_LANG_FLAG_0(NODE)
308
309 /* Nonzero if BINDING_VALUE is from a base class of the class which is
310    currently being defined.  */
311 #define INHERITED_VALUE_BINDING_P(NODE) TREE_LANG_FLAG_1(NODE)
312
313 /* For a binding between a name and an entity at a non-local scope,
314    defines the scope where the binding is declared.  (Either a class
315    _TYPE node, or a NAMESPACE_DECL.)  This macro should be used only
316    for namespace-level bindings; on the IDENTIFIER_BINDING list
317    BINDING_LEVEL is used instead.  */
318 #define BINDING_SCOPE(NODE) (((struct tree_binding*)CPLUS_BINDING_CHECK (NODE))->scope.scope)
319
320 /* Nonzero if NODE has BINDING_LEVEL, rather than BINDING_SCOPE.  */
321 #define BINDING_HAS_LEVEL_P(NODE) TREE_LANG_FLAG_2 ((NODE))
322
323 /* This is the declaration bound to the name. Possible values:
324    variable, overloaded function, namespace, template, enumerator.  */
325 #define BINDING_VALUE(NODE)    (((struct tree_binding*)CPLUS_BINDING_CHECK (NODE))->value)
326
327 /* If name is bound to a type, this is the type (struct, union, enum).  */
328 #define BINDING_TYPE(NODE)     TREE_TYPE(NODE)
329
330 #define IDENTIFIER_GLOBAL_VALUE(NODE) \
331   namespace_binding (NODE, global_namespace)
332 #define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
333   set_namespace_binding (NODE, global_namespace, VAL)
334 #define IDENTIFIER_NAMESPACE_VALUE(NODE) \
335   namespace_binding (NODE, current_namespace)
336 #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
337   set_namespace_binding (NODE, current_namespace, VAL)
338
339 struct tree_binding
340 {
341   char common[sizeof (struct tree_common)];
342   union {
343     tree scope;
344     struct binding_level *level;
345   } scope;
346   tree value;
347 };
348
349 /* The overloaded FUNCTION_DECL. */
350 #define OVL_FUNCTION(NODE)   (((struct tree_overload*)OVERLOAD_CHECK (NODE))->function)
351 #define OVL_CHAIN(NODE)      TREE_CHAIN(NODE)
352 /* Polymorphic access to FUNCTION and CHAIN. */
353 #define OVL_CURRENT(NODE)     \
354   ((TREE_CODE(NODE)==OVERLOAD) ? OVL_FUNCTION(NODE) : NODE)
355 #define OVL_NEXT(NODE)        \
356   ((TREE_CODE(NODE)==OVERLOAD) ? TREE_CHAIN(NODE) : NULL_TREE)
357 /* If set, this was imported in a using declaration.
358    This is not to confuse with being used somewhere, which
359    is not important for this node. */
360 #define OVL_USED(NODE)        TREE_USED(NODE)
361
362 struct tree_overload
363 {
364   char common[sizeof (struct tree_common)];
365   tree function;
366 };
367
368 /* A `baselink' is a TREE_LIST whose TREE_PURPOSE is a BINFO
369    indicating a particular base class, and whose TREE_VALUE is a
370    (possibly overloaded) function from that base class.  */
371 #define BASELINK_P(NODE) \
372   (TREE_CODE (NODE) == TREE_LIST && TREE_LANG_FLAG_1 (NODE))
373 #define SET_BASELINK_P(NODE) \
374   (TREE_LANG_FLAG_1 (NODE) = 1)
375
376 #define WRAPPER_PTR(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.ptr)
377 #define WRAPPER_INT(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.i)
378
379 struct tree_wrapper
380 {
381   char common[sizeof (struct tree_common)];
382   union {
383     void *ptr;
384     int i;
385   } u;
386 };
387
388 #define SRCLOC_FILE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->filename)
389 #define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
390 struct tree_srcloc
391 {
392   char common[sizeof (struct tree_common)];
393   char *filename;
394   int linenum;
395 };
396
397 /* To identify to the debug emitters if it should pay attention to the
398    flag `-Wtemplate-debugging'.  */
399 #define HAVE_TEMPLATES 1
400
401 /* Macros for access to language-specific slots in an identifier.  */
402
403 #define IDENTIFIER_NAMESPACE_BINDINGS(NODE)     \
404   (LANG_IDENTIFIER_CAST (NODE)->namespace_bindings)
405 #define IDENTIFIER_TEMPLATE(NODE)       \
406   (LANG_IDENTIFIER_CAST (NODE)->class_template_info)
407
408 /* The IDENTIFIER_BINDING is the innermost CPLUS_BINDING for the
409     identifier.  It's TREE_CHAIN is the next outermost binding.  Each
410     BINDING_VALUE is a DECL for the associated declaration.  Thus,
411     name lookup consists simply of pulling off the node at the front
412     of the list (modulo oddities for looking up the names of types,
413     and such.)  You can use BINDING_SCOPE or BINDING_LEVEL to
414     determine the scope that bound the name.  */
415 #define IDENTIFIER_BINDING(NODE) \
416   (LANG_IDENTIFIER_CAST (NODE)->bindings)
417
418 /* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or
419    NULL_TREE if there is no binding.  */
420 #define IDENTIFIER_VALUE(NODE)                  \
421   (IDENTIFIER_BINDING (NODE)                    \
422    ? BINDING_VALUE (IDENTIFIER_BINDING (NODE))  \
423    : NULL_TREE)
424
425 /* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
426    class, and IDENTIFIER_CLASS_VALUE is the value binding.  This is
427    just a pointer to the BINDING_VALUE of one of the bindings in the
428    IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
429    IDENTIFIER_BINDING.  */
430 #define IDENTIFIER_CLASS_VALUE(NODE) \
431   (LANG_IDENTIFIER_CAST (NODE)->class_value)
432
433 /* The amount of time used by the file whose special "time identifier"
434    is NODE, represented as an INTEGER_CST.  See get_time_identifier.  */
435 #define TIME_IDENTIFIER_TIME(NODE) IDENTIFIER_BINDING(NODE)
436
437 /* For a "time identifier" this is a INTEGER_CST.  The
438    TREE_INT_CST_LOW is 1 if the corresponding file is "interface only".
439    The TRE_INT_CST_HIGH is 1 if it is "interface unknown".  */
440 #define TIME_IDENTIFIER_FILEINFO(NODE) IDENTIFIER_CLASS_VALUE (NODE)
441
442 /* TREE_TYPE only indicates on local and class scope the current
443    type. For namespace scope, the presence of a type in any namespace
444    is indicated with global_type_node, and the real type behind must
445    be found through lookup. */
446 #define IDENTIFIER_TYPE_VALUE(NODE) (identifier_type_value(NODE))
447 #define REAL_IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
448 #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)
449 #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
450
451 #define LANG_ID_FIELD(NAME,NODE)                        \
452   (LANG_IDENTIFIER_CAST (NODE)->x                       \
453    ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)   
454
455 #define SET_LANG_ID(NODE,VALUE,NAME)                                      \
456   (LANG_IDENTIFIER_CAST (NODE)->x == 0                            \
457    ? LANG_IDENTIFIER_CAST (NODE)->x                                       \
458       = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
459    LANG_IDENTIFIER_CAST (NODE)->x->NAME = (VALUE))
460
461 #define IDENTIFIER_LABEL_VALUE(NODE)        LANG_ID_FIELD(label_value, NODE)
462 #define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE)   \
463         SET_LANG_ID(NODE, VALUE, label_value)
464
465 #define IDENTIFIER_IMPLICIT_DECL(NODE)      LANG_ID_FIELD(implicit_decl, NODE)
466 #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
467         SET_LANG_ID(NODE, VALUE, implicit_decl)
468
469 #define IDENTIFIER_ERROR_LOCUS(NODE)        LANG_ID_FIELD(error_locus, NODE)
470 #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE)  \
471         SET_LANG_ID(NODE, VALUE, error_locus)
472
473
474 #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
475
476 /* Nonzero if this identifier is the prefix for a mangled C++ operator
477    name.  */
478 #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
479
480 /* Nonzero if this identifier is the name of a type-conversion
481    operator.  */
482 #define IDENTIFIER_TYPENAME_P(NODE)                     \
483   (! strncmp (IDENTIFIER_POINTER (NODE),                \
484               OPERATOR_TYPENAME_FORMAT,                 \
485               strlen (OPERATOR_TYPENAME_FORMAT)))
486
487 /* Nonzero means reject anything that ANSI standard C forbids.  */
488 extern int pedantic;
489
490 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only.  */
491 #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type)
492
493 /* Record in each node resulting from a binary operator
494    what operator was specified for it.  */
495 #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
496
497 /* Store a value in that field.  */
498 #define C_SET_EXP_ORIGINAL_CODE(exp, code) \
499   (TREE_COMPLEXITY (exp) = (int)(code))
500 \f
501 /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the
502    next exception handler.  */
503 extern tree exception_throw_decl;
504
505 enum cp_tree_index
506 {
507     CPTI_JAVA_BYTE_TYPE,
508     CPTI_JAVA_SHORT_TYPE,
509     CPTI_JAVA_INT_TYPE,
510     CPTI_JAVA_LONG_TYPE,
511     CPTI_JAVA_FLOAT_TYPE,
512     CPTI_JAVA_DOUBLE_TYPE,
513     CPTI_JAVA_CHAR_TYPE,
514     CPTI_JAVA_BOOLEAN_TYPE,
515
516     CPTI_VOID_ZERO,
517     CPTI_WCHAR_DECL,
518     CPTI_VTABLE_ENTRY_TYPE,
519     CPTI_DELTA_TYPE,
520     CPTI_CLEANUP_TYPE,
521
522     CPTI_TI_DESC_TYPE,
523     CPTI_BLTN_DESC_TYPE,
524     CPTI_PTR_DESC_TYPE,
525     CPTI_REF_DESC_TYPE,
526     CPTI_ARY_DESC_TYPE,
527     CPTI_FUNC_DESC_TYPE,
528     CPTI_ENUM_DESC_TYPE,
529     CPTI_CLASS_DESC_TYPE,
530     CPTI_SI_CLASS_DESC_TYPE,
531     CPTI_VMI_CLASS_DESC_TYPE,
532     CPTI_PTMD_DESC_TYPE,
533     CPTI_BASE_DESC_TYPE,
534     
535     CPTI_CLASS_STAR_TYPE,
536     CPTI_CLASS_TYPE,
537     CPTI_RECORD_TYPE,
538     CPTI_UNION_TYPE,
539     CPTI_ENUM_TYPE,
540     CPTI_UNKNOWN_TYPE,
541     CPTI_VTBL_TYPE,
542     CPTI_VTBL_PTR_TYPE,
543     CPTI_STD,
544     CPTI_TYPE_INFO_TYPE,
545     CPTI_TINFO_DECL_ID,
546     CPTI_TINFO_DECL_TYPE,
547     CPTI_TINFO_VAR_ID,
548     CPTI_ABORT_FNDECL,
549     CPTI_GLOBAL_DELETE_FNDECL,
550
551     CPTI_ACCESS_DEFAULT,
552     CPTI_ACCESS_PUBLIC,
553     CPTI_ACCESS_PROTECTED,
554     CPTI_ACCESS_PRIVATE,
555     CPTI_ACCESS_DEFAULT_VIRTUAL,
556     CPTI_ACCESS_PUBLIC_VIRTUAL,
557     CPTI_ACCESS_PROTECTED_VIRTUAL,
558     CPTI_ACCESS_PRIVATE_VIRTUAL,
559
560     CPTI_CTOR_IDENTIFIER,
561     CPTI_DELTA2_IDENTIFIER,
562     CPTI_DELTA_IDENTIFIER,
563     CPTI_DTOR_IDENTIFIER,
564     CPTI_IN_CHARGE_IDENTIFIER,
565     CPTI_INDEX_IDENTIFIER,
566     CPTI_NELTS_IDENTIFIER,
567     CPTI_THIS_IDENTIFIER,
568     CPTI_PFN_IDENTIFIER,
569     CPTI_PFN_OR_DELTA2_IDENTIFIER,
570     CPTI_VPTR_IDENTIFIER,
571
572     CPTI_LANG_NAME_C,
573     CPTI_LANG_NAME_CPLUSPLUS,
574     CPTI_LANG_NAME_JAVA,
575
576     CPTI_EMPTY_EXCEPT_SPEC,
577     CPTI_NULL,
578     CPTI_JCLASS,
579     CPTI_MINUS_ONE,
580     CPTI_TERMINATE,
581     CPTI_ATEXIT,
582     CPTI_DSO_HANDLE,
583     CPTI_BAD_CAST,
584     CPTI_BAD_TYPEID,
585     CPTI_DCAST,
586
587     CPTI_MAX
588 };
589
590 extern tree cp_global_trees[CPTI_MAX];
591
592 #define java_byte_type_node             cp_global_trees[CPTI_JAVA_BYTE_TYPE]
593 #define java_short_type_node            cp_global_trees[CPTI_JAVA_SHORT_TYPE]
594 #define java_int_type_node              cp_global_trees[CPTI_JAVA_INT_TYPE]
595 #define java_long_type_node             cp_global_trees[CPTI_JAVA_LONG_TYPE]
596 #define java_float_type_node            cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
597 #define java_double_type_node           cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
598 #define java_char_type_node             cp_global_trees[CPTI_JAVA_CHAR_TYPE]
599 #define java_boolean_type_node          cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
600
601 #define void_zero_node                  cp_global_trees[CPTI_VOID_ZERO]
602 #define wchar_decl_node                 cp_global_trees[CPTI_WCHAR_DECL]
603 #define vtable_entry_type               cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
604 #define delta_type_node                 cp_global_trees[CPTI_DELTA_TYPE]
605
606 #define ti_desc_type_node               cp_global_trees[CPTI_TI_DESC_TYPE]
607 #define bltn_desc_type_node             cp_global_trees[CPTI_BLTN_DESC_TYPE]
608 #define ptr_desc_type_node              cp_global_trees[CPTI_PTR_DESC_TYPE]
609 #define ref_desc_type_node              cp_global_trees[CPTI_REF_DESC_TYPE]
610 #define ary_desc_type_node              cp_global_trees[CPTI_ARY_DESC_TYPE]
611 #define func_desc_type_node             cp_global_trees[CPTI_FUNC_DESC_TYPE]
612 #define enum_desc_type_node             cp_global_trees[CPTI_ENUM_DESC_TYPE]
613 #define class_desc_type_node            cp_global_trees[CPTI_CLASS_DESC_TYPE]
614 #define si_class_desc_type_node         cp_global_trees[CPTI_SI_CLASS_DESC_TYPE]
615 #define vmi_class_desc_type_node        cp_global_trees[CPTI_VMI_CLASS_DESC_TYPE]
616 #define ptmd_desc_type_node             cp_global_trees[CPTI_PTMD_DESC_TYPE]
617 #define base_desc_type_node             cp_global_trees[CPTI_BASE_DESC_TYPE]
618
619 #define class_star_type_node            cp_global_trees[CPTI_CLASS_STAR_TYPE]
620 #define class_type_node                 cp_global_trees[CPTI_CLASS_TYPE]
621 #define record_type_node                cp_global_trees[CPTI_RECORD_TYPE]
622 #define union_type_node                 cp_global_trees[CPTI_UNION_TYPE]
623 #define enum_type_node                  cp_global_trees[CPTI_ENUM_TYPE]
624 #define unknown_type_node               cp_global_trees[CPTI_UNKNOWN_TYPE]
625 #define vtbl_type_node                  cp_global_trees[CPTI_VTBL_TYPE]
626 #define vtbl_ptr_type_node              cp_global_trees[CPTI_VTBL_PTR_TYPE]
627 #define std_node                        cp_global_trees[CPTI_STD]
628 #define type_info_type_node             cp_global_trees[CPTI_TYPE_INFO_TYPE]
629 #define tinfo_decl_id                   cp_global_trees[CPTI_TINFO_DECL_ID]
630 #define tinfo_decl_type                 cp_global_trees[CPTI_TINFO_DECL_TYPE]
631 #define tinfo_var_id                    cp_global_trees[CPTI_TINFO_VAR_ID]
632 #define abort_fndecl                    cp_global_trees[CPTI_ABORT_FNDECL]
633 #define global_delete_fndecl            cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
634
635 /* Define the sets of attributes that member functions and baseclasses
636    can have.  These are sensible combinations of {public,private,protected}
637    cross {virtual,non-virtual}.  */
638
639 #define access_default_node             cp_global_trees[CPTI_ACCESS_DEFAULT]
640 #define access_public_node              cp_global_trees[CPTI_ACCESS_PUBLIC]
641 #define access_protected_node           cp_global_trees[CPTI_ACCESS_PROTECTED]
642 #define access_private_node             cp_global_trees[CPTI_ACCESS_PRIVATE]
643 #define access_default_virtual_node     cp_global_trees[CPTI_ACCESS_DEFAULT_VIRTUAL]
644 #define access_public_virtual_node      cp_global_trees[CPTI_ACCESS_PUBLIC_VIRTUAL]
645 #define access_protected_virtual_node   cp_global_trees[CPTI_ACCESS_PROTECTED_VIRTUAL]
646 #define access_private_virtual_node     cp_global_trees[CPTI_ACCESS_PRIVATE_VIRTUAL]
647
648 /* We cache these tree nodes so as to call get_identifier less
649    frequently.  */
650
651 #define ctor_identifier                 cp_global_trees[CPTI_CTOR_IDENTIFIER]
652 #define delta2_identifier               cp_global_trees[CPTI_DELTA2_IDENTIFIER]
653 #define delta_identifier                cp_global_trees[CPTI_DELTA_IDENTIFIER]
654 #define dtor_identifier                 cp_global_trees[CPTI_DTOR_IDENTIFIER]
655 #define in_charge_identifier            cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
656 #define index_identifier                cp_global_trees[CPTI_INDEX_IDENTIFIER]
657 #define nelts_identifier                cp_global_trees[CPTI_NELTS_IDENTIFIER]
658 #define this_identifier                 cp_global_trees[CPTI_THIS_IDENTIFIER]
659 #define pfn_identifier                  cp_global_trees[CPTI_PFN_IDENTIFIER]
660 #define pfn_or_delta2_identifier        cp_global_trees[CPTI_PFN_OR_DELTA2_IDENTIFIER]
661 #define vptr_identifier                 cp_global_trees[CPTI_VPTR_IDENTIFIER]
662
663 #define lang_name_c                     cp_global_trees[CPTI_LANG_NAME_C]
664 #define lang_name_cplusplus             cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
665 #define lang_name_java                  cp_global_trees[CPTI_LANG_NAME_JAVA]
666
667 /* Exception specifier used for throw().  */
668 #define empty_except_spec               cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
669
670 /* The node for `__null'.  */
671 #define null_node                       cp_global_trees[CPTI_NULL]
672
673 /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
674 #define jclass_node                     cp_global_trees[CPTI_JCLASS]
675
676 /* A node for `(int) -1'.  */
677 #define minus_one_node                  cp_global_trees[CPTI_MINUS_ONE]
678
679 /* The declaration for `std::terminate'.  */
680 #define terminate_node                  cp_global_trees[CPTI_TERMINATE]
681
682 /* A pointer to `std::atexit'.  */
683 #define atexit_node                     cp_global_trees[CPTI_ATEXIT]
684
685 /* A pointer to `__dso_handle'.  */
686 #define dso_handle_node                 cp_global_trees[CPTI_DSO_HANDLE]
687
688 /* The declaration of __throw_bad_cast.  */
689 #define throw_bad_cast_node             cp_global_trees[CPTI_BAD_CAST]
690
691 /* The declaration of __throw_bad_typeid.  */
692 #define throw_bad_typeid_node           cp_global_trees[CPTI_BAD_TYPEID]
693
694 /* The declaration of the dynamic_cast runtime.  */
695 #define dynamic_cast_node               cp_global_trees[CPTI_DCAST]
696
697 /* The type of a destructor.  */
698 #define cleanup_type                    cp_global_trees[CPTI_CLEANUP_TYPE]
699
700 /* Global state.  */
701
702 struct stmt_tree {
703   tree x_last_stmt;
704   tree x_last_expr_type;
705   int stmts_are_full_exprs_p; 
706 };
707
708 struct saved_scope {
709   tree old_bindings;
710   tree old_namespace;
711   tree class_name;
712   tree class_type;
713   tree access_specifier;
714   tree function_decl;
715   varray_type lang_base;
716   tree *lang_stack;
717   tree lang_name;
718   tree x_function_parms;
719   tree template_parms;
720   tree x_previous_class_type;
721   tree x_previous_class_values;
722   tree x_saved_tree;
723   tree incomplete;
724   tree lookups;
725
726   HOST_WIDE_INT x_processing_template_decl;
727   int x_processing_specialization;
728   int x_processing_explicit_instantiation;
729   int need_pop_function_context;
730
731   struct stmt_tree x_stmt_tree;
732
733   struct binding_level *class_bindings;
734   struct binding_level *bindings;
735
736   struct saved_scope *prev;
737 };
738
739 /* The current open namespace.  */
740
741 #define current_namespace scope_chain->old_namespace
742
743 /* IDENTIFIER_NODE: name of current class */
744
745 #define current_class_name scope_chain->class_name
746
747 /* _TYPE: the type of the current class */
748
749 #define current_class_type scope_chain->class_type
750
751 /* When parsing a class definition, the access specifier most recently
752    given by the user, or, if no access specifier was given, the
753    default value appropriate for the kind of class (i.e., struct,
754    class, or union).  */
755
756 #define current_access_specifier scope_chain->access_specifier
757
758 /* Pointer to the top of the language name stack.  */
759
760 #define current_lang_stack scope_chain->lang_stack
761 #define current_lang_base scope_chain->lang_base
762 #define current_lang_name scope_chain->lang_name
763
764 /* Parsing a function declarator leaves a list of parameter names
765    or a chain or parameter decls here.  */
766
767 #define current_function_parms scope_chain->x_function_parms
768 #define current_template_parms scope_chain->template_parms
769
770 #define processing_template_decl scope_chain->x_processing_template_decl
771 #define processing_specialization scope_chain->x_processing_specialization
772 #define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
773
774 /* _TYPE: the previous type that was a class */
775
776 #define previous_class_type scope_chain->x_previous_class_type
777
778 /* This is a copy of the class_shadowed list of the previous class
779    binding contour when at global scope.  It's used to reset
780    IDENTIFIER_CLASS_VALUEs when entering another class scope (i.e. a
781    cache miss).  */
782
783 #define previous_class_values scope_chain->x_previous_class_values
784
785 /* A list of the declarations with incomplete type at namespace scope.  */
786
787 #define namespace_scope_incomplete scope_chain->incomplete
788
789 /* A list of private types mentioned, for deferred access checking.  */
790
791 #define type_lookups scope_chain->lookups
792
793 extern struct saved_scope *scope_chain;
794
795 /* Global state pertinent to the current function.  */
796
797 struct language_function
798 {
799   tree x_named_labels;
800   tree x_ctor_label;
801   tree x_dtor_label;
802   tree x_base_init_list;
803   tree x_member_init_list;
804   tree x_current_class_ptr;
805   tree x_current_class_ref;
806   tree x_eh_spec_try_block;
807   tree x_scope_stmt_stack;
808   tree x_in_charge_parm;
809
810   tree *x_vcalls_possible_p;
811
812   struct rtx_def *x_result_rtx;
813
814   int returns_value;
815   int returns_null;
816   int parms_stored;
817   int temp_name_counter;
818   int in_function_try_handler;
819   int x_expanding_p;
820   int name_declared;
821   int vtbls_set_up_p;
822
823   struct stmt_tree x_stmt_tree;
824
825   struct named_label_list *x_named_label_uses;
826   struct binding_level *bindings;
827
828   const char *cannot_inline;
829 };
830
831 /* The current C++-specific per-function global variables.  */
832
833 #define cp_function_chain (cfun->language)
834
835 /* In a destructor, the point at which all derived class destroying
836    has been done, just before any base class destroying will be done.  */
837
838 #define dtor_label cp_function_chain->x_dtor_label
839
840 /* In a constructor, the point at which we are ready to return
841    the pointer to the initialized object.  */
842
843 #define ctor_label cp_function_chain->x_ctor_label
844
845 /* In C++, structures with well-defined constructors are initialized by
846    those constructors, unasked.  CURRENT_BASE_INIT_LIST
847    holds a list of stmts for a BASE_INIT term in the grammar.
848    This list has one element for each base class which must be
849    initialized.  The list elements are [basename, init], with
850    type basetype.  This allows the possibly anachronistic form
851    (assuming d : a, b, c) "d (int a) : c(a+5), b (a-4), a (a+3)"
852    where each successive term can be handed down the constructor
853    line.  Perhaps this was not intended.  */
854
855 #define current_base_init_list cp_function_chain->x_base_init_list
856 #define current_member_init_list cp_function_chain->x_member_init_list
857
858 /* When we're processing a member function, current_class_ptr is the
859    PARM_DECL for the `this' pointer.  The current_class_ref is an
860    expression for `*this'.  */
861
862 #define current_class_ptr \
863   (cfun ? cp_function_chain->x_current_class_ptr : NULL_TREE)
864 #define current_class_ref \
865   (cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
866
867 /* Information about the current statement tree.  */
868
869 #define current_stmt_tree                       \
870   (cfun                                         \
871    ? &cp_function_chain->x_stmt_tree            \
872    : &scope_chain->x_stmt_tree)
873
874 /* When building a statement-tree, this is the last statement added to
875    the tree.  */
876
877 #define last_tree current_stmt_tree->x_last_stmt
878
879 /* The type of the last expression-statement we have seen.  This is
880    required because the type of a statement-expression is the type of
881    the last expression statement.  */
882
883 #define last_expr_type current_stmt_tree->x_last_expr_type
884
885 /* The TRY_BLOCK for the exception-specifiers for the current
886    function, if any.  */
887
888 #define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block
889
890 /* The stack of SCOPE_STMTs for the current function.  */
891
892 #define current_scope_stmt_stack cp_function_chain->x_scope_stmt_stack
893
894 /* The `__in_chrg' parameter for the current function.  Only used for
895    destructors.  */
896
897 #define current_in_charge_parm cp_function_chain->x_in_charge_parm
898
899 /* In destructors, this is a pointer to a condition in an
900    if-statement.  If the pointed-to value is boolean_true_node, then
901    there may be virtual function calls in this destructor.  */
902
903 #define current_vcalls_possible_p cp_function_chain->x_vcalls_possible_p
904
905 /* Set to 0 at beginning of a function definition, set to 1 if
906    a return statement that specifies a return value is seen.  */
907
908 #define current_function_returns_value cp_function_chain->returns_value
909
910 /* Set to 0 at beginning of a function definition, set to 1 if
911    a return statement with no argument is seen.  */
912
913 #define current_function_returns_null cp_function_chain->returns_null
914
915 #define current_function_just_assigned_this \
916   cp_function_chain->just_assigned_this
917
918 #define current_function_parms_stored \
919   cp_function_chain->parms_stored
920
921 /* One if we have already declared __FUNCTION__ (and related
922    variables) in the current function.  Two if we are in the process
923    of doing so.  */
924
925 #define current_function_name_declared \
926   cp_function_chain->name_declared
927
928 /* Nonzero if we have already generated code to initialize virtual
929    function tables in this function.  */
930
931 #define vtbls_set_up_p cp_function_chain->vtbls_set_up_p
932
933 /* Used to help generate temporary names which are unique within
934    a function.  Reset to 0 by start_function.  */
935
936 #define temp_name_counter cp_function_chain->temp_name_counter
937
938 /* Non-zero if we should generate RTL for functions that we process.
939    When this is zero, we just accumulate tree structure, without
940    interacting with the back end.  */
941
942 #define expanding_p cp_function_chain->x_expanding_p
943
944 /* Non-zero if we are in the semantic analysis phase for the current
945    function.  */
946
947 #define doing_semantic_analysis_p() (!expanding_p)
948
949 /* Non-zero if we should treat statements as full expressions.  In
950    particular, this variable is no-zero if at the end of a statement
951    we should destroy any temporaries created during that statement.
952    Similarly, if, at the end of a block, we should destroy any local
953    variables in this block.  Normally, this variable is non-zero,
954    since those are the normal semantics of C++.
955
956    However, in order to represent aggregate initialization code as
957    tree structure, we use statement-expressions.  The statements
958    within the statement expression should not result in cleanups being
959    run until the entire enclosing statement is complete.  */
960
961 #define stmts_are_full_exprs_p \
962   current_stmt_tree->stmts_are_full_exprs_p
963
964 #define in_function_try_handler cp_function_chain->in_function_try_handler
965
966 extern tree current_function_return_value;
967 extern tree global_namespace;
968
969 extern tree ridpointers[];
970 extern tree ansi_opname[];
971 extern tree ansi_assopname[];
972
973 /* Nonzero means `$' can be in an identifier.  */
974
975 extern int dollars_in_ident;
976
977 /* Nonzero means allow type mismatches in conditional expressions;
978    just make their values `void'.   */
979
980 extern int flag_cond_mismatch;
981
982 /* Nonzero means don't recognize the keyword `asm'.  */
983
984 extern int flag_no_asm;
985
986 /* For cross referencing.  */
987
988 extern int flag_gnu_xref;
989
990 /* For environments where you can use GNU binutils (as, ld in particular).  */
991
992 extern int flag_gnu_binutils;
993
994 /* Nonzero means warn about implicit declarations.  */
995
996 extern int warn_implicit;
997
998 /* Nonzero means warn about usage of long long when `-pedantic'.  */
999
1000 extern int warn_long_long;
1001
1002 /* Nonzero means warn when all ctors or dtors are private, and the class
1003    has no friends.  */
1004
1005 extern int warn_ctor_dtor_privacy;
1006
1007 /* Nonzero means warn about function definitions that default the return type
1008    or that use a null return and have a return-type other than void.  */
1009
1010 extern int warn_return_type;
1011
1012 /* Nonzero means give string constants the type `const char *', as mandated
1013    by the standard.  */
1014
1015 extern int flag_const_strings;
1016
1017 /* If non-NULL, dump the tree structure for the entire translation
1018    unit to this file.  */
1019
1020 extern char *flag_dump_translation_unit;
1021
1022 /* Nonzero means warn about deprecated conversion from string constant to
1023    `char *'.  */
1024
1025 extern int warn_write_strings;
1026
1027 /* Nonzero means warn about sizeof(function) or addition/subtraction
1028    of function pointers.  */
1029
1030 extern int warn_pointer_arith;
1031
1032 /* Nonzero means warn about suggesting putting in ()'s.  */
1033
1034 extern int warn_parentheses;
1035
1036 /* Nonzero means warn about multiple (redundant) decls for the same single
1037    variable or function.  */
1038
1039 extern int warn_redundant_decls;
1040
1041 /* Warn if initializer is not completely bracketed.  */
1042
1043 extern int warn_missing_braces;
1044
1045 /* Warn about comparison of signed and unsigned values.  */
1046
1047 extern int warn_sign_compare;
1048
1049 /* Warn about testing equality of floating point numbers. */
1050
1051 extern int warn_float_equal;
1052
1053 /* Warn about a subscript that has type char.  */
1054
1055 extern int warn_char_subscripts;
1056
1057 /* Nonzero means warn about pointer casts that can drop a type qualifier
1058    from the pointer target type.  */
1059
1060 extern int warn_cast_qual;
1061
1062 /* Warn about *printf or *scanf format/argument anomalies.  */
1063
1064 extern int warn_format;
1065
1066 /* Nonzero means warn about non virtual destructors in classes that have
1067    virtual functions.  */
1068
1069 extern int warn_nonvdtor;
1070
1071 /* Non-zero means warn when we convert a pointer to member function
1072    into a pointer to (void or function).  */
1073
1074 extern int warn_pmf2ptr;
1075
1076 /* Nonzero means warn about violation of some Effective C++ style rules.  */
1077
1078 extern int warn_ecpp;
1079
1080 /* Nonzero means warn where overload resolution chooses a promotion from
1081    unsigned to signed over a conversion to an unsigned of the same size.  */
1082
1083 extern int warn_sign_promo;
1084
1085 /* Non-zero means warn when a function is declared extern and later inline.  */
1086
1087 extern int warn_extern_inline;
1088
1089 /* Non-zero means warn when an old-style cast is used.  */
1090
1091 extern int warn_old_style_cast;
1092
1093 /* Nonzero means to treat bitfields as unsigned unless they say `signed'.  */
1094
1095 extern int flag_signed_bitfields;
1096
1097 /* True for more efficient but incompatible (not fully tested)
1098    vtable implementation (using thunks).
1099    0 is old behavior; 1 is new behavior.  */
1100 extern int flag_vtable_thunks;
1101
1102 /* INTERFACE_ONLY nonzero means that we are in an "interface"
1103    section of the compiler.  INTERFACE_UNKNOWN nonzero means
1104    we cannot trust the value of INTERFACE_ONLY.  If INTERFACE_UNKNOWN
1105    is zero and INTERFACE_ONLY is zero, it means that we are responsible
1106    for exporting definitions that others might need.  */
1107 extern int interface_only, interface_unknown;
1108
1109 /* Nonzero means we should attempt to elide constructors when possible.  */
1110
1111 extern int flag_elide_constructors;
1112
1113 /* Nonzero means enable obscure ANSI features and disable GNU extensions
1114    that might cause ANSI-compliant code to be miscompiled.  */
1115
1116 extern int flag_ansi;
1117
1118 /* Nonzero means that member functions defined in class scope are
1119    inline by default.  */
1120
1121 extern int flag_default_inline;
1122
1123 /* The name-mangling scheme to use.  Versions of gcc before 2.8 use
1124    version 0.  */
1125 extern int name_mangling_version;
1126
1127 /* Nonzero means that guiding declarations are allowed.  */
1128 extern int flag_guiding_decls;
1129
1130 /* Nonzero if wchar_t should be `unsigned short' instead of whatever it
1131    would normally be, for use with WINE.  */
1132 extern int flag_short_wchar;
1133
1134 /* Nonzero if squashed mangling is to be performed. 
1135    This uses the B and K codes to reference previously seen class types 
1136    and class qualifiers.       */
1137 extern int flag_do_squangling;
1138
1139 /* Nonzero means generate separate instantiation control files and juggle
1140    them at link time.  */
1141 extern int flag_use_repository;
1142
1143 /* Nonzero if we want to issue diagnostics that the standard says are not
1144    required.  */
1145 extern int flag_optional_diags;
1146
1147 /* Nonzero means do not consider empty argument prototype to mean function
1148    takes no arguments.  */
1149 extern int flag_strict_prototype;
1150
1151 /* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc.  */
1152 extern int flag_vtable_gc;
1153
1154 /* Nonzero means make the default pedwarns warnings instead of errors.
1155    The value of this flag is ignored if -pedantic is specified.  */
1156 extern int flag_permissive;
1157
1158 /* Nonzero if we want to obey access control semantics.  */
1159
1160 extern int flag_access_control;
1161
1162 /* If this variable is defined to a non-NULL value, it will be called
1163    after the file has been completely parsed.  The argument will be
1164    the GLOBAL_NAMESPACE.  */
1165
1166 extern void (*back_end_hook) PARAMS ((tree));
1167
1168 \f
1169 /* C++ language-specific tree codes.  */
1170 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
1171 enum cplus_tree_code {
1172   __DUMMY = LAST_AND_UNUSED_TREE_CODE,
1173 #include "cp-tree.def"
1174   LAST_CPLUS_TREE_CODE
1175 };
1176 #undef DEFTREECODE
1177
1178 enum languages { lang_c, lang_cplusplus, lang_java };
1179
1180 /* Macros to make error reporting functions' lives easier.  */
1181 #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
1182 #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
1183 #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
1184
1185 #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME  (NODE))))
1186 #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
1187
1188 /* The _DECL for this _TYPE.  */
1189 #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
1190
1191 /* Nonzero if T is a class (or struct or union) type.  Also nonzero
1192    for template type parameters, typename types, and instantiated
1193    template template parameters.  Despite its name,
1194    this macro has nothing to do with the definition of aggregate given
1195    in the standard.  Think of this macro as MAYBE_CLASS_TYPE_P.  */
1196 #define IS_AGGR_TYPE(t)                         \
1197   (TREE_CODE (t) == TEMPLATE_TYPE_PARM          \
1198    || TREE_CODE (t) == TYPENAME_TYPE            \
1199    || TREE_CODE (t) == TYPEOF_TYPE              \
1200    || (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM  \
1201        && TYPE_TEMPLATE_INFO (t))               \
1202    || TYPE_LANG_FLAG_5 (t))
1203
1204 /* Set IS_AGGR_TYPE for T to VAL.  T must be a class, struct, or 
1205    union type.  */ 
1206 #define SET_IS_AGGR_TYPE(T, VAL) \
1207   (TYPE_LANG_FLAG_5 (T) = (VAL))
1208
1209 /* Nonzero if T is a class type.  Zero for template type parameters,
1210    typename types, and so forth.  */
1211 #define CLASS_TYPE_P(t) \
1212   (IS_AGGR_TYPE_CODE (TREE_CODE (t)) && IS_AGGR_TYPE (t))
1213
1214 #define IS_AGGR_TYPE_CODE(t)    (t == RECORD_TYPE || t == UNION_TYPE)
1215 #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
1216   (TREE_CODE (TYPE1) == TREE_CODE (TYPE2)       \
1217    && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
1218 #define IS_OVERLOAD_TYPE(t) \
1219   (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
1220
1221 /* In a *_TYPE, nonzero means a built-in type.  */
1222 #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
1223
1224 /* True if this a "Java" type, defined in 'extern "Java"'. */
1225 #define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3(NODE)
1226
1227 /* The type qualifiers for this type, including the qualifiers on the
1228    elements for an array type.  */
1229 #define CP_TYPE_QUALS(NODE)                     \
1230   ((TREE_CODE (NODE) != ARRAY_TYPE)             \
1231    ? TYPE_QUALS (NODE) : cp_type_quals (NODE))
1232
1233 /* Nonzero if this type is const-qualified.  */
1234 #define CP_TYPE_CONST_P(NODE)                           \
1235   ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_CONST) != 0)
1236
1237 /* Nonzero if this type is volatile-qualified.  */
1238 #define CP_TYPE_VOLATILE_P(NODE)                        \
1239   ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_VOLATILE) != 0)
1240
1241 /* Nonzero if this type is restrict-qualified.  */
1242 #define CP_TYPE_RESTRICT_P(NODE)                        \
1243   ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_RESTRICT) != 0)
1244
1245 /* Nonzero if this type is const-qualified, but not
1246    volatile-qualified.  Other qualifiers are ignored.  This macro is
1247    used to test whether or not it is OK to bind an rvalue to a
1248    reference.  */
1249 #define CP_TYPE_CONST_NON_VOLATILE_P(NODE)                              \
1250   ((CP_TYPE_QUALS (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE))      \
1251    == TYPE_QUAL_CONST)
1252
1253 #define DELTA_FROM_VTABLE_ENTRY(ENTRY) \
1254   (!flag_vtable_thunks ? \
1255      TREE_VALUE (CONSTRUCTOR_ELTS (ENTRY)) \
1256    : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? integer_zero_node \
1257    : build_int_2 (THUNK_DELTA (TREE_OPERAND ((ENTRY), 0)), 0))
1258
1259 /* Virtual function addresses can be gotten from a virtual function
1260    table entry using this macro.  */
1261 #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \
1262   (!flag_vtable_thunks ? \
1263      TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) \
1264    : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? (ENTRY) \
1265    : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)))
1266 #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \
1267   (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE))
1268 #define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
1269 #define PROMOTES_TO_AGGR_TYPE(NODE,CODE)        \
1270   (((CODE) == TREE_CODE (NODE)                  \
1271        && IS_AGGR_TYPE (TREE_TYPE (NODE)))      \
1272    || IS_AGGR_TYPE (NODE))
1273
1274 /* Nonzero iff TYPE is uniquely derived from PARENT.  Under MI, PARENT can
1275    be an ambiguous base class of TYPE, and this macro will be false.  */
1276 #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0)
1277 #define ACCESSIBLY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, -1, (tree *)0) >= 0)
1278 #define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 1, (tree *)0) >= 0)
1279 #define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) != -1)
1280 \f
1281 /* This structure provides additional information above and beyond
1282    what is provide in the ordinary tree_type.  In the past, we used it
1283    for the types of class types, template parameters types, typename
1284    types, and so forth.  However, there can be many (tens to hundreds
1285    of thousands) of template parameter types in a compilation, and
1286    there's no need for this additional information in that case.
1287    Therefore, we now use this data structure only for class types.
1288
1289    In the past, it was thought that there would be relatively few
1290    class types.  However, in the presence of heavy use of templates,
1291    many (i.e., thousands) of classes can easily be generated.
1292    Therefore, we should endeavor to keep the size of this structure to
1293    a minimum.  */
1294 struct lang_type
1295 {
1296   unsigned char align;
1297
1298   unsigned has_type_conversion : 1;
1299   unsigned has_init_ref : 1;
1300   unsigned has_default_ctor : 1;
1301   unsigned uses_multiple_inheritance : 1;
1302   unsigned const_needs_init : 1;
1303   unsigned ref_needs_init : 1;
1304   unsigned has_const_assign_ref : 1;
1305   unsigned anon_aggr : 1;
1306
1307   unsigned has_nonpublic_ctor : 2;
1308   unsigned has_nonpublic_assign_ref : 2;
1309   unsigned vtable_needs_writing : 1;
1310   unsigned has_assign_ref : 1;
1311   unsigned gets_new : 2;
1312
1313   unsigned gets_delete : 2;
1314   unsigned has_call_overloaded : 1;
1315   unsigned has_array_ref_overloaded : 1;
1316   unsigned has_arrow_overloaded : 1;
1317   unsigned interface_only : 1;
1318   unsigned interface_unknown : 1;
1319   unsigned needs_virtual_reinit : 1;
1320
1321   unsigned marks: 6;
1322   unsigned vec_delete_takes_size : 1;
1323   unsigned declared_class : 1;
1324
1325   unsigned being_defined : 1;
1326   unsigned redefined : 1;
1327   unsigned debug_requested : 1;
1328   unsigned use_template : 2;
1329   unsigned got_semicolon : 1;
1330   unsigned ptrmemfunc_flag : 1;
1331   unsigned was_anonymous : 1;
1332
1333   unsigned has_real_assign_ref : 1;
1334   unsigned has_const_init_ref : 1;
1335   unsigned has_complex_init_ref : 1;
1336   unsigned has_complex_assign_ref : 1;
1337   unsigned has_abstract_assign_ref : 1;
1338   unsigned non_aggregate : 1;
1339   unsigned is_partial_instantiation : 1;
1340   unsigned has_mutable : 1;
1341
1342   unsigned com_interface : 1;
1343   unsigned non_pod_class : 1;
1344   unsigned nearly_empty_p : 1;
1345
1346   /* When adding a flag here, consider whether or not it ought to
1347      apply to a template instance if it applies to the template.  If
1348      so, make sure to copy it in instantiate_class_template!  */
1349
1350   /* There are six bits left to fill out a 32-bit word.  Keep track of
1351      this by updating the size of this bitfield whenever you add or
1352      remove a flag.  */
1353   unsigned dummy : 5;
1354       
1355   int vsize;
1356   int vfield_parent;
1357
1358   union tree_node *vfields;
1359   union tree_node *vbases;
1360
1361   union tree_node *tags;
1362
1363   union tree_node *search_slot;
1364
1365   union tree_node *size;
1366   union tree_node *size_unit;
1367
1368   union tree_node *pure_virtuals;
1369   union tree_node *friend_classes;
1370
1371   union tree_node *rtti;
1372
1373   union tree_node *methods;
1374
1375   union tree_node *template_info;
1376   tree befriending_classes;
1377 };
1378
1379 /* Indicates whether or not (and how) a template was expanded for this class.
1380      0=no information yet/non-template class
1381      1=implicit template instantiation
1382      2=explicit template specialization
1383      3=explicit template instantiation  */
1384 #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->use_template)
1385
1386 /* Fields used for storing information before the class is defined.
1387    After the class is defined, these fields hold other information.  */
1388
1389 /* List of friends which were defined inline in this class definition.  */
1390 #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
1391
1392 /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
1393    respectively.  */
1394 #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_new)
1395 #define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_delete)
1396 #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
1397
1398 /* Nonzero for _CLASSTYPE means that operator vec delete is defined and
1399    takes the optional size_t argument.  */
1400 #define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
1401   (TYPE_LANG_SPECIFIC(NODE)->vec_delete_takes_size)
1402 #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
1403   (TYPE_NEEDS_DESTRUCTOR (NODE) \
1404    || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
1405
1406 /* Nonzero means that this _CLASSTYPE node defines ways of converting
1407    itself to other types.  */
1408 #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_type_conversion)
1409
1410 /* Nonzero means that this _CLASSTYPE node overloads operator=(X&).  */
1411 #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_assign_ref)
1412 #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_assign_ref)
1413
1414 /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor.  */
1415 #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_init_ref)
1416 #define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_init_ref)
1417
1418 /* Nonzero means that this type is being defined.  I.e., the left brace
1419    starting the definition of this type has been seen.  */
1420 #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->being_defined)
1421 /* Nonzero means that this type has been redefined.  In this case, if
1422    convenient, don't reprocess any methods that appear in its redefinition.  */
1423 #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->redefined)
1424
1425 /* The is the basetype that contains NODE's rtti.  */
1426 #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
1427
1428 /* Nonzero means that this _CLASSTYPE node overloads operator().  */
1429 #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_call_overloaded)
1430
1431 /* Nonzero means that this _CLASSTYPE node overloads operator[].  */
1432 #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_array_ref_overloaded)
1433
1434 /* Nonzero means that this _CLASSTYPE node overloads operator->.  */
1435 #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_arrow_overloaded)
1436
1437 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
1438    multiple inheritance.  If this is 0 for the root of a type
1439    hierarchy, then we can use more efficient search techniques.  */
1440 #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->uses_multiple_inheritance)
1441
1442 /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
1443    virtual base classes.  If this is 0 for the root of a type
1444    hierarchy, then we can use more efficient search techniques.  */
1445 #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
1446
1447 /* Vector member functions defined in this class.  Each element is
1448    either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD.  All
1449    functions with the same name end up in the same slot.  The first
1450    two elements are for constructors, and destructors, respectively.
1451    These are followed by ordinary member functions.  There may be
1452    empty entries at the end of the vector.  */
1453 #define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods)
1454
1455 /* The first type conversion operator in the class (the others can be
1456    searched with TREE_CHAIN), or the first non-constructor function if
1457    there are no type conversion operators.  */
1458 #define CLASSTYPE_FIRST_CONVERSION(NODE) \
1459   TREE_VEC_LENGTH (CLASSTYPE_METHOD_VEC (NODE)) > 2 \
1460     ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
1461     : NULL_TREE;
1462
1463 /* Mark bits for depth-first and breath-first searches.  */
1464
1465 /* Get the value of the Nth mark bit.  */
1466 #define CLASSTYPE_MARKED_N(NODE, N)                             \
1467   (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks     \
1468      : ((unsigned) TYPE_ALIAS_SET (NODE))) & (1 << N)) != 0)
1469
1470 /* Set the Nth mark bit.  */
1471 #define SET_CLASSTYPE_MARKED_N(NODE, N)                         \
1472   (CLASS_TYPE_P (NODE)                                          \
1473    ? (void) (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N)))    \
1474    : (void) (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
1475
1476 /* Clear the Nth mark bit.  */
1477 #define CLEAR_CLASSTYPE_MARKED_N(NODE, N)                       \
1478   (CLASS_TYPE_P (NODE)                                          \
1479    ? (void) (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N)))   \
1480    : (void) (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
1481
1482 /* Get the value of the mark bits.  */
1483 #define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N(NODE, 0)
1484 #define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N(NODE, 1)
1485 #define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N(NODE, 2)
1486 #define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N(NODE, 3)
1487 #define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N(NODE, 4)
1488 #define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N(NODE, 5)
1489
1490 /* Macros to modify the above flags */
1491 #define SET_CLASSTYPE_MARKED(NODE)    SET_CLASSTYPE_MARKED_N(NODE, 0)
1492 #define CLEAR_CLASSTYPE_MARKED(NODE)  CLEAR_CLASSTYPE_MARKED_N(NODE, 0)
1493 #define SET_CLASSTYPE_MARKED2(NODE)   SET_CLASSTYPE_MARKED_N(NODE, 1)
1494 #define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 1)
1495 #define SET_CLASSTYPE_MARKED3(NODE)   SET_CLASSTYPE_MARKED_N(NODE, 2)
1496 #define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 2) 
1497 #define SET_CLASSTYPE_MARKED4(NODE)   SET_CLASSTYPE_MARKED_N(NODE, 3)
1498 #define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 3)
1499 #define SET_CLASSTYPE_MARKED5(NODE)   SET_CLASSTYPE_MARKED_N(NODE, 4)
1500 #define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 4)
1501 #define SET_CLASSTYPE_MARKED6(NODE)   SET_CLASSTYPE_MARKED_N(NODE, 5)
1502 #define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 5)
1503
1504 /* A list of the nested tag-types (class, struct, union, or enum)
1505    found within this class.  The TREE_PURPOSE of each node is the name
1506    of the type; the TREE_VALUE is the type itself.  This list includes
1507    nested member class templates.  */
1508 #define CLASSTYPE_TAGS(NODE)            (TYPE_LANG_SPECIFIC(NODE)->tags)
1509
1510 /* If this value is non-negative, it is the index (in the
1511    TYPE_BINFO_BASETYPES) for the base-class whose vtable pointer we
1512    are reusing.  For example, in D : B1, B2, PARENT would be 0, if D's
1513    vtable came from B1, 1, if D's vtable came from B2.  */
1514 #define CLASSTYPE_VFIELD_PARENT(NODE)   (TYPE_LANG_SPECIFIC(NODE)->vfield_parent)
1515
1516 /* Nonzero if NODE has a primary base class, i.e., a base class with
1517    which it shares the virtual fucntion table pointer.  */
1518 #define CLASSTYPE_HAS_PRIMARY_BASE_P(NODE) \
1519   (CLASSTYPE_VFIELD_PARENT (NODE) != -1)
1520
1521 /* If non-NULL, this is the binfo for the primary base class, i.e.,
1522    the base class which contains the virtual function table pointer
1523    for this class.  */
1524 #define CLASSTYPE_PRIMARY_BINFO(NODE) \
1525   (BINFO_PRIMARY_BINFO (TYPE_BINFO (NODE)))
1526
1527 /* If non-NULL, this is the binfo for the primary base of BINFO.  */
1528 #define BINFO_PRIMARY_BINFO(NODE)                                       \
1529   (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (NODE))                     \
1530    ? BINFO_BASETYPE (NODE,                                              \
1531                      CLASSTYPE_VFIELD_PARENT (BINFO_TYPE (NODE)))       \
1532    : NULL_TREE)
1533
1534 /* The number of virtual functions defined for this
1535    _CLASSTYPE node.  */
1536 #define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize)
1537
1538 /* A chain of BINFOs for the direct and indirect virtual base classes
1539    that this type uses in depth-first left-to-right order.  These
1540    BINFOs are distinct from those in the TYPE_BINFO hierarchy.  So,
1541    given: 
1542
1543      struct A {};
1544      struct B : public A {};
1545      struct C : virtual public B {};
1546      struct D : virtual public B {};
1547      struct E : public C, public D {};
1548
1549    there will be two copies of `A' and `B' in the TYPE_BINFO hierarchy
1550    for `E'.  On the CLASSTYPE_VBASECLASSES list, there will be just
1551    one copy of `A' (distinct from the other two) with its own copy of `B'
1552    (also distinct from the copies in the TYPE_BINFO hierarchy.)  */
1553 #define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases)
1554
1555 /* The BINFO (if any) for the virtual baseclass T of the class C.  */
1556 #define BINFO_FOR_VBASE(T, C) \
1557   (binfo_member (T, CLASSTYPE_VBASECLASSES (C)))
1558
1559 /* Number of direct baseclasses of NODE.  */
1560 #define CLASSTYPE_N_BASECLASSES(NODE) \
1561   (BINFO_N_BASETYPES (TYPE_BINFO (NODE)))
1562
1563 /* Used for keeping search-specific information.  Any search routine
1564    which uses this must define what exactly this slot is used for.  */
1565 #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
1566
1567 /* These are the size, mode and alignment of the type without its
1568    virtual base classes, for when we use this type as a base itself.  */
1569 #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
1570 #define CLASSTYPE_SIZE_UNIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->size_unit)
1571 #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
1572
1573 /* A cons list of virtual functions which cannot be inherited by
1574    derived classes.  When deriving from this type, the derived
1575    class must provide its own definition for each of these functions.  */
1576 #define CLASSTYPE_PURE_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->pure_virtuals)
1577
1578 /* Nonzero means that this aggr type has been `closed' by a semicolon.  */
1579 #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->got_semicolon)
1580
1581 /* Nonzero means that the main virtual function table pointer needs to be
1582    set because base constructors have placed the wrong value there.
1583    If this is zero, it means that they placed the right value there,
1584    and there is no need to change it.  */
1585 #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->needs_virtual_reinit)
1586
1587 /* Nonzero means that if this type has virtual functions, that
1588    the virtual function table will be written out.  */
1589 #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtable_needs_writing)
1590
1591 /* Nonzero means that this type has an X() constructor.  */
1592 #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_default_ctor)
1593
1594 /* Nonzero means the type declared a ctor as private or protected.  We
1595    use this to make sure we don't try to generate a copy ctor for a 
1596    class that has a member of type NODE.  */
1597 #define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_ctor)
1598
1599 /* Ditto, for operator=.  */
1600 #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_assign_ref)
1601
1602 /* Nonzero means that this type contains a mutable member */
1603 #define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_mutable)
1604 #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
1605
1606 /*  Nonzero means that this class type is a non-POD class.  */
1607 #define CLASSTYPE_NON_POD_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->non_pod_class)
1608
1609 /* Nonzero if this class is "nearly empty", i.e., contains only a
1610    virtual function table pointer.  */
1611 #define CLASSTYPE_NEARLY_EMPTY_P(NODE) \
1612   (TYPE_LANG_SPECIFIC (NODE)->nearly_empty_p)
1613
1614 /* Nonzero means that this type is meant for communication via COM.  */
1615 #define CLASSTYPE_COM_INTERFACE(NODE) \
1616   (TYPE_LANG_SPECIFIC(NODE)->com_interface)
1617
1618 /* A list of class types of which this type is a friend.  The
1619    TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
1620    case of a template friend.  */
1621 #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
1622
1623 /* A list of the classes which grant friendship to this class.  */
1624 #define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \
1625   (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
1626
1627 /* Say whether this node was declared as a "class" or a "struct".  */
1628 #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->declared_class)
1629
1630 /* Nonzero if this class has const members which have no specified initialization.  */
1631 #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->const_needs_init)
1632
1633 /* Nonzero if this class has ref members which have no specified initialization.  */
1634 #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->ref_needs_init)
1635
1636 /* Nonzero if this class is included from a header file which employs
1637    `#pragma interface', and it is not included in its implementation file.  */
1638 #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_only)
1639
1640 /* Same as above, but for classes whose purpose we do not know.  */
1641 #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown)
1642 #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown == 0)
1643 #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = !!(X))
1644 #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 1)
1645 #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 0)
1646
1647 /* Nonzero if a _DECL node requires us to output debug info for this class.  */
1648 #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->debug_requested)
1649 \f
1650 /* Additional macros for inheritance information.  */
1651
1652 /* The BINFO_INHERITANCE_CHAIN is used opposite to the description in
1653    gcc/tree.h.  In particular if D is derived from B then the BINFO
1654    for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
1655    D.  In tree.h, this pointer is described as pointing in other
1656    direction.  There is a different BINFO for each path to a virtual
1657    base; BINFOs for virtual bases are not shared.  In addition, shared
1658    versions of each of the virtual class BINFOs are stored in
1659    CLASSTYPE_VBASECLASSES.
1660
1661    We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private
1662    inheritance is indicated by the absence of the other two flags, not
1663    by TREE_VIA_PRIVATE, which is unused.
1664
1665    The TREE_CHAIN is for scratch space in search.c.  */
1666
1667 /* Nonzero means marked by DFS or BFS search, including searches
1668    by `get_binfo' and `get_base_distance'.  */
1669 #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE))
1670 /* Macros needed because of C compilers that don't allow conditional
1671    expressions to be lvalues.  Grr!  */
1672 #define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1))
1673 #define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0))
1674
1675 /* Nonzero means marked in search through virtual inheritance hierarchy.  */
1676 #define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1677 /* Modifier macros */
1678 #define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1679 #define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
1680
1681 /* Nonzero means marked in search for members or member functions.  */
1682 #define BINFO_FIELDS_MARKED(NODE) \
1683   (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE))
1684 #define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1))
1685 #define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0))
1686
1687 /* Nonzero means that this class is on a path leading to a new vtable.  */
1688 #define BINFO_VTABLE_PATH_MARKED(NODE) \
1689   (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE))
1690 #define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1))
1691 #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0))
1692
1693 /* Nonzero means that this class has a new vtable.  */
1694 #define BINFO_NEW_VTABLE_MARKED(NODE) \
1695   (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE))
1696 #define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1))
1697 #define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0))
1698
1699 /* Nonzero means this class has done dfs_pushdecls.  */
1700 #define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
1701 #define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE)
1702 #define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE)
1703
1704 /* Nonzero if this BINFO is a primary base class.
1705
1706    In the TYPE_BINFO hierarchy, this flag is never set for a base
1707    class of a non-primary virtual base because the copies of a
1708    non-primary virtual base that appear in the TYPE_BINFO hierarchy do
1709    not really exist.  Instead, it is the BINFOs in the
1710    CLASSTYPE_VBASECLASSES list that are used.  In other words, this
1711    flag is only valid for paths (given by BINFO_INHERITANCE_CHAIN)
1712    that really exist in the final object.  
1713
1714    For example, consider:
1715
1716       struct A {};
1717       struct B : public A { };
1718       struct C : virtual public B { void f(); };
1719
1720    `A' is the primary base class for `B'.  But, `B' is not a primary
1721    base class for `C'.  So, in the copy of `A' that appears in the
1722    TYPE_BINFO hierarcy for `C' does not have BINFO_PRIMARY_MARKED_P
1723    set; the copy in the CLASSTYPE_VBASECLASSES list does have this
1724    set.  */
1725 #define BINFO_PRIMARY_MARKED_P(NODE) TREE_LANG_FLAG_5 (NODE)
1726
1727 /* Nonzero if the virtual baseclass with the type given by this BINFO
1728    is primary *somewhere* in the hierarchy.  This flag is only set on 
1729    entries in the CLASSTYPE_VBASECLASSES list.  */
1730 #define BINFO_VBASE_PRIMARY_P(NODE) TREE_LANG_FLAG_6 (NODE)
1731
1732 /* Used by various search routines.  */
1733 #define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
1734 \f
1735 /* Accessor macros for the vfield slots in structures.  */
1736
1737 /* The virtual function pointer fields that this type contains.  For a
1738    vfield defined just for this class, or from a primary base, the
1739    TREE_PURPOSE is NULL.  Otherwise, the TREE_PURPOSE is the BINFO for
1740    the class containing the vfield.  The TREE_VALUE is the class where
1741    the vfield was first defined.  */
1742 #define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields)
1743
1744 /* Get the assoc info that caused this vfield to exist.  */
1745 #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
1746
1747 /* Get that same information as a _TYPE.  */
1748 #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
1749
1750 /* Get the value of the top-most type dominating the non-`normal' vfields.  */
1751 #define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)
1752
1753 /* The number of bytes by which to adjust the `this' pointer when
1754    calling this virtual function.  */
1755 #define BV_DELTA(NODE) (TREE_PURPOSE (NODE))
1756
1757 /* If non-NULL, the vtable index at which to find the vcall offset
1758    when calling this virtual function.  */
1759 #define BV_VCALL_INDEX(NODE) (TREE_TYPE (NODE))
1760
1761 /* The function to call.  */
1762 #define BV_FN(NODE) (TREE_VALUE (NODE))
1763
1764 /* The most derived class.  */
1765
1766 \f
1767 /* Nonzero for TREE_LIST node means that this list of things
1768    is a list of parameters, as opposed to a list of expressions.  */
1769 #define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
1770
1771 /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
1772    this type can raise.  Each TREE_VALUE is a _TYPE.  The TREE_VALUE
1773    will be NULL_TREE to indicate a throw specification of `()', or
1774    no exceptions allowed.  */
1775 #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
1776
1777 /* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'.  */
1778 #define TYPE_NOTHROW_P(NODE) \
1779   (TYPE_RAISES_EXCEPTIONS (NODE) \
1780    && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE)
1781
1782 /* The binding level associated with the namespace.  */
1783 #define NAMESPACE_LEVEL(NODE) \
1784   (DECL_LANG_SPECIFIC(NODE)->decl_flags.u.level)
1785 \f
1786
1787 /* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
1788    a lang_decl (which has lang_decl_flags as its initial prefix).
1789    This macro is nonzero for tree nodes whose DECL_LANG_SPECIFIC is
1790    the full lang_decl, and not just lang_decl_flags.  */
1791 #define CAN_HAVE_FULL_LANG_DECL_P(NODE)         \
1792   (!(TREE_CODE ((NODE)) == VAR_DECL             \
1793      || TREE_CODE ((NODE)) == CONST_DECL        \
1794      || TREE_CODE ((NODE)) == FIELD_DECL        \
1795      || TREE_CODE ((NODE)) == USING_DECL))
1796
1797 struct lang_decl_flags
1798 {
1799 #ifdef ONLY_INT_FIELDS
1800   int language : 8;
1801 #else
1802   enum languages language : 8;
1803 #endif
1804
1805   unsigned operator_attr : 1;
1806   unsigned constructor_attr : 1;
1807   unsigned friend_attr : 1;
1808   unsigned static_function : 1;
1809   unsigned const_memfunc : 1;
1810   unsigned volatile_memfunc : 1;
1811   unsigned pure_virtual : 1;
1812   unsigned constructor_for_vbase_attr : 1;
1813
1814   unsigned mutable_flag : 1;
1815   unsigned saved_inline : 1;
1816   unsigned use_template : 2;
1817   unsigned nonconverting : 1;
1818   unsigned declared_inline : 1;
1819   unsigned not_really_extern : 1;
1820   unsigned needs_final_overrider : 1;
1821
1822   unsigned bitfield : 1;
1823   unsigned defined_in_class : 1;
1824   unsigned pending_inline_p : 1;
1825   unsigned global_ctor_p : 1;
1826   unsigned global_dtor_p : 1;
1827   unsigned pretty_function_p : 1;
1828   unsigned dummy : 2;
1829
1830   tree context;
1831
1832   union {
1833     /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
1834        is DECL_TEMPLATE_INFO.  */
1835     tree template_info;
1836
1837     /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL.  */
1838     struct binding_level *level;
1839   } u;
1840
1841   union {
1842     /* This is DECL_ACCESS.  */
1843     tree access;
1844
1845     /* In a namespace-scope FUNCTION_DECL, this is
1846        GLOBAL_INIT_PRIORITY.  */
1847     int init_priority;
1848   } u2;
1849 };
1850
1851 struct lang_decl
1852 {
1853   struct lang_decl_flags decl_flags;
1854
1855   tree main_decl_variant;
1856   tree befriending_classes;
1857
1858   /* In a FUNCTION_DECL, this is DECL_SAVED_TREE.  */
1859   tree saved_tree;
1860
1861   union
1862   {
1863     tree sorted_fields;
1864     struct pending_inline *pending_inline_info;
1865     struct language_function *saved_language_function;
1866   } u;
1867 };
1868
1869 /* Non-zero if NODE is a _DECL with TREE_READONLY set.  */
1870 #define TREE_READONLY_DECL_P(NODE) \
1871   (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd')
1872
1873 /* Non-zero iff DECL is memory-based.  The DECL_RTL of
1874    certain const variables might be a CONST_INT, or a REG
1875    in some cases.  We cannot use `memory_operand' as a test
1876    here because on most RISC machines, a variable's address
1877    is not, by itself, a legitimate address.  */
1878 #define DECL_IN_MEMORY_P(NODE) \
1879   (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM)
1880
1881 /* For FUNCTION_DECLs: return the language in which this decl
1882    was declared.  */
1883 #define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)
1884
1885 /* For FUNCTION_DECLs: nonzero means that this function is a constructor.  */
1886 #define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
1887
1888 /* There ought to be a better way to find out whether or not something is
1889    a destructor.  */
1890 #define DECL_DESTRUCTOR_P(NODE)                         \
1891   (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE))       \
1892    && DECL_LANGUAGE (NODE) == lang_cplusplus)
1893
1894 /* Non-zero if NODE is a user-defined conversion operator.  */
1895 #define DECL_CONV_FN_P(NODE)                                                 \
1896   (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE)))
1897
1898 /* Non-zero if NODE is an overloaded operator.  */
1899 #define DECL_OVERLOADED_OPERATOR_P(NODE)        \
1900   (IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))))
1901
1902 /* For FUNCTION_DECLs: nonzero means that this function is a constructor
1903    for an object with virtual baseclasses.  */
1904 #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
1905
1906 /* Non-zero for a FUNCTION_DECL that declares a type-info function.
1907    This only happens in the old abi.  */
1908 #define DECL_TINFO_FN_P(NODE)                                   \
1909   (TREE_CODE (NODE) == FUNCTION_DECL                            \
1910    && DECL_ARTIFICIAL (NODE)                                    \
1911    && DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1912
1913 /* Mark NODE as a type-info function.  */
1914 #define SET_DECL_TINFO_FN_P(NODE) \
1915   (DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1)
1916
1917 /* Nonzero for _DECL means that this decl appears in (or will appear
1918    in) as a member in a RECORD_TYPE or UNION_TYPE node.  It is also for
1919    detecting circularity in case members are multiply defined.  In the
1920    case of a VAR_DECL, it is also used to determine how program storage
1921    should be allocated.  */
1922 #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE))
1923
1924 /* Nonzero if the DECL was defined in the class definition itself,
1925    rather than outside the class.  */
1926 #define DECL_DEFINED_IN_CLASS_P(DECL) \
1927  (DECL_LANG_SPECIFIC (DECL)->decl_flags.defined_in_class)
1928
1929 /* Nonzero for FUNCTION_DECL means that this decl is just a
1930    friend declaration, and should not be added to the list of
1931    member functions for this class.  */
1932 #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr)
1933
1934 /* A TREE_LIST of the types which have befriended this FUNCTION_DECL.  */
1935 #define DECL_BEFRIENDING_CLASSES(NODE) \
1936   (DECL_LANG_SPECIFIC(NODE)->befriending_classes)
1937
1938 /* Nonzero for FUNCTION_DECL means that this decl is a static
1939    member function.  */
1940 #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function)
1941
1942 /* Nonzero for a class member means that it is shared between all objects
1943    of that class.  */
1944 #define SHARED_MEMBER_P(NODE) \
1945   (TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \
1946    || TREE_CODE (NODE) == CONST_DECL)
1947                                 
1948 /* Nonzero for FUNCTION_DECL means that this decl is a non-static
1949    member function.  */
1950 #define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
1951   (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
1952
1953 /* Nonzero for FUNCTION_DECL means that this decl is a member function
1954    (static or non-static).  */
1955 #define DECL_FUNCTION_MEMBER_P(NODE) \
1956  (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
1957
1958 /* Nonzero for FUNCTION_DECL means that this member function
1959    has `this' as const X *const.  */
1960 #define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc)
1961
1962 /* Nonzero for FUNCTION_DECL means that this member function
1963    has `this' as volatile X *const.  */
1964 #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc)
1965
1966 /* Nonzero for a DECL means that this member is a non-static member.  */
1967 #define DECL_NONSTATIC_MEMBER_P(NODE)           \
1968   ((TREE_CODE (NODE) == FUNCTION_DECL           \
1969     && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \
1970    || TREE_CODE (NODE) == FIELD_DECL)
1971
1972 /* Nonzero for _DECL means that this member object type
1973    is mutable.  */
1974 #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
1975
1976 /* Nonzero for _DECL means that this constructor is a non-converting
1977    constructor.  */
1978 #define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting)
1979
1980 /* Nonzero for FUNCTION_DECL means that this member function is a pure
1981    virtual function.  */
1982 #define DECL_PURE_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.pure_virtual)
1983
1984 /* Nonzero for FUNCTION_DECL means that this member function
1985    must be overridden by derived classes.  */
1986 #define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.needs_final_overrider)
1987
1988 /* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a
1989    template function.  */
1990 #define DECL_PRETTY_FUNCTION_P(NODE) \
1991   (DECL_LANG_SPECIFIC(NODE)->decl_flags.pretty_function_p)
1992
1993 /* The _TYPE context in which this _DECL appears.  This field holds the
1994    class where a virtual function instance is actually defined. */
1995 #define DECL_CLASS_CONTEXT(NODE) \
1996   (DECL_CLASS_SCOPE_P (NODE) ? DECL_CONTEXT (NODE) : NULL_TREE)
1997
1998 /* For a non-member friend function, the class (if any) in which this
1999    friend was defined.  For example, given:
2000    
2001      struct S { friend void f (); };
2002
2003    the DECL_FRIEND_CONTEXT for `f' will be `S'.  */
2004 #define DECL_FRIEND_CONTEXT(NODE)                               \
2005   ((DECL_FRIEND_P (NODE) && !DECL_FUNCTION_MEMBER_P (NODE))     \
2006    ? DECL_LANG_SPECIFIC (NODE)->decl_flags.context              \
2007    : NULL_TREE)
2008
2009 /* Set the DECL_FRIEND_CONTEXT for NODE to CONTEXT.  */
2010 #define SET_DECL_FRIEND_CONTEXT(NODE, CONTEXT) \
2011   (DECL_LANG_SPECIFIC (NODE)->decl_flags.context = (CONTEXT))
2012
2013 /* NULL_TREE in DECL_CONTEXT represents the global namespace. */
2014 #define CP_DECL_CONTEXT(NODE) \
2015   (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
2016 #define FROB_CONTEXT(NODE)   ((NODE) == global_namespace ? NULL_TREE : (NODE))
2017
2018 /* For a virtual function, the base where we find its vtable entry.
2019    For a non-virtual function, the base where it is defined.  */
2020 #define DECL_VIRTUAL_CONTEXT(NODE) \
2021   (DECL_LANG_SPECIFIC (NODE)->decl_flags.context)
2022
2023 /* 1 iff NODE has namespace scope, including the global namespace.  */
2024 #define DECL_NAMESPACE_SCOPE_P(NODE)                            \
2025   (!DECL_TEMPLATE_PARM_P (NODE)                                 \
2026    && TREE_CODE (CP_DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
2027
2028 /* 1 iff NODE is a class member.  */
2029 #define DECL_CLASS_SCOPE_P(NODE) \
2030   (DECL_CONTEXT (NODE) && TYPE_P (DECL_CONTEXT (NODE)))
2031
2032 /* 1 iff NODE is function-local.  */
2033 #define DECL_FUNCTION_SCOPE_P(NODE) \
2034   (DECL_CONTEXT (NODE) \
2035    && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
2036      
2037 /* For a NAMESPACE_DECL: the list of using namespace directives
2038    The PURPOSE is the used namespace, the value is the namespace
2039    that is the common ancestor. */
2040 #define DECL_NAMESPACE_USING(NODE) DECL_VINDEX (NAMESPACE_DECL_CHECK (NODE))
2041
2042 /* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
2043    of a namespace, to record the transitive closure of using namespace. */
2044 #define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NAMESPACE_DECL_CHECK (NODE))
2045
2046 /* In a NAMESPACE_DECL, points to the original namespace if this is
2047    a namespace alias.  */
2048 #define DECL_NAMESPACE_ALIAS(NODE) \
2049         DECL_ABSTRACT_ORIGIN (NAMESPACE_DECL_CHECK (NODE))
2050 #define ORIGINAL_NAMESPACE(NODE)  \
2051   (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
2052
2053 /* In a non-local VAR_DECL with static storage duration, this is the
2054    initialization priority.  If this value is zero, the NODE will be
2055    initialized at the DEFAULT_INIT_PRIORITY.  */
2056 #define DECL_INIT_PRIORITY(NODE) (DECL_FIELD_SIZE (VAR_DECL_CHECK (NODE)))
2057
2058 /* In a TREE_LIST concatenating using directives, indicate indirekt
2059    directives  */
2060 #define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0)
2061
2062 /* In a VAR_DECL for a variable declared in a for statement,
2063    this is the shadowed (local) variable.  */
2064 #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(VAR_DECL_CHECK (NODE))
2065
2066 /* Points back to the decl which caused this lang_decl to be allocated.  */
2067 #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant)
2068
2069 /* In a FUNCTION_DECL, this is nonzero if this function was defined in
2070    the class definition.  We have saved away the text of the function,
2071    but have not yet processed it.  */
2072 #define DECL_PENDING_INLINE_P(NODE) \
2073   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->decl_flags.pending_inline_p)
2074    
2075 /* If DECL_PENDING_INLINE_P holds, this is the saved text of the
2076    function.  */
2077 #define DECL_PENDING_INLINE_INFO(NODE) \
2078   (DECL_LANG_SPECIFIC(NODE)->u.pending_inline_info)
2079
2080 /* For a TYPE_DECL: if this function has many fields, we'll sort them
2081    and put them into a TREE_VEC. */
2082 #define DECL_SORTED_FIELDS(NODE) \
2083         (DECL_LANG_SPECIFIC (TYPE_DECL_CHECK (NODE))->u.sorted_fields)
2084
2085 /* True if on the saved_inlines (see decl2.c) list.  */
2086 #define DECL_SAVED_INLINE(DECL) \
2087   (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline)
2088
2089 /* For a VAR_DECL, FUNCTION_DECL, TYPE_DECL or TEMPLATE_DECL:
2090    template-specific information.  */
2091 #define DECL_TEMPLATE_INFO(NODE) \
2092   (DECL_LANG_SPECIFIC(VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK (NODE))->decl_flags.u.template_info)
2093
2094 /* Template information for a RECORD_TYPE or UNION_TYPE.  */
2095 #define CLASSTYPE_TEMPLATE_INFO(NODE) \
2096   (TYPE_LANG_SPECIFIC(RECORD_OR_UNION_TYPE_CHECK (NODE))->template_info)
2097
2098 /* Template information for an ENUMERAL_TYPE.  Although an enumeration may
2099    not be a primary template, it may be declared within the scope of a
2100    primary template and the enumeration constants may depend on
2101    non-type template parameters.  */
2102 #define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE)))
2103
2104 /* Template information for a template template parameter.  */
2105 #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE))
2106
2107 /* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
2108 #define TYPE_TEMPLATE_INFO(NODE)                        \
2109   (TREE_CODE (NODE) == ENUMERAL_TYPE                    \
2110    ? ENUM_TEMPLATE_INFO (NODE) :                        \
2111    (TREE_CODE (NODE) == TEMPLATE_TEMPLATE_PARM          \
2112     ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE)       \
2113     : CLASSTYPE_TEMPLATE_INFO (NODE)))
2114
2115 /* Set the template information for an ENUMERAL_, RECORD_, or
2116    UNION_TYPE to VAL.  */
2117 #define SET_TYPE_TEMPLATE_INFO(NODE, VAL)       \
2118   (TREE_CODE (NODE) == ENUMERAL_TYPE            \
2119    ? (ENUM_TEMPLATE_INFO (NODE) = VAL)          \
2120    : (CLASSTYPE_TEMPLATE_INFO (NODE) = VAL))
2121
2122 #define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
2123 #define TI_ARGS(NODE) (TREE_VALUE (NODE))
2124 #define TI_SPEC_INFO(NODE) (TREE_CHAIN (NODE))
2125 #define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
2126
2127 /* We use TREE_VECs to hold template arguments.  If there is only one
2128    level of template arguments, then the TREE_VEC contains the
2129    arguments directly.  If there is more than one level of template
2130    arguments, then each entry in the TREE_VEC is itself a TREE_VEC,
2131    containing the template arguments for a single level.  The first
2132    entry in the outer TREE_VEC is the outermost level of template
2133    parameters; the last is the innermost.  
2134
2135    It is incorrect to ever form a template argument vector containing
2136    only one level of arguments, but which is a TREE_VEC containing as
2137    its only entry the TREE_VEC for that level.  */
2138
2139 /* Non-zero if the template arguments is actually a vector of vectors,
2140    rather than just a vector.  */
2141 #define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
2142   (NODE != NULL_TREE                                            \
2143    && TREE_CODE (NODE) == TREE_VEC                              \
2144    && TREE_VEC_LENGTH (NODE) > 0                                \
2145    && TREE_VEC_ELT (NODE, 0) != NULL_TREE                       \
2146    && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC)
2147
2148 /* The depth of a template argument vector.  When called directly by
2149    the parser, we use a TREE_LIST rather than a TREE_VEC to represent
2150    template arguments.  In fact, we may even see NULL_TREE if there
2151    are no template arguments.  In both of those cases, there is only
2152    one level of template arguments.  */
2153 #define TMPL_ARGS_DEPTH(NODE)                                   \
2154   (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (NODE) ? TREE_VEC_LENGTH (NODE) : 1)
2155
2156 /* The LEVELth level of the template ARGS.  Note that template
2157    parameter levels are indexed from 1, not from 0.  */
2158 #define TMPL_ARGS_LEVEL(ARGS, LEVEL)            \
2159   (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS)        \
2160    ? TREE_VEC_ELT ((ARGS), (LEVEL) - 1) : ARGS)
2161
2162 /* Set the LEVELth level of the template ARGS to VAL.  This macro does
2163    not work with single-level argument vectors.  */
2164 #define SET_TMPL_ARGS_LEVEL(ARGS, LEVEL, VAL)   \
2165   (TREE_VEC_ELT ((ARGS), (LEVEL) - 1) = (VAL))
2166
2167 /* Accesses the IDXth parameter in the LEVELth level of the ARGS.  */
2168 #define TMPL_ARG(ARGS, LEVEL, IDX)                              \
2169   (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX))
2170
2171 /* Set the IDXth element in the LEVELth level of ARGS to VAL.  This
2172    macro does not work with single-level argument vectors.  */
2173 #define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL)                     \
2174   (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL))
2175
2176 /* Given a single level of template arguments in NODE, return the
2177    number of arguments.  */
2178 #define NUM_TMPL_ARGS(NODE)                             \
2179   ((NODE) == NULL_TREE ? 0                              \
2180    : (TREE_CODE (NODE) == TREE_VEC                      \
2181       ? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
2182
2183 /* The number of levels of template parameters given by NODE.  */
2184 #define TMPL_PARMS_DEPTH(NODE) \
2185   (TREE_INT_CST_HIGH (TREE_PURPOSE (NODE)))
2186
2187 /* The TEMPLATE_DECL instantiated or specialized by NODE.  This
2188    TEMPLATE_DECL will be the immediate parent, not the most general
2189    template.  For example, in:
2190
2191       template <class T> struct S { template <class U> void f(U); }
2192
2193    the FUNCTION_DECL for S<int>::f<double> will have, as its
2194    DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'. 
2195
2196    As a special case, for a member friend template of a template
2197    class, this value will not be a TEMPLATE_DECL, but rather a
2198    LOOKUP_EXPR or IDENTIFIER_NODE indicating the name of the template
2199    and any explicit template arguments provided.  For example, in:
2200
2201      template <class T> struct S { friend void f<int>(int, double); }
2202
2203    the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
2204    DECL_TI_ARGS will be {int}.  */ 
2205 #define DECL_TI_TEMPLATE(NODE)      TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
2206
2207 /* The template arguments used to obtain this decl from the most
2208    general form of DECL_TI_TEMPLATE.  For the example given for
2209    DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}.  These
2210    are always the full set of arguments required to instantiate this
2211    declaration from the most general template specialized here.  */
2212 #define DECL_TI_ARGS(NODE)          TI_ARGS (DECL_TEMPLATE_INFO (NODE))
2213 #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
2214 #define CLASSTYPE_TI_ARGS(NODE)     TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
2215 #define CLASSTYPE_TI_SPEC_INFO(NODE) TI_SPEC_INFO (CLASSTYPE_TEMPLATE_INFO (NODE))
2216 #define ENUM_TI_TEMPLATE(NODE)                  \
2217   TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
2218 #define ENUM_TI_ARGS(NODE)                      \
2219   TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
2220
2221 /* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
2222 #define TYPE_TI_TEMPLATE(NODE)                  \
2223   (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE)))
2224
2225 /* Like DECL_TI_ARGS, but for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
2226 #define TYPE_TI_ARGS(NODE)                      \
2227   (TI_ARGS (TYPE_TEMPLATE_INFO (NODE)))
2228
2229 #define INNERMOST_TEMPLATE_PARMS(NODE)  TREE_VALUE(NODE)
2230
2231 /* Nonzero if the NODE corresponds to the template parameters for a
2232    member template, whose inline definition is being processed after
2233    the class definition is complete.  */
2234 #define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
2235
2236 /* In a FUNCTION_DECL, the saved representation of the body of the
2237    entire function.  Usually a COMPOUND_STMT, but this may also be a
2238    RETURN_INIT, CTOR_INITIALIZER, or TRY_BLOCK.  */
2239 #define DECL_SAVED_TREE(NODE) \
2240   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->saved_tree)
2241
2242 /* In a FUNCTION_DECL, the saved language-specific per-function data.  */
2243 #define DECL_SAVED_FUNCTION_DATA(NODE) \
2244   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->u.saved_language_function)
2245
2246 #define COMPOUND_STMT_NO_SCOPE(NODE)    TREE_LANG_FLAG_0 (NODE)
2247 #define NEW_EXPR_USE_GLOBAL(NODE)       TREE_LANG_FLAG_0 (NODE)
2248 #define DELETE_EXPR_USE_GLOBAL(NODE)    TREE_LANG_FLAG_0 (NODE)
2249 #define DELETE_EXPR_USE_VEC(NODE)       TREE_LANG_FLAG_1 (NODE)
2250 #define LOOKUP_EXPR_GLOBAL(NODE)        TREE_LANG_FLAG_0 (NODE)
2251
2252 /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
2253    constructor call, rather than an ordinary function call.  */
2254 #define AGGR_INIT_VIA_CTOR_P(NODE) \
2255   TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE))
2256
2257 /* Nonzero if this statement should be considered a full-expression.  */
2258 #define STMT_IS_FULL_EXPR_P(NODE) TREE_LANG_FLAG_1 ((NODE))
2259
2260 /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
2261    TEMPLATE_DECL.  This macro determines whether or not a given class
2262    type is really a template type, as opposed to an instantiation or
2263    specialization of one.  */
2264 #define CLASSTYPE_IS_TEMPLATE(NODE)  \
2265   (CLASSTYPE_TEMPLATE_INFO (NODE)    \
2266    && !CLASSTYPE_USE_TEMPLATE (NODE) \
2267    && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
2268
2269 /* The name used by the user to name the typename type.  Typically,
2270    this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the
2271    corresponding TYPE_DECL.  However, this may also be a
2272    TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'.  */
2273 #define TYPENAME_TYPE_FULLNAME(NODE) TYPE_BINFO (NODE)
2274
2275 /* Nonzero if NODE is an implicit typename.  */
2276 #define IMPLICIT_TYPENAME_P(NODE) \
2277   (TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
2278
2279 /* Nonzero if NODE is a TYPE_DECL that should not be visible because
2280    it is from a dependent base class.  */
2281 #define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE)     \
2282   (TREE_CODE (NODE) == TYPE_DECL                \
2283    && DECL_ARTIFICIAL (NODE)                    \
2284    && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
2285
2286 /* Nonzero in INTEGER_CST means that this int is negative by dint of
2287    using a twos-complement negated operand.  */
2288 #define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE))
2289
2290 /* Nonzero in any kind of _TYPE where conversions to base-classes may
2291    involve pointer arithmetic.  If this is zero, then converting to
2292    a base-class never requires changing the value of the pointer.  */
2293 #define TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P(NODE) (TREE_LANG_FLAG_1 (NODE))
2294
2295 /* [class.virtual]
2296
2297    A class that declares or inherits a virtual function is called a
2298    polymorphic class.  */
2299 #define TYPE_POLYMORPHIC_P(NODE) (TREE_LANG_FLAG_2 (NODE))
2300
2301 /* Nonzero if this class has a virtual function table pointer.  */
2302 #define TYPE_CONTAINS_VPTR_P(NODE)              \
2303   (TYPE_POLYMORPHIC_P (NODE)                    \
2304    || (vbase_offsets_in_vtable_p ()             \
2305        && TYPE_USES_VIRTUAL_BASECLASSES (NODE)))
2306
2307 extern int flag_new_for_scope;
2308
2309 /* This flag is true of a local VAR_DECL if it was declared in a for
2310    statement, but we are no longer in the scope of the for.  */
2311 #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (VAR_DECL_CHECK (NODE))
2312
2313 /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL
2314    if we already emitted a warning about using it.  */
2315 #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE))
2316
2317 /* Nonzero if NODE is a FUNCTION_DECL (for a function with global
2318    scope) declared in a local scope.  */
2319 #define DECL_LOCAL_FUNCTION_P(NODE) \
2320   DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE))
2321
2322 /* This _DECL represents a compiler-generated entity.  */
2323 #define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
2324
2325 /* Record whether a typedef for type `int' was actually `signed int'.  */
2326 #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
2327
2328 /* In a FIELD_DECL, nonzero if the decl was originally a bitfield.  */
2329 #define DECL_C_BIT_FIELD(NODE) \
2330   (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))\
2331    && DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield)
2332 #define SET_DECL_C_BIT_FIELD(NODE) \
2333   (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->decl_flags.bitfield = 1)
2334
2335 /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
2336 #define DECL_UNINLINABLE(NODE) \
2337   (DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield)
2338
2339 #define INTEGRAL_CODE_P(CODE) \
2340   (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
2341
2342 /* [basic.fundamental]
2343
2344    Types  bool, char, wchar_t, and the signed and unsigned integer types
2345    are collectively called integral types.  
2346
2347    Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
2348    types as well, which is incorrect in C++.  */
2349 #define CP_INTEGRAL_TYPE_P(TYPE)                \
2350   (TREE_CODE ((TYPE)) == BOOLEAN_TYPE           \
2351    || TREE_CODE ((TYPE)) == INTEGER_TYPE)
2352
2353 /* [basic.fundamental]
2354
2355    Integral and floating types are collectively called arithmetic
2356    types.  */
2357 #define ARITHMETIC_TYPE_P(TYPE) \
2358   (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
2359
2360 /* Mark which labels are explicitly declared.
2361    These may be shadowed, and may be referenced from nested functions.  */
2362 #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
2363
2364 /* Nonzero for _TYPE means that the _TYPE defines
2365    at least one constructor.  */
2366 #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
2367
2368 /* When appearing in an INDIRECT_REF, it means that the tree structure
2369    underneath is actually a call to a constructor.  This is needed
2370    when the constructor must initialize local storage (which can
2371    be automatically destroyed), rather than allowing it to allocate
2372    space from the heap.
2373
2374    When appearing in a SAVE_EXPR, it means that underneath
2375    is a call to a constructor.
2376
2377    When appearing in a CONSTRUCTOR, it means that it was
2378    a GNU C constructor expression.
2379
2380    When appearing in a FIELD_DECL, it means that this field
2381    has been duly initialized in its constructor.  */
2382 #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE))
2383
2384 #define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR         \
2385                                    && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
2386                                    && ! TREE_HAS_CONSTRUCTOR (NODE))
2387
2388 #if 0
2389 /* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
2390    Used to generate more helpful error message in case somebody
2391    tries to take its address.  */
2392 #define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
2393 #endif
2394
2395 /* Nonzero for _TYPE means that the _TYPE defines a destructor.  */
2396 #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
2397
2398 /* Nonzero means that an object of this type can not be initialized using
2399    an initializer list.  */
2400 #define CLASSTYPE_NON_AGGREGATE(NODE) \
2401   (TYPE_LANG_SPECIFIC (NODE)->non_aggregate)
2402 #define TYPE_NON_AGGREGATE_CLASS(NODE) \
2403   (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
2404
2405 /* Nonzero if there is a user-defined X::op=(x&) for this class.  */
2406 #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_real_assign_ref)
2407 #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_assign_ref)
2408 #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_abstract_assign_ref)
2409 #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_init_ref)
2410
2411 /* Nonzero for _TYPE node means that destroying an object of this type
2412    will involve a call to a destructor.  This can apply to objects
2413    of ARRAY_TYPE is the type of the elements needs a destructor.  */
2414 #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE))
2415
2416 /* Nonzero for class type means that initialization of this type can use
2417    a bitwise copy.  */
2418 #define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
2419   (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
2420
2421 /* Nonzero for class type means that assignment of this type can use
2422    a bitwise copy.  */
2423 #define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
2424   (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
2425
2426 #define TYPE_PTRMEM_P(NODE)                                     \
2427   (TREE_CODE (NODE) == POINTER_TYPE                             \
2428    && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
2429 #define TYPE_PTR_P(NODE)                                \
2430   (TREE_CODE (NODE) == POINTER_TYPE                     \
2431    && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
2432 #define TYPE_PTROB_P(NODE)                                              \
2433   (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE   \
2434    && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
2435 #define TYPE_PTROBV_P(NODE)                                             \
2436   (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
2437 #define TYPE_PTRFN_P(NODE)                              \
2438   (TREE_CODE (NODE) == POINTER_TYPE                     \
2439    && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
2440
2441 /* Nonzero for _TYPE node means that this type is a pointer to member
2442    function type.  */
2443 #define TYPE_PTRMEMFUNC_P(NODE)         \
2444   (TREE_CODE(NODE) == RECORD_TYPE       \
2445    && TYPE_LANG_SPECIFIC(NODE)          \
2446    && TYPE_PTRMEMFUNC_FLAG (NODE))
2447
2448 #define TYPE_PTRMEMFUNC_FLAG(NODE) \
2449   (TYPE_LANG_SPECIFIC(NODE)->ptrmemfunc_flag)
2450
2451 /* A pointer-to-function member type looks like:
2452
2453    struct {
2454      short __delta;
2455      short __index;
2456      union {
2457        P __pfn;
2458        short __delta2;
2459      } __pfn_or_delta2;
2460    };
2461
2462    where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
2463    pointer to member.  The fields are used as follows:
2464
2465      If __INDEX is -1, then the function to call is non-virtual, and
2466      is located at the address given by __PFN.
2467
2468      If __INDEX is zero, then this a NULL pointer-to-member.
2469
2470      Otherwise, the function to call is virtual.  Then, __DELTA2 gives
2471      the offset from an instance of the object to the virtual function
2472      table, and __INDEX - 1 is the index into the vtable to use to
2473      find the function.
2474
2475      The value to use for the THIS parameter is the address of the
2476      object plus __DELTA.
2477
2478    For example, given:
2479
2480      struct B1 {
2481        int i;
2482      };
2483
2484      struct B2 {
2485        double d;
2486        void f();
2487      };
2488
2489      struct S : public B1, B2 {};
2490
2491    the pointer-to-member for `&S::f' looks like:
2492
2493      { 4, -1, { &f__2B2 } };
2494
2495    The `4' means that given an `S*' you have to add 4 bytes to get to
2496    the address of the `B2*'.  Then, the -1 indicates that this is a
2497    non-virtual function.  Of course, `&f__2B2' is the name of that
2498    function.
2499
2500    (Of course, the exact values may differ depending on the mangling
2501    scheme, sizes of types, and such.).  */
2502      
2503 /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
2504    pointer to member function.  TYPE_PTRMEMFUNC_P _must_ be true,
2505    before using this macro.  */
2506 #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))
2507
2508 /* Returns `A' for a type like `int (A::*)(double)' */
2509 #define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
2510   TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
2511
2512 /* These are use to manipulate the canonical RECORD_TYPE from the
2513    hashed POINTER_TYPE, and can only be used on the POINTER_TYPE.  */
2514 #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
2515 #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
2516 /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P.  */
2517 #define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
2518 #define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
2519
2520 /* For a pointer-to-member type of the form `T X::*', this is `X'.  */
2521 #define TYPE_PTRMEM_CLASS_TYPE(NODE)                    \
2522   (TYPE_PTRMEM_P ((NODE))                               \
2523    ? TYPE_OFFSET_BASETYPE (TREE_TYPE ((NODE)))          \
2524    : TYPE_PTRMEMFUNC_OBJECT_TYPE ((NODE)))
2525
2526 /* For a pointer-to-member type of the form `T X::*', this is `T'.  */
2527 #define TYPE_PTRMEM_POINTED_TO_TYPE(NODE)               \
2528    (TYPE_PTRMEM_P ((NODE))                              \
2529     ? TREE_TYPE (TREE_TYPE (NODE))                      \
2530     : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE ((NODE))))
2531
2532 /* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
2533    `X'.  */
2534 #define PTRMEM_CST_CLASS(NODE) \
2535   TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (PTRMEM_CST_CHECK (NODE)))
2536
2537 /* For a pointer-to-member constant `X::Y' this is the _DECL for 
2538    `Y'.  */
2539 #define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member)
2540
2541 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
2542    specified in its declaration.  This can also be set for an
2543    erroneously declared PARM_DECL.  */
2544 #define DECL_THIS_EXTERN(NODE) \
2545   DECL_LANG_FLAG_2 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE))
2546
2547 /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was
2548    specified in its declaration.  This can also be set for an
2549    erroneously declared PARM_DECL.  */
2550 #define DECL_THIS_STATIC(NODE) \
2551   DECL_LANG_FLAG_6 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE))
2552
2553 /* Nonzero in FUNCTION_DECL means it is really an operator.
2554    Just used to communicate formatting information to dbxout.c.  */
2555 #define DECL_OPERATOR(NODE) \
2556   (DECL_LANG_SPECIFIC(FUNCTION_DECL_CHECK (NODE))->decl_flags.operator_attr)
2557
2558 /* Nonzero if TYPE is an anonymous union or struct type.  We have to use a
2559    flag for this because "A union for which objects or pointers are
2560    declared is not an anonymous union" [class.union].  */
2561 #define ANON_AGGR_TYPE_P(NODE)                          \
2562   (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->anon_aggr)
2563 #define SET_ANON_AGGR_TYPE_P(NODE)                      \
2564   (TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1)
2565
2566 /* Nonzero if TYPE is an anonymous union type.  */
2567 #define ANON_UNION_TYPE_P(NODE) \
2568   (TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
2569
2570 /* For a VAR_DECL that is an anonymous union, these are the various
2571    sub-variables that make up the anonymous union.  */
2572 #define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE))
2573
2574 #define UNKNOWN_TYPE LANG_TYPE
2575
2576 /* Define fields and accessors for nodes representing declared names.  */
2577
2578 #if 0
2579 /* C++: A derived class may be able to directly use the virtual
2580    function table of a base class.  When it does so, it may
2581    still have a decl node used to access the virtual function
2582    table (so that variables of this type can initialize their
2583    virtual function table pointers by name).  When such thievery
2584    is committed, know exactly which base class's virtual function
2585    table is the one being stolen.  This effectively computes the
2586    transitive closure.  */
2587 #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
2588 #endif
2589
2590 #define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->was_anonymous)
2591
2592 /* C++: all of these are overloaded!  These apply only to TYPE_DECLs.  */
2593
2594 /* The format of each node in the DECL_FRIENDLIST is as follows:
2595
2596    The TREE_PURPOSE will be the name of a function, i.e., an
2597    IDENTIFIER_NODE.  The TREE_VALUE will be itself a TREE_LIST, the
2598    list of functions with that name which are friends.  The
2599    TREE_PURPOSE of each node in this sublist will be error_mark_node,
2600    if the function was declared a friend individually, in which case
2601    the TREE_VALUE will be the function_decl.  If, however, all
2602    functions with a given name in a class were declared to be friends,
2603    the TREE_PUROSE will be the class type, and the TREE_VALUE will be
2604    NULL_TREE.  */
2605 #define DECL_FRIENDLIST(NODE)           (DECL_INITIAL (NODE))
2606 #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
2607 #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
2608
2609 /* The DECL_ACCESS, if non-NULL, is a TREE_LIST.  The TREE_PURPOSE of
2610    each node is a type; the TREE_VALUE is the access granted for this
2611    DECL in that type.  The DECL_ACCESS is set by access declarations.
2612    For example, if a member that would normally be public in a
2613    derived class is made protected, then the derived class and the
2614    protected_access_node will appear in the DECL_ACCESS for the node.  */
2615 #define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.u2.access)
2616
2617 /* Nonzero if the FUNCTION_DECL is a global constructor.  */
2618 #define DECL_GLOBAL_CTOR_P(NODE) \
2619   (DECL_LANG_SPECIFIC ((NODE))->decl_flags.global_ctor_p)
2620
2621 /* Nonzero if the FUNCTION_DECL is a global destructor.  */
2622 #define DECL_GLOBAL_DTOR_P(NODE) \
2623   (DECL_LANG_SPECIFIC ((NODE))->decl_flags.global_dtor_p)
2624
2625 /* If DECL_GLOBAL_CTOR_P or DECL_GLOBAL_DTOR_P holds, this macro
2626    returns the initialization priority for the function.  Constructors
2627    with lower numbers should be run first.  Destructors should be run
2628    in the reverse order of constructors.  */
2629 #define GLOBAL_INIT_PRIORITY(NODE) \
2630   (DECL_LANG_SPECIFIC ((NODE))->decl_flags.u2.init_priority)
2631
2632 /* Accessor macros for C++ template decl nodes.  */
2633
2634 /* The DECL_TEMPLATE_PARMS are a list.  The TREE_PURPOSE of each node
2635    is a INT_CST whose TREE_INT_CST_HIGH indicates the level of the
2636    template parameters, with 1 being the outermost set of template
2637    parameters.  The TREE_VALUE is a vector, whose elements are the
2638    template parameters at each level.  Each element in the vector is a
2639    TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
2640    non-type parameter), or a TYPE_DECL (if the parameter is a type
2641    parameter).  The TREE_PURPOSE is the default value, if any.  The
2642    TEMPLATE_PARM_INDEX for the parameter is avilable as the
2643    DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
2644    TYPE_DECL).  */
2645 #define DECL_TEMPLATE_PARMS(NODE)       DECL_ARGUMENTS(NODE)
2646 #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
2647    INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
2648 #define DECL_NTPARMS(NODE) \
2649    TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
2650 /* For function, method, class-data templates.  */
2651 #define DECL_TEMPLATE_RESULT(NODE)      DECL_RESULT(NODE)
2652 /* For a static member variable template, the
2653    DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
2654    implicitly generated instantiations of the variable.  There are no
2655    partial instantiations of static member variables, so all of these
2656    will be full instantiations.
2657
2658    For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds
2659    all instantiations and specializations of the class type, including
2660    partial instantiations and partial specializations.
2661
2662    In both cases, the TREE_PURPOSE of each node contains the arguments
2663    used; the TREE_VALUE contains the generated variable.  The template
2664    arguments are always complete.  For example, given:
2665
2666       template <class T> struct S1 {
2667         template <class U> struct S2 {};
2668         template <class U> struct S2<U*> {};
2669       };
2670
2671    the record for the partial specialization will contain, as its
2672    argument list, { {T}, {U*} }, and will be on the
2673    DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template
2674    <class U> struct S1<T>::S2'.
2675
2676    This list is not used for function templates.  */
2677 #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
2678 /* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists
2679    contains all instantiations and specializations of the function,
2680    including partial instantiations.  For a partial instantiation
2681    which is a specialization, this list holds only full
2682    specializations of the template that are instantiations of the
2683    partial instantiation.  For example, given:
2684
2685       template <class T> struct S {
2686         template <class U> void f(U);
2687         template <> void f(T); 
2688       };
2689
2690    the `S<int>::f<int>(int)' function will appear on the
2691    DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T>
2692    template <class U> void S<T>::f(U)' and `template <class T> void
2693    S<int>::f(T)'.  In the latter case, however, it will have only the
2694    innermost set of arguments (T, in this case).  The DECL_TI_TEMPLATE
2695    for the function declaration will point at the specialization, not
2696    the fully general template.
2697
2698    For a class template, this list contains the partial
2699    specializations of this template.  (Full specializations are not
2700    recorded on this list.)  The TREE_PURPOSE holds the innermost
2701    arguments used in the partial specialization (e.g., for `template
2702    <class T> struct S<T*, int>' this will be `T*'.)  The TREE_VALUE
2703    holds the innermost template parameters for the specialization
2704    (e.g., `T' in the example above.)  The TREE_TYPE is the _TYPE node
2705    for the partial specialization.
2706
2707    This list is not used for static variable templates.  */
2708 #define DECL_TEMPLATE_SPECIALIZATIONS(NODE)     DECL_SIZE(NODE)
2709
2710 /* Nonzero for a DECL which is actually a template parameter.  */
2711 #define DECL_TEMPLATE_PARM_P(NODE)              \
2712   (DECL_LANG_FLAG_0 (NODE)                      \
2713    && (TREE_CODE (NODE) == CONST_DECL           \
2714        || TREE_CODE (NODE) == TYPE_DECL         \
2715        || TREE_CODE (NODE) == TEMPLATE_DECL))
2716
2717 /* Mark NODE as a template parameter.  */
2718 #define SET_DECL_TEMPLATE_PARM_P(NODE) \
2719   (DECL_LANG_FLAG_0 (NODE) = 1)
2720
2721 /* Nonzero if NODE is a template template parameter.  */
2722 #define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
2723   (TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
2724
2725 #define DECL_FUNCTION_TEMPLATE_P(NODE)  \
2726   (TREE_CODE (NODE) == TEMPLATE_DECL \
2727    && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
2728
2729 /* Nonzero for a DECL that represents a template class.  */
2730 #define DECL_CLASS_TEMPLATE_P(NODE) \
2731   (TREE_CODE (NODE) == TEMPLATE_DECL \
2732    && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
2733    && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
2734
2735 /* Nonzero if NODE which declares a type.  */
2736 #define DECL_DECLARES_TYPE_P(NODE) \
2737   (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
2738
2739 /* Nonzero if NODE is the typedef implicitly generated for a type when
2740    the type is declared.  (In C++, `struct S {};' is roughly equivalent
2741    to `struct S {}; typedef struct S S;' in C.  This macro will hold
2742    for the typedef indicated in this example.  Note that in C++, there
2743    is a second implicit typedef for each class, in the scope of `S'
2744    itself, so that you can say `S::S'.  This macro does *not* hold for
2745    those typedefs.  */
2746 #define DECL_IMPLICIT_TYPEDEF_P(NODE) \
2747   (TREE_CODE ((NODE)) == TYPE_DECL && DECL_LANG_FLAG_2 ((NODE)))
2748 #define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
2749   (DECL_LANG_FLAG_2 ((NODE)) = 1)
2750
2751 /* A `primary' template is one that has its own template header.  A
2752    member function of a class template is a template, but not primary.
2753    A member template is primary.  Friend templates are primary, too.  */
2754
2755 /* Returns the primary template corresponding to these parameters.  */
2756 #define DECL_PRIMARY_TEMPLATE(NODE) \
2757   (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
2758
2759 /* Returns non-zero if NODE is a primary template.  */
2760 #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE)
2761
2762 #define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
2763   (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
2764
2765 /* Indicates whether or not (and how) a template was expanded for this
2766    FUNCTION_DECL or VAR_DECL.
2767      0=normal declaration, e.g. int min (int, int);
2768      1=implicit template instantiation
2769      2=explicit template specialization, e.g. int min<int> (int, int);
2770      3=explicit template instantiation, e.g. template int min<int> (int, int);  */
2771 #define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template)
2772
2773 #define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
2774 #define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \
2775   (CLASSTYPE_USE_TEMPLATE (NODE) & 1)
2776
2777 #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)
2778 #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)
2779 #define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
2780   (CLASSTYPE_USE_TEMPLATE (NODE) == 2)
2781 #define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
2782   (CLASSTYPE_USE_TEMPLATE (NODE) = 2)
2783
2784 #define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)
2785 #define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)
2786 #define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
2787   (CLASSTYPE_USE_TEMPLATE(NODE) == 1)
2788 #define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
2789   (CLASSTYPE_USE_TEMPLATE(NODE) = 1)
2790
2791 #define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)
2792 #define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)
2793 #define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
2794   (CLASSTYPE_USE_TEMPLATE(NODE) == 3)
2795 #define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
2796   (CLASSTYPE_USE_TEMPLATE(NODE) = 3)
2797
2798 /* Non-zero if DECL is a friend function which is an instantiation
2799    from the point of view of the compiler, but not from the point of
2800    view of the language.  For example given:
2801       template <class T> struct S { friend void f(T) {}; };
2802    the declaration of `void f(int)' generated when S<int> is
2803    instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
2804    a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION.  */
2805 #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
2806   (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
2807
2808 /* Non-zero if TYPE is a partial instantiation of a template class,
2809    i.e., an instantiation whose instantiation arguments involve
2810    template types.  */
2811 #define PARTIAL_INSTANTIATION_P(TYPE) \
2812   (TYPE_LANG_SPECIFIC (TYPE)->is_partial_instantiation)
2813
2814 /* Non-zero iff we are currently processing a declaration for an
2815    entity with its own template parameter list, and which is not a
2816    full specialization.  */
2817 #define PROCESSING_REAL_TEMPLATE_DECL_P() \
2818   (processing_template_decl > template_class_depth (current_class_type))
2819
2820 /* This function may be a guiding decl for a template.  */
2821 #define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
2822
2823 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
2824    instantiated, i.e. its definition has been generated from the
2825    pattern given in the the template.  */
2826 #define DECL_TEMPLATE_INSTANTIATED(NODE) \
2827   DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
2828
2829 /* We know what we're doing with this decl now.  */
2830 #define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
2831
2832 /* This function was declared inline.  This flag controls the linkage
2833    semantics of 'inline'; whether or not the function is inlined is
2834    controlled by DECL_INLINE.  */
2835 #define DECL_THIS_INLINE(NODE) \
2836   (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline)
2837
2838 /* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
2839    so that assemble_external will work properly.  So we have this flag to
2840    tell us whether the decl is really not external.  */
2841 #define DECL_NOT_REALLY_EXTERN(NODE) \
2842   (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)
2843
2844 #define DECL_REALLY_EXTERN(NODE) \
2845   (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
2846
2847 /* An integer indicating how many bytes should be subtracted from the
2848    `this' pointer when this function is called.  */
2849 #define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i)
2850
2851 /* An integer indicating how many bytes should be subtracted from the
2852    vtable for the `this' pointer to find the vcall offset.  (The vptr
2853    is always located at offset zero from the `this' pointer.)  If
2854    zero, then there is no vcall offset.  */
2855 #define THUNK_VCALL_OFFSET(DECL) (DECL_FIELD_SIZE (DECL))
2856
2857 /* DECL_NEEDED_P holds of a declaration when we need to emit its
2858    definition.  This is true when the back-end tells us that
2859    the symbol has been referenced in the generated code.  If, however,
2860    we are not generating code, then it is also true when a symbol has
2861    just been used somewhere, even if it's not really needed.  */
2862 #define DECL_NEEDED_P(DECL)                                     \
2863   (! DECL_COMDAT (DECL)                                         \
2864    || (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL))))   \
2865    || (flag_syntax_only && TREE_USED ((DECL))))
2866
2867 /* An un-parsed default argument looks like an identifier.  */
2868 #define DEFARG_LENGTH(NODE)  (DEFAULT_ARG_CHECK(NODE)->identifier.length)
2869 #define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.pointer)
2870
2871 /* These macros provide convenient access to the various _STMT nodes
2872    created when parsing template declarations.  */
2873 #define IF_COND(NODE)           TREE_OPERAND (IF_STMT_CHECK (NODE), 0)
2874 #define THEN_CLAUSE(NODE)       TREE_OPERAND (IF_STMT_CHECK (NODE), 1)
2875 #define ELSE_CLAUSE(NODE)       TREE_OPERAND (IF_STMT_CHECK (NODE), 2)
2876 #define WHILE_COND(NODE)        TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0)
2877 #define WHILE_BODY(NODE)        TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1)
2878 #define DO_COND(NODE)           TREE_OPERAND (DO_STMT_CHECK (NODE), 0)
2879 #define DO_BODY(NODE)           TREE_OPERAND (DO_STMT_CHECK (NODE), 1)
2880 #define RETURN_EXPR(NODE)       TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
2881 #define EXPR_STMT_EXPR(NODE)    TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0)
2882 #define FOR_INIT_STMT(NODE)     TREE_OPERAND (FOR_STMT_CHECK (NODE), 0)
2883 #define FOR_COND(NODE)          TREE_OPERAND (FOR_STMT_CHECK (NODE), 1)
2884 #define FOR_EXPR(NODE)          TREE_OPERAND (FOR_STMT_CHECK (NODE), 2)
2885 #define FOR_BODY(NODE)          TREE_OPERAND (FOR_STMT_CHECK (NODE), 3)
2886 #define SWITCH_COND(NODE)       TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0)
2887 #define SWITCH_BODY(NODE)       TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1)
2888 #define CASE_LOW(NODE)          TREE_OPERAND (CASE_LABEL_CHECK (NODE), 0)
2889 #define CASE_HIGH(NODE)         TREE_OPERAND (CASE_LABEL_CHECK (NODE), 1)
2890 #define GOTO_DESTINATION(NODE)  TREE_OPERAND (GOTO_STMT_CHECK (NODE), 0)
2891 #define TRY_STMTS(NODE)         TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
2892 #define TRY_HANDLERS(NODE)      TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1)
2893 #define CLEANUP_P(NODE)         TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
2894 /* Nonzero if this try block is a function try block.  */
2895 #define FN_TRY_BLOCK_P(NODE)    TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE))
2896 #define HANDLER_PARMS(NODE)     TREE_OPERAND (HANDLER_CHECK (NODE), 0)
2897 #define HANDLER_BODY(NODE)      TREE_OPERAND (HANDLER_CHECK (NODE), 1)
2898 #define COMPOUND_BODY(NODE)     TREE_OPERAND (COMPOUND_STMT_CHECK (NODE), 0)
2899 #define ASM_CV_QUAL(NODE)       TREE_OPERAND (ASM_STMT_CHECK (NODE), 0)
2900 #define ASM_STRING(NODE)        TREE_OPERAND (ASM_STMT_CHECK (NODE), 1)
2901 #define ASM_OUTPUTS(NODE)       TREE_OPERAND (ASM_STMT_CHECK (NODE), 2)
2902 #define ASM_INPUTS(NODE)        TREE_OPERAND (ASM_STMT_CHECK (NODE), 3)
2903 #define ASM_CLOBBERS(NODE)      TREE_OPERAND (ASM_STMT_CHECK (NODE), 4)
2904 #define DECL_STMT_DECL(NODE)    TREE_OPERAND (DECL_STMT_CHECK (NODE), 0)
2905 #define STMT_EXPR_STMT(NODE)    TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0)
2906 #define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0)
2907 #define CLEANUP_DECL(NODE)      TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0)
2908 #define CLEANUP_EXPR(NODE)      TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1)
2909 #define START_CATCH_TYPE(NODE)  TREE_TYPE (START_CATCH_STMT_CHECK (NODE))
2910 #define LABEL_STMT_LABEL(NODE)  TREE_OPERAND (LABEL_STMT_CHECK (NODE), 0)
2911
2912 /* Nonzero if this SCOPE_STMT is for the beginning of a scope.  */
2913 #define SCOPE_BEGIN_P(NODE) \
2914   (TREE_LANG_FLAG_0 (SCOPE_STMT_CHECK (NODE))) 
2915
2916 /* Nonzero if this SCOPE_STMT is for the end of a scope.  */
2917 #define SCOPE_END_P(NODE) \
2918   (!SCOPE_BEGIN_P (SCOPE_STMT_CHECK (NODE)))
2919
2920 /* The BLOCK containing the declarations contained in this scope.  */
2921 #define SCOPE_STMT_BLOCK(NODE) \
2922   (TREE_OPERAND (SCOPE_STMT_CHECK (NODE), 0))
2923
2924 /* Nonzero if this CTOR_STMT is for the beginning of a constructor.  */
2925 #define CTOR_BEGIN_P(NODE) \
2926   (TREE_LANG_FLAG_0 (CTOR_STMT_CHECK (NODE)))
2927
2928 /* Nonzero if this CTOR_STMT is for the end of a constructor.  */
2929 #define CTOR_END_P(NODE) \
2930   (!CTOR_BEGIN_P (NODE))
2931
2932 /* Nonzero for a SCOPE_STMT if there were no variables in this scope.  */
2933 #define SCOPE_NULLIFIED_P(NODE) \
2934   (SCOPE_STMT_BLOCK ((NODE)) == NULL_TREE)
2935
2936 /* Nonzero for a SCOPE_STMT which represents a lexical scope, but
2937    which should be treated as non-existant from the point of view of
2938    running cleanup actions.  */
2939 #define SCOPE_NO_CLEANUPS_P(NODE) \
2940   (TREE_LANG_FLAG_3 (SCOPE_STMT_CHECK (NODE)))
2941
2942 /* Nonzero for a SCOPE_STMT if this statement is for a partial scope.
2943    For example, in:
2944   
2945      S s;
2946      l:
2947      S s2;
2948      goto l;
2949
2950    there is (implicitly) a new scope after `l', even though there are
2951    no curly braces.  In particular, when we hit the goto, we must
2952    destroy s2 and then re-construct it.  For the implicit scope,
2953    SCOPE_PARTIAL_P will be set.  */
2954 #define SCOPE_PARTIAL_P(NODE) \
2955   (TREE_LANG_FLAG_4 (SCOPE_STMT_CHECK (NODE)))
2956
2957 /* Nonzero for an ASM_STMT if the assembly statement is volatile.  */
2958 #define ASM_VOLATILE_P(NODE)                    \
2959   (ASM_CV_QUAL (ASM_STMT_CHECK (NODE)) != NULL_TREE)
2960
2961 /* The line-number at which a statement began.  But if
2962    STMT_LINENO_FOR_FN_P does holds, then this macro gives the
2963    line number for the end of the current function instead.  */
2964 #define STMT_LINENO(NODE)                       \
2965   (TREE_COMPLEXITY ((NODE)))
2966
2967 /* If non-zero, the STMT_LINENO for NODE is the line at which the
2968    function ended.  */
2969 #define STMT_LINENO_FOR_FN_P(NODE)              \
2970   (TREE_LANG_FLAG_2 ((NODE)))
2971
2972 /* The parameters for a call-declarator.  */
2973 #define CALL_DECLARATOR_PARMS(NODE) \
2974   (TREE_PURPOSE (TREE_OPERAND ((NODE), 1)))
2975
2976 /* The cv-qualifiers for a call-declarator.  */
2977 #define CALL_DECLARATOR_QUALS(NODE) \
2978   (TREE_VALUE (TREE_OPERAND ((NODE), 1)))
2979
2980 /* The exception-specification for a call-declarator.  */
2981 #define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \
2982   (TREE_TYPE ((NODE)))
2983
2984 /* An enumeration of the kind of tags that C++ accepts.  */
2985 enum tag_types { record_type, class_type, union_type, enum_type };
2986
2987 /* The various kinds of lvalues we distinguish.  */
2988 typedef enum cp_lvalue_kind {
2989   clk_none = 0,     /* Things that are not an lvalue.  */
2990   clk_ordinary = 1, /* An ordinary lvalue.  */
2991   clk_class = 2,    /* An rvalue of class-type.  */
2992   clk_bitfield = 4, /* An lvalue for a bit-field.  */
2993 } cp_lvalue_kind;
2994
2995 /* Zero means prototype weakly, as in ANSI C (no args means nothing).
2996    Each language context defines how this variable should be set.  */
2997 extern int strict_prototype;
2998 extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;
2999
3000 /* Non-zero means that if a label exists, and no other identifier
3001    applies, use the value of the label.  */
3002 extern int flag_labels_ok;
3003
3004 /* Nonzero means allow Microsoft extensions without a pedwarn.  */
3005 extern int flag_ms_extensions;
3006
3007 /* Non-zero means to collect statistics which might be expensive
3008    and to print them when we are done.  */
3009 extern int flag_detailed_statistics;
3010
3011 /* Non-zero means warn in function declared in derived class has the
3012    same name as a virtual in the base class, but fails to match the
3013    type signature of any virtual function in the base class.  */
3014 extern int warn_overloaded_virtual;
3015
3016 /* Nonzero means warn about use of multicharacter literals.  */
3017 extern int warn_multichar;
3018
3019 /* Non-zero means warn if a non-templatized friend function is
3020    declared in a templatized class. This behavior is warned about with
3021    flag_guiding_decls in do_friend. */
3022 extern int warn_nontemplate_friend;
3023
3024 /* in c-common.c */
3025 extern void declare_function_name               PARAMS ((void));
3026 extern void decl_attributes                     PARAMS ((tree, tree, tree));
3027 extern void init_function_format_info           PARAMS ((void));
3028 extern void record_function_format              PARAMS ((tree, tree, int, int, int));
3029 extern void check_function_format               PARAMS ((tree, tree, tree));
3030 /* Print an error message for invalid operands to arith operation CODE.
3031    NOP_EXPR is used as a special case (see truthvalue_conversion).  */
3032 extern void binary_op_error                     PARAMS ((enum tree_code));
3033 extern tree canonical_type_variant              PARAMS ((tree));
3034 extern void c_expand_expr_stmt                  PARAMS ((tree));
3035 /* Validate the expression after `case' and apply default promotions.  */
3036 extern tree check_case_value                    PARAMS ((tree));
3037 /* Concatenate a list of STRING_CST nodes into one STRING_CST.  */
3038 extern tree combine_strings                     PARAMS ((tree));
3039 extern void constant_expression_warning         PARAMS ((tree));
3040 extern tree convert_and_check                   PARAMS ((tree, tree));
3041 extern void overflow_warning                    PARAMS ((tree));
3042 extern void unsigned_conversion_warning         PARAMS ((tree, tree));
3043 extern void c_apply_type_quals_to_decl          PARAMS ((int, tree));
3044
3045 /* Read the rest of the current #-directive line.  */
3046 #if USE_CPPLIB
3047 extern char *get_directive_line                 PARAMS ((void));
3048 #define GET_DIRECTIVE_LINE() get_directive_line ()
3049 #else
3050 extern char *get_directive_line                 PARAMS ((FILE *));
3051 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
3052 #endif
3053 /* Subroutine of build_binary_op, used for comparison operations.
3054    See if the operands have both been converted from subword integer types
3055    and, if so, perhaps change them both back to their original type.  */
3056 extern tree shorten_compare                     PARAMS ((tree *, tree *, tree *, enum tree_code *));
3057 /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
3058    or validate its data type for an `if' or `while' statement or ?..: exp.  */
3059 extern tree truthvalue_conversion               PARAMS ((tree));
3060 extern tree type_for_mode                       PARAMS ((enum machine_mode, int));
3061 extern tree type_for_size                       PARAMS ((unsigned, int));
3062 extern int c_get_alias_set                      PARAMS ((tree));
3063
3064 /* in decl{2}.c */
3065 /* A node that is a list (length 1) of error_mark_nodes.  */
3066 extern tree error_mark_list;
3067
3068 /* A list of virtual function tables we must make sure to write out.  */
3069 extern tree pending_vtables;
3070
3071 /* Node for "pointer to (virtual) function".
3072    This may be distinct from ptr_type_node so gdb can distinguish them.  */
3073 #define vfunc_ptr_type_node \
3074   (flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
3075
3076
3077 /* For building calls to `delete'.  */
3078 extern tree integer_two_node, integer_three_node;
3079
3080 extern tree anonymous_namespace_name;
3081
3082 /* in pt.c  */
3083
3084 /* These values are used for the `STRICT' parameter to type_unfication and
3085    fn_type_unification.  Their meanings are described with the
3086    documentation for fn_type_unification.  */
3087
3088 typedef enum unification_kind_t {
3089   DEDUCE_CALL,
3090   DEDUCE_CONV,
3091   DEDUCE_EXACT
3092 } unification_kind_t;
3093
3094 /* The template currently being instantiated, and where the instantiation
3095    was triggered.  */
3096 struct tinst_level
3097 {
3098   tree decl;
3099   int line;
3100   char *file;
3101   struct tinst_level *next;
3102 };
3103
3104 extern void maybe_print_template_context        PARAMS ((void));
3105
3106 /* in class.c */
3107
3108 extern int current_class_depth;
3109
3110 /* Points to the name of that function. May not be the DECL_NAME
3111    of CURRENT_FUNCTION_DECL due to overloading */
3112 extern tree original_function_name;
3113
3114 /* in init.c  */
3115 extern tree global_base_init_list;
3116
3117 \f
3118 /* Here's where we control how name mangling takes place.  */
3119
3120 #define OPERATOR_ASSIGN_FORMAT "__a%s"
3121 #define OPERATOR_FORMAT "__%s"
3122 #define OPERATOR_TYPENAME_FORMAT "__op"
3123
3124 /* Cannot use '$' up front, because this confuses gdb
3125    (names beginning with '$' are gdb-local identifiers).
3126
3127    Note that all forms in which the '$' is significant are long enough
3128    for direct indexing (meaning that if we know there is a '$'
3129    at a particular location, we can index into the string at
3130    any other location that provides distinguishing characters).  */
3131
3132 /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
3133    doesn't allow '$' in symbol names.  */
3134 #ifndef NO_DOLLAR_IN_LABEL
3135
3136 #define JOINER '$'
3137
3138 #define VPTR_NAME "$v"
3139 #define THROW_NAME "$eh_throw"
3140 #define DESTRUCTOR_DECL_PREFIX "_$_"
3141 #define AUTO_VTABLE_NAME "__vtbl$me__"
3142 #define AUTO_TEMP_NAME "_$tmp_"
3143 #define AUTO_TEMP_FORMAT "_$tmp_%d"
3144 #define VTABLE_BASE "$vb"
3145 #define VTABLE_NAME_PREFIX (flag_vtable_thunks ? "__vt_" : "_vt$")
3146 #define VFIELD_BASE "$vf"
3147 #define VFIELD_NAME "_vptr$"
3148 #define VFIELD_NAME_FORMAT "_vptr$%s"
3149 #define VBASE_NAME "_vb$"
3150 #define VBASE_NAME_FORMAT "_vb$%s"
3151 #define STATIC_NAME_FORMAT "_%s$%s"
3152 #define ANON_AGGRNAME_FORMAT "$_%d"
3153
3154 #else /* NO_DOLLAR_IN_LABEL */
3155
3156 #ifndef NO_DOT_IN_LABEL
3157
3158 #define JOINER '.'
3159
3160 #define VPTR_NAME ".v"
3161 #define THROW_NAME ".eh_throw"
3162 #define DESTRUCTOR_DECL_PREFIX "_._"
3163 #define AUTO_VTABLE_NAME "__vtbl.me__"
3164 #define AUTO_TEMP_NAME "_.tmp_"
3165 #define AUTO_TEMP_FORMAT "_.tmp_%d"
3166 #define VTABLE_BASE ".vb"
3167 #define VTABLE_NAME_PREFIX (flag_vtable_thunks ? "__vt_" : "_vt.")
3168 #define VFIELD_BASE ".vf"
3169 #define VFIELD_NAME "_vptr."
3170 #define VFIELD_NAME_FORMAT "_vptr.%s"
3171 #define VBASE_NAME "_vb."
3172 #define VBASE_NAME_FORMAT "_vb.%s"
3173 #define STATIC_NAME_FORMAT "_%s.%s"
3174
3175 #define ANON_AGGRNAME_FORMAT "._%d"
3176
3177 #else /* NO_DOT_IN_LABEL */
3178
3179 #define VPTR_NAME "__vptr"
3180 #define VPTR_NAME_P(ID_NODE) \
3181   (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
3182 #define THROW_NAME "__eh_throw"
3183 #define DESTRUCTOR_DECL_PREFIX "__destr_"
3184 #define DESTRUCTOR_NAME_P(ID_NODE) \
3185   (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \
3186              sizeof (DESTRUCTOR_DECL_PREFIX) - 1))
3187 #define IN_CHARGE_NAME "__in_chrg"
3188 #define AUTO_VTABLE_NAME "__vtbl_me__"
3189 #define AUTO_TEMP_NAME "__tmp_"
3190 #define TEMP_NAME_P(ID_NODE) \
3191   (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
3192              sizeof (AUTO_TEMP_NAME) - 1))
3193 #define AUTO_TEMP_FORMAT "__tmp_%d"
3194 #define VTABLE_BASE "__vtb"
3195 #define VTABLE_NAME "__vt_"
3196 #define VTABLE_NAME_PREFIX (flag_vtable_thunks ? "__vt_" : "_vt_")
3197 #define VTABLE_NAME_P(ID_NODE) \
3198   (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
3199              sizeof (VTABLE_NAME) - 1))
3200 #define VFIELD_BASE "__vfb"
3201 #define VFIELD_NAME "__vptr_"
3202 #define VFIELD_NAME_P(ID_NODE) \
3203   (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
3204             sizeof (VFIELD_NAME) - 1))
3205 #define VFIELD_NAME_FORMAT "_vptr_%s"
3206 #define VBASE_NAME "__vb_"
3207 #define VBASE_NAME_P(ID_NODE) \
3208   (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \
3209              sizeof (VBASE_NAME) - 1))
3210 #define VBASE_NAME_FORMAT "__vb_%s"
3211 #define STATIC_NAME_FORMAT "__static_%s_%s"
3212
3213 #define ANON_AGGRNAME_PREFIX "__anon_"
3214 #define ANON_AGGRNAME_P(ID_NODE) \
3215   (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
3216              sizeof (ANON_AGGRNAME_PREFIX) - 1))
3217 #define ANON_AGGRNAME_FORMAT "__anon_%d"
3218 #define ANON_PARMNAME_FORMAT "__%d"
3219 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
3220                                   && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \
3221                                   && IDENTIFIER_POINTER (ID_NODE)[2] <= '9')
3222
3223 #endif  /* NO_DOT_IN_LABEL */
3224 #endif  /* NO_DOLLAR_IN_LABEL */
3225
3226 #define THIS_NAME "this"
3227 #define DESTRUCTOR_NAME_FORMAT "~%s"
3228 #define FILE_FUNCTION_PREFIX_LEN 9
3229 #define CTOR_NAME "__ct"
3230 #define DTOR_NAME "__dt"
3231
3232 #define IN_CHARGE_NAME "__in_chrg"
3233
3234 #define VTBL_PTR_TYPE           "__vtbl_ptr_type"
3235 #define VTABLE_DELTA_NAME       "__delta"
3236 #define VTABLE_INDEX_NAME       "__index"
3237 #define VTABLE_PFN_NAME         "__pfn"
3238 #define VTABLE_DELTA2_NAME      "__delta2"
3239
3240 #define EXCEPTION_CLEANUP_NAME  "exception cleanup"
3241
3242 #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
3243
3244 #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
3245
3246 #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
3247                               && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
3248 #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \
3249                                     && IDENTIFIER_POINTER (ID_NODE)[2] == '_') 
3250
3251 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
3252   && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
3253   && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
3254
3255 #define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
3256   && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
3257   && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
3258
3259 #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
3260 #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
3261
3262 /* For anonymous aggregate types, we need some sort of name to
3263    hold on to.  In practice, this should not appear, but it should
3264    not be harmful if it does.  */
3265 #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
3266                                   && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
3267 #define ANON_PARMNAME_FORMAT "_%d"
3268 #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
3269                                   && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
3270 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
3271
3272 /* Store the vbase pointer field name for type TYPE into pointer BUF.  */
3273 #define FORMAT_VBASE_NAME(BUF,TYPE) do {                                \
3274   char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE)       \
3275                          + sizeof (VBASE_NAME) + 1);                    \
3276   sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
3277   (BUF) = wbuf;                                                         \
3278 } while (0)
3279
3280 /* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
3281    `main'.  */
3282 #define MAIN_NAME_P(ID_NODE) \
3283    (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0)
3284
3285 /* Returns non-zero iff NODE is a declaration for the global function
3286    `main'.  */
3287 #define DECL_MAIN_P(NODE)                               \
3288    (TREE_CODE (NODE) == FUNCTION_DECL                   \
3289     && DECL_LANGUAGE (NODE) == lang_c                   \
3290     && DECL_NAME (NODE) != NULL_TREE                    \
3291     && MAIN_NAME_P (DECL_NAME (NODE)))
3292
3293 \f
3294 /* Things for handling inline functions.  */
3295
3296 struct pending_inline
3297 {
3298   struct pending_inline *next;  /* pointer to next in chain */
3299   int lineno;                   /* line number we got the text from */
3300   char *filename;               /* name of file we were processing */
3301   tree fndecl;                  /* FUNCTION_DECL that brought us here */
3302   int token;                    /* token we were scanning */
3303   int token_value;              /* value of token we were scanning (YYSTYPE) */
3304
3305   char *buf;                    /* pointer to character stream */
3306   int len;                      /* length of stream */
3307   unsigned int can_free : 1;    /* free this after we're done with it? */
3308   unsigned int deja_vu : 1;     /* set iff we don't want to see it again.  */
3309   unsigned int interface : 2;   /* 0=interface 1=unknown 2=implementation */
3310 };
3311
3312 /* in method.c */
3313 extern struct pending_inline *pending_inlines;
3314
3315 /* Negative values means we know `this' to be of static type.  */
3316
3317 extern int flag_this_is_variable;
3318
3319 /* Nonzero means do emit exported implementations of functions even if
3320    they can be inlined.  */
3321
3322 extern int flag_implement_inlines;
3323
3324 /* Nonzero means templates obey #pragma interface and implementation.  */
3325
3326 extern int flag_external_templates;
3327
3328 /* Nonzero means templates are emitted where they are instantiated.  */
3329
3330 extern int flag_alt_external_templates;
3331
3332 /* Nonzero means implicit template instantiations are emitted.  */
3333
3334 extern int flag_implicit_templates;
3335
3336 /* Nonzero if we want to emit defined symbols with common-like linkage as
3337    weak symbols where possible, in order to conform to C++ semantics.
3338    Otherwise, emit them as local symbols.  */
3339
3340 extern int flag_weak;
3341
3342 /* Nonzero if we should expand functions calls inline at the tree
3343    level, rather than at the RTL level.  */
3344
3345 extern int flag_inline_trees;
3346
3347 /* Nonzero if we're done parsing and into end-of-file activities.  */
3348
3349 extern int at_eof;
3350
3351 enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
3352
3353 /* Some macros for char-based bitfields.  */
3354 #define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
3355 #define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
3356 #define B_TST(a,x) (a[x>>3] & (1 << (x&7)))
3357
3358 /* These are uses as bits in flags passed to build_method_call
3359    to control its error reporting behavior.
3360
3361    LOOKUP_PROTECT means flag access violations.
3362    LOOKUP_COMPLAIN mean complain if no suitable member function
3363      matching the arguments is found.
3364    LOOKUP_NORMAL is just a combination of these two.
3365    LOOKUP_NONVIRTUAL means make a direct call to the member function found
3366    LOOKUP_GLOBAL means search through the space of overloaded functions,
3367      as well as the space of member functions.
3368    LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
3369      in the parameter list.
3370    LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
3371    DIRECT_BIND means that if a temporary is created, it should be created so
3372      that it lives as long as the current variable bindings; otherwise it
3373      only lives until the end of the complete-expression.
3374    LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
3375      after.  Note, LOOKUP_COMPLAIN is checked and error messages printed
3376      before LOOKUP_SPECULATIVELY is checked.
3377    LOOKUP_NO_CONVERSION means that user-defined conversions are not
3378      permitted.  Built-in conversions are permitted.
3379    LOOKUP_DESTRUCTOR means explicit call to destructor.
3380    LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references.
3381
3382    These are used in global lookup to support elaborated types and
3383    qualifiers.
3384    
3385    LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
3386    LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
3387    LOOKUP_PREFER_BOTH means class-or-namespace-name.
3388    LOOKUP_TEMPLATES_EXPECTED means that class templates also count
3389      as types.  */
3390
3391 #define LOOKUP_PROTECT (1)
3392 #define LOOKUP_COMPLAIN (2)
3393 #define LOOKUP_NORMAL (3)
3394 /* #define LOOKUP_UNUSED (4) */
3395 #define LOOKUP_NONVIRTUAL (8)
3396 #define LOOKUP_GLOBAL (16)
3397 #define LOOKUP_HAS_IN_CHARGE (32)
3398 #define LOOKUP_SPECULATIVELY (64)
3399 #define LOOKUP_ONLYCONVERTING (128)
3400 #define DIRECT_BIND (256)
3401 #define LOOKUP_NO_CONVERSION (512)
3402 #define LOOKUP_DESTRUCTOR (512)
3403 #define LOOKUP_NO_TEMP_BIND (1024)
3404 #define LOOKUP_PREFER_TYPES (2048)
3405 #define LOOKUP_PREFER_NAMESPACES (4096)
3406 #define LOOKUP_PREFER_BOTH (6144)
3407 #define LOOKUP_TEMPLATES_EXPECTED (8192)
3408
3409 #define LOOKUP_NAMESPACES_ONLY(f)  \
3410   (((f) & LOOKUP_PREFER_NAMESPACES) && !((f) & LOOKUP_PREFER_TYPES))
3411 #define LOOKUP_TYPES_ONLY(f)  \
3412   (!((f) & LOOKUP_PREFER_NAMESPACES) && ((f) & LOOKUP_PREFER_TYPES))
3413 #define LOOKUP_QUALIFIERS_ONLY(f)     ((f) & LOOKUP_PREFER_BOTH)
3414      
3415
3416 /* These flags are used by the conversion code.
3417    CONV_IMPLICIT   :  Perform implicit conversions (standard and user-defined).
3418    CONV_STATIC     :  Perform the explicit conversions for static_cast.
3419    CONV_CONST      :  Perform the explicit conversions for const_cast.
3420    CONV_REINTERPRET:  Perform the explicit conversions for reinterpret_cast.
3421    CONV_PRIVATE    :  Perform upcasts to private bases.
3422    CONV_FORCE_TEMP :  Require a new temporary when converting to the same
3423                       aggregate type.  */
3424
3425 #define CONV_IMPLICIT    1
3426 #define CONV_STATIC      2
3427 #define CONV_CONST       4
3428 #define CONV_REINTERPRET 8
3429 #define CONV_PRIVATE     16
3430 /* #define CONV_NONCONVERTING 32 */
3431 #define CONV_FORCE_TEMP  64
3432 #define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP)
3433 #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
3434                           | CONV_REINTERPRET)
3435 #define CONV_C_CAST      (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
3436                           | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP)
3437
3438 /* Used by build_expr_type_conversion to indicate which types are
3439    acceptable as arguments to the expression under consideration.  */
3440
3441 #define WANT_INT        1 /* integer types, including bool */
3442 #define WANT_FLOAT      2 /* floating point types */
3443 #define WANT_ENUM       4 /* enumerated types */
3444 #define WANT_POINTER    8 /* pointer types */
3445 #define WANT_NULL      16 /* null pointer constant */
3446 #define WANT_ARITH      (WANT_INT | WANT_FLOAT)
3447
3448 /* Used with comptypes, and related functions, to guide type
3449    comparison.  */
3450
3451 #define COMPARE_STRICT        0 /* Just check if the types are the
3452                                    same.  */
3453 #define COMPARE_BASE          1 /* Check to see if the second type is
3454                                    derived from the first, or if both
3455                                    are pointers (or references) and
3456                                    the types pointed to by the second
3457                                    type is derived from the pointed to
3458                                    by the first.  */
3459 #define COMPARE_RELAXED       2 /* Like COMPARE_DERIVED, but in
3460                                    reverse.  Also treat enmeration
3461                                    types as the same as integer types
3462                                    of the same width.  */
3463 #define COMPARE_REDECLARATION 4 /* The comparsion is being done when
3464                                    another declaration of an existing
3465                                    entity is seen.  */
3466 #define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore
3467                                    extra-linguistic type attributes.  */
3468
3469 /* Used with push_overloaded_decl.  */
3470 #define PUSH_GLOBAL          0  /* Push the DECL into namespace scope,
3471                                    regardless of the current scope.  */
3472 #define PUSH_LOCAL           1  /* Push the DECL into the current
3473                                    scope.  */
3474 #define PUSH_USING           2  /* We are pushing this DECL as the
3475                                    result of a using declaration.  */
3476
3477 /* Used with start function.  */
3478 #define SF_DEFAULT           0  /* No flags.  */
3479 #define SF_PRE_PARSED        1  /* The function declaration has
3480                                    already been parsed.  */
3481 #define SF_INCLASS_INLINE    2  /* The function is an inline, defined
3482                                    in the class body.  */
3483 #define SF_EXPAND            4  /* Generate RTL for this function.  */
3484
3485 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
3486    sense of `same'.  */
3487 #define same_type_p(type1, type2) \
3488   comptypes ((type1), (type2), COMPARE_STRICT)
3489
3490 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2
3491    is derived from TYPE1, or if TYPE2 is a pointer (reference) to a
3492    class derived from the type pointed to (referred to) by TYPE1.  */
3493 #define same_or_base_type_p(type1, type2) \
3494   comptypes ((type1), (type2), COMPARE_BASE)
3495
3496 /* These macros are used to access a TEMPLATE_PARM_INDEX.  */
3497 #define TEMPLATE_PARM_INDEX_CAST(NODE) \
3498         ((template_parm_index*)TEMPLATE_PARM_INDEX_CHECK (NODE))
3499 #define TEMPLATE_PARM_IDX(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->index)
3500 #define TEMPLATE_PARM_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->level)
3501 #define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
3502 #define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
3503 #define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
3504
3505 /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM 
3506    and TEMPLATE_TEMPLATE_PARM nodes.  */
3507 #define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
3508 #define TEMPLATE_TYPE_IDX(NODE) \
3509   (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3510 #define TEMPLATE_TYPE_LEVEL(NODE) \
3511   (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3512 #define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \
3513   (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3514 #define TEMPLATE_TYPE_DECL(NODE) \
3515   (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
3516
3517 /* Control stringification of trees (types, decls & exprs).
3518    Bit or them together.  */
3519 enum tree_string_flags
3520 {
3521     TS_PLAIN,                    /* nothing special */
3522     TS_CHASE_TYPEDEFS = 1 <<  0, /* look through typedefs */
3523     TS_DECORATE       = 1 <<  1, /* decorate things */
3524     TS_FUNC_NORETURN  = 1 <<  2, /* inhibit function return type */
3525     TS_FUNC_THROW     = 1 <<  3, /* show throw spec */
3526     TS_PARM_DEFAULTS  = 1 <<  4, /* show parm defaults */
3527     TS_EXPR_PARENS    = 1 <<  5, /* enclose in parens */
3528     TS_AGGR_TAGS      = 1 <<  6, /* show struct tags */
3529     TS_DECL_TYPE      = 1 <<  7, /* show decl's type */
3530     TS_FUNC_SCOPE     = 1 <<  8, /* show function scope */
3531     TS_PEDANTIC_NAME  = 1 <<  9, /* pedantically name things */
3532     TS_TEMPLATE_PREFIX= 1 << 10, /* show template <parms> prefix */
3533     
3534     /* Internal use flags */
3535     TS_TEMPLATE_PARM  = 1 << 11, /* decl is really a non-type template parm */
3536     TS_TEMPLATE_PLAIN = 1 << 12, /* don't decorate primary template_name */
3537     
3538     TS_NEXT_BIT       = 13       /* next available bit */
3539 };
3540
3541 /* in lex.c  */
3542 /* Indexed by TREE_CODE, these tables give C-looking names to
3543    operators represented by TREE_CODES.  For example,
3544    opname_tab[(int) MINUS_EXPR] == "-".  */
3545 extern const char **opname_tab, **assignop_tab;
3546 \f
3547 /* in call.c */
3548 extern int check_dtor_name                      PARAMS ((tree, tree));
3549 extern int get_arglist_len_in_bytes             PARAMS ((tree));
3550
3551 extern tree build_vfield_ref                    PARAMS ((tree, tree));
3552 extern tree resolve_scope_to_name               PARAMS ((tree, tree));
3553 extern tree build_scoped_method_call            PARAMS ((tree, tree, tree, tree));
3554 extern tree build_addr_func                     PARAMS ((tree));
3555 extern tree build_call                          PARAMS ((tree, tree, tree));
3556 extern tree build_method_call                   PARAMS ((tree, tree, tree, tree, int));
3557 extern int null_ptr_cst_p                       PARAMS ((tree));
3558 extern tree type_decays_to                      PARAMS ((tree));
3559 extern tree build_user_type_conversion          PARAMS ((tree, tree, int));
3560 extern tree build_new_function_call             PARAMS ((tree, tree));
3561 extern tree build_new_op                        PARAMS ((enum tree_code, int, tree, tree, tree));
3562 extern tree build_op_new_call                   PARAMS ((enum tree_code, tree, tree, int));
3563 extern tree build_op_delete_call                PARAMS ((enum tree_code, tree, tree, int, tree));
3564 extern int can_convert                          PARAMS ((tree, tree));
3565 extern int can_convert_arg                      PARAMS ((tree, tree, tree));
3566 extern int enforce_access                       PARAMS ((tree, tree));
3567 extern tree convert_default_arg                 PARAMS ((tree, tree, tree));
3568 extern tree convert_arg_to_ellipsis             PARAMS ((tree));
3569 extern tree build_x_va_arg                      PARAMS ((tree, tree));
3570 extern tree convert_type_from_ellipsis          PARAMS ((tree));
3571 extern int is_properly_derived_from             PARAMS ((tree, tree));
3572 extern tree initialize_reference                PARAMS ((tree, tree));
3573 extern tree strip_top_quals                     PARAMS ((tree));
3574 extern tree perform_implicit_conversion         PARAMS ((tree, tree));
3575
3576 /* in class.c */
3577 extern tree build_vbase_path                    PARAMS ((enum tree_code, tree, tree, tree, int));
3578 extern tree build_vtbl_ref                      PARAMS ((tree, tree));
3579 extern tree build_vfn_ref                       PARAMS ((tree *, tree, tree));
3580 extern tree get_vtable_decl                     PARAMS ((tree, int));
3581 extern void add_method                          PARAMS ((tree, tree *, tree));
3582 extern int currently_open_class                 PARAMS ((tree));
3583 extern tree currently_open_derived_class        PARAMS ((tree));
3584 extern tree get_vfield_offset                   PARAMS ((tree));
3585 extern void duplicate_tag_error                 PARAMS ((tree));
3586 extern tree finish_struct                       PARAMS ((tree, tree));
3587 extern void finish_struct_1                     PARAMS ((tree));
3588 extern int resolves_to_fixed_type_p             PARAMS ((tree, int *));
3589 extern void init_class_processing               PARAMS ((void));
3590 extern int is_empty_class                       PARAMS ((tree));
3591 extern void pushclass                           PARAMS ((tree, int));
3592 extern void popclass                            PARAMS ((void));
3593 extern void push_nested_class                   PARAMS ((tree, int));
3594 extern void pop_nested_class                    PARAMS ((void));
3595 extern void push_lang_context                   PARAMS ((tree));
3596 extern void pop_lang_context                    PARAMS ((void));
3597 extern tree instantiate_type                    PARAMS ((tree, tree, int));
3598 extern void print_class_statistics              PARAMS ((void));
3599 extern tree skip_rtti_stuff                     PARAMS ((tree, tree, unsigned HOST_WIDE_INT *));
3600 extern void build_self_reference                PARAMS ((void));
3601 extern void warn_hidden                         PARAMS ((tree));
3602 extern tree get_enclosing_class                 PARAMS ((tree));
3603 int is_base_of_enclosing_class                  PARAMS ((tree, tree));
3604 extern void unreverse_member_declarations       PARAMS ((tree));
3605 extern void invalidate_class_lookup_cache       PARAMS ((void));
3606 extern void maybe_note_name_used_in_class       PARAMS ((tree, tree));
3607 extern void note_name_declared_in_class         PARAMS ((tree, tree));
3608 extern tree num_extra_vtbl_entries              PARAMS ((tree));
3609 extern tree size_extra_vtbl_entries             PARAMS ((tree));
3610
3611 /* in cvt.c */
3612 extern tree convert_to_reference                PARAMS ((tree, tree, int, int, tree));
3613 extern tree convert_from_reference              PARAMS ((tree));
3614 extern tree convert_pointer_to_real             PARAMS ((tree, tree));
3615 extern tree convert_pointer_to                  PARAMS ((tree, tree));
3616 extern tree ocp_convert                         PARAMS ((tree, tree, int, int));
3617 extern tree cp_convert                          PARAMS ((tree, tree));
3618 extern tree convert_to_void                     PARAMS ((tree, const char */*implicit context*/));
3619 extern tree convert                             PARAMS ((tree, tree));
3620 extern tree convert_force                       PARAMS ((tree, tree, int));
3621 extern tree build_type_conversion               PARAMS ((tree, tree, int));
3622 extern tree build_expr_type_conversion          PARAMS ((int, tree, int));
3623 extern tree type_promotes_to                    PARAMS ((tree));
3624 extern tree perform_qualification_conversions   PARAMS ((tree, tree));
3625
3626 /* decl.c */
3627 /* resume_binding_level */
3628 extern void set_identifier_local_value          PARAMS ((tree, tree));
3629 extern int global_bindings_p                    PARAMS ((void));
3630 extern int toplevel_bindings_p                  PARAMS ((void));
3631 extern int namespace_bindings_p                 PARAMS ((void));
3632 extern void keep_next_level                     PARAMS ((int));
3633 extern int kept_level_p                         PARAMS ((void));
3634 extern void declare_pseudo_global_level         PARAMS ((void));
3635 extern int pseudo_global_level_p                PARAMS ((void));
3636 extern void set_class_shadows                   PARAMS ((tree));
3637 extern void pushlevel                           PARAMS ((int));
3638 extern void note_level_for_for                  PARAMS ((void));
3639 extern void resume_level                        PARAMS ((struct binding_level *));
3640 extern void delete_block                        PARAMS ((tree));
3641 extern void insert_block                        PARAMS ((tree));
3642 extern void add_block_current_level             PARAMS ((tree));
3643 extern void set_block                           PARAMS ((tree));
3644 extern void pushlevel_class                     PARAMS ((void));
3645 extern void poplevel_class                      PARAMS ((void));
3646 extern void print_binding_stack                 PARAMS ((void));
3647 extern void print_binding_level                 PARAMS ((struct binding_level *));
3648 extern void push_namespace                      PARAMS ((tree));
3649 extern void pop_namespace                       PARAMS ((void));
3650 extern void push_nested_namespace               PARAMS ((tree));
3651 extern void pop_nested_namespace                PARAMS ((tree));
3652 extern void maybe_push_to_top_level             PARAMS ((int));
3653 extern void push_to_top_level                   PARAMS ((void));
3654 extern void pop_from_top_level                  PARAMS ((void));
3655 extern tree identifier_type_value               PARAMS ((tree));
3656 extern void set_identifier_type_value           PARAMS ((tree, tree));
3657 extern void pop_everything                      PARAMS ((void));
3658 extern void pushtag                             PARAMS ((tree, tree, int));
3659 extern tree make_anon_name                      PARAMS ((void));
3660 extern void clear_anon_tags                     PARAMS ((void));
3661 extern int decls_match                          PARAMS ((tree, tree));
3662 extern int duplicate_decls                      PARAMS ((tree, tree));
3663 extern tree pushdecl                            PARAMS ((tree));
3664 extern tree pushdecl_top_level                  PARAMS ((tree));
3665 extern void pushdecl_class_level                PARAMS ((tree));
3666 #if 0
3667 extern void pushdecl_nonclass_level             PARAMS ((tree));
3668 #endif
3669 extern tree pushdecl_namespace_level            PARAMS ((tree));
3670 extern tree push_using_decl                     PARAMS ((tree, tree));
3671 extern tree push_using_directive                PARAMS ((tree));
3672 extern void push_class_level_binding            PARAMS ((tree, tree));
3673 extern tree implicitly_declare                  PARAMS ((tree));
3674 extern tree lookup_label                        PARAMS ((tree));
3675 extern tree declare_local_label                 PARAMS ((tree));
3676 extern tree define_label                        PARAMS ((char *, int, tree));
3677 extern void push_switch                         PARAMS ((void));
3678 extern void pop_switch                          PARAMS ((void));
3679 extern void define_case_label                   PARAMS ((void));
3680 extern tree getdecls                            PARAMS ((void));
3681 extern tree gettags                             PARAMS ((void));
3682 #if 0
3683 extern void set_current_level_tags_transparency PARAMS ((int));
3684 #endif
3685 extern tree binding_for_name                    PARAMS ((tree, tree));
3686 extern tree namespace_binding                   PARAMS ((tree, tree));
3687 extern void set_namespace_binding               PARAMS ((tree, tree, tree));
3688 extern tree lookup_namespace_name               PARAMS ((tree, tree));
3689 extern tree build_typename_type                 PARAMS ((tree, tree, tree, tree));
3690 extern tree make_typename_type                  PARAMS ((tree, tree, int));
3691 extern tree lookup_name_nonclass                PARAMS ((tree));
3692 extern tree lookup_function_nonclass            PARAMS ((tree, tree));
3693 extern tree lookup_name                         PARAMS ((tree, int));
3694 extern tree lookup_name_current_level           PARAMS ((tree));
3695 extern tree lookup_type_current_level           PARAMS ((tree));
3696 extern tree lookup_name_namespace_only          PARAMS ((tree));
3697 extern void begin_only_namespace_names          PARAMS ((void));
3698 extern void end_only_namespace_names            PARAMS ((void));
3699 extern tree namespace_ancestor                  PARAMS ((tree, tree));
3700 extern tree unqualified_namespace_lookup        PARAMS ((tree, int, tree *));
3701 extern int  lookup_using_namespace              PARAMS ((tree, tree, tree, tree, int, tree *));
3702 extern int  qualified_lookup_using_namespace    PARAMS ((tree, tree, tree, int));
3703 extern tree auto_function                       PARAMS ((tree, tree));
3704 extern void init_decl_processing                PARAMS ((void));
3705 extern int init_type_desc                       PARAMS ((void));
3706 extern tree define_function                     PARAMS ((const char *, tree,
3707                                                        void (*) (tree),
3708                                                        const char *));
3709 extern tree check_tag_decl                      PARAMS ((tree));
3710 extern void shadow_tag                          PARAMS ((tree));
3711 extern tree groktypename                        PARAMS ((tree));
3712 extern tree start_decl                          PARAMS ((tree, tree, int, tree, tree));
3713 extern void start_decl_1                        PARAMS ((tree));
3714 extern void cp_finish_decl                      PARAMS ((tree, tree, tree, int));
3715 extern void finish_decl                         PARAMS ((tree, tree, tree));
3716 extern void maybe_inject_for_scope_var          PARAMS ((tree));
3717 extern void initialize_local_var                PARAMS ((tree, tree, int));
3718 extern void expand_static_init                  PARAMS ((tree, tree));
3719 extern tree start_handler_parms                 PARAMS ((tree, tree));
3720 extern int complete_array_type                  PARAMS ((tree, tree, int));
3721 extern tree build_ptrmemfunc_type               PARAMS ((tree));
3722 /* the grokdeclarator prototype is in decl.h */
3723 extern int parmlist_is_exprlist                 PARAMS ((tree));
3724 extern int copy_args_p                          PARAMS ((tree));
3725 extern int grok_ctor_properties                 PARAMS ((tree, tree));
3726 extern void grok_op_properties                  PARAMS ((tree, int, int));
3727 extern tree xref_tag                            PARAMS ((tree, tree, int));
3728 extern tree xref_tag_from_type                  PARAMS ((tree, tree, int));
3729 extern void xref_basetypes                      PARAMS ((tree, tree, tree, tree));
3730 extern tree start_enum                          PARAMS ((tree));
3731 extern tree finish_enum                         PARAMS ((tree));
3732 extern void build_enumerator                    PARAMS ((tree, tree, tree));
3733 extern int start_function                       PARAMS ((tree, tree, tree, int));
3734 extern void expand_start_early_try_stmts        PARAMS ((void));
3735 extern void store_parm_decls                    PARAMS ((void));
3736 extern void store_return_init                   PARAMS ((tree));
3737 extern tree finish_function                     PARAMS ((int, int));
3738 extern tree start_method                        PARAMS ((tree, tree, tree));
3739 extern tree finish_method                       PARAMS ((tree));
3740 extern void hack_incomplete_structures          PARAMS ((tree));
3741 extern tree maybe_build_cleanup_and_delete      PARAMS ((tree));
3742 extern tree maybe_build_cleanup                 PARAMS ((tree));
3743 extern void cplus_expand_expr_stmt              PARAMS ((tree));
3744 extern void finish_stmt                         PARAMS ((void));
3745 extern int in_function_p                        PARAMS ((void));
3746 extern void replace_defarg                      PARAMS ((tree, tree));
3747 extern void print_other_binding_stack           PARAMS ((struct binding_level *));
3748 extern void revert_static_member_fn             PARAMS ((tree*, tree*, tree*));
3749 extern void fixup_anonymous_aggr                PARAMS ((tree));
3750 extern int check_static_variable_definition     PARAMS ((tree, tree));
3751 extern tree compute_array_index_type            PARAMS ((tree, tree));
3752 extern void push_local_binding                  PARAMS ((tree, tree, int));
3753 extern int push_class_binding                   PARAMS ((tree, tree));
3754 extern tree check_default_argument              PARAMS ((tree, tree));
3755 extern tree push_overloaded_decl                PARAMS ((tree, int));
3756 extern void clear_identifier_class_values       PARAMS ((void));
3757 extern void storetags                           PARAMS ((tree));
3758 extern int vtable_decl_p                        PARAMS ((tree, void *));
3759 extern int vtype_decl_p                         PARAMS ((tree, void *));
3760 extern int sigtable_decl_p                      PARAMS ((tree, void *));
3761 typedef int (*walk_globals_pred)                PARAMS ((tree, void *));
3762 typedef int (*walk_globals_fn)                  PARAMS ((tree *, void *));
3763 extern int walk_globals                         PARAMS ((walk_globals_pred,
3764                                                        walk_globals_fn,
3765                                                        void *));
3766 typedef int (*walk_namespaces_fn)               PARAMS ((tree, void *));
3767 extern int walk_namespaces                      PARAMS ((walk_namespaces_fn,
3768                                                        void *));
3769 extern int wrapup_globals_for_namespace         PARAMS ((tree, void *));
3770 extern tree cp_namespace_decls                  PARAMS ((tree));
3771 extern tree create_implicit_typedef             PARAMS ((tree, tree));
3772 extern tree maybe_push_decl                     PARAMS ((tree));
3773 extern void emit_local_var                      PARAMS ((tree));
3774 extern tree build_target_expr_with_type         PARAMS ((tree, tree));
3775 extern void make_rtl_for_local_static           PARAMS ((tree));
3776 extern int local_variable_p                     PARAMS ((tree));
3777 extern int nonstatic_local_decl_p               PARAMS ((tree));
3778 extern tree declare_global_var                  PARAMS ((tree, tree));
3779 extern void register_dtor_fn                    PARAMS ((tree));
3780
3781 /* in decl2.c */
3782 extern void init_decl2                          PARAMS ((void));
3783 extern int check_java_method                    PARAMS ((tree));
3784 extern int lang_decode_option                   PARAMS ((int, char **));
3785 extern int grok_method_quals                    PARAMS ((tree, tree, tree));
3786 extern void warn_if_unknown_interface           PARAMS ((tree));
3787 extern void grok_x_components                   PARAMS ((tree));
3788 extern void maybe_retrofit_in_chrg              PARAMS ((tree));
3789 extern void maybe_make_one_only                 PARAMS ((tree));
3790 extern void grokclassfn                         PARAMS ((tree, tree, enum overload_flags, tree));
3791 extern tree grok_alignof                        PARAMS ((tree));
3792 extern tree grok_array_decl                     PARAMS ((tree, tree));
3793 extern tree delete_sanity                       PARAMS ((tree, tree, int, int));
3794 extern tree check_classfn                       PARAMS ((tree, tree));
3795 extern void check_member_template               PARAMS ((tree));
3796 extern tree grokfield                           PARAMS ((tree, tree, tree, tree, tree));
3797 extern tree grokbitfield                        PARAMS ((tree, tree, tree));
3798 extern tree groktypefield                       PARAMS ((tree, tree));
3799 extern tree grokoptypename                      PARAMS ((tree, tree));
3800 extern int copy_assignment_arg_p                PARAMS ((tree, int));
3801 extern void cplus_decl_attributes               PARAMS ((tree, tree, tree)); 
3802 extern tree constructor_name_full               PARAMS ((tree));
3803 extern tree constructor_name                    PARAMS ((tree));
3804 extern void setup_vtbl_ptr                      PARAMS ((void));
3805 extern void mark_inline_for_output              PARAMS ((tree));
3806 extern tree get_temp_name                       PARAMS ((tree, int));
3807 extern void finish_anon_union                   PARAMS ((tree));
3808 extern tree finish_table                        PARAMS ((tree, tree, tree, int));
3809 extern void finish_builtin_type                 PARAMS ((tree, const char *,
3810                                                        tree *, int, tree));
3811 extern tree coerce_new_type                     PARAMS ((tree));
3812 extern tree coerce_delete_type                  PARAMS ((tree));
3813 extern void comdat_linkage                      PARAMS ((tree));
3814 extern void import_export_class                 PARAMS ((tree));
3815 extern void import_export_vtable                PARAMS ((tree, tree, int));
3816 extern void import_export_decl                  PARAMS ((tree));
3817 extern tree build_cleanup                       PARAMS ((tree));
3818 extern void finish_file                         PARAMS ((void));
3819 extern tree reparse_absdcl_as_expr              PARAMS ((tree, tree));
3820 extern tree reparse_absdcl_as_casts             PARAMS ((tree, tree));
3821 extern tree build_expr_from_tree                PARAMS ((tree));
3822 extern tree reparse_decl_as_expr                PARAMS ((tree, tree));
3823 extern tree finish_decl_parsing                 PARAMS ((tree));
3824 extern tree check_cp_case_value                 PARAMS ((tree));
3825 extern void set_decl_namespace                  PARAMS ((tree, tree, int));
3826 extern tree current_decl_namespace              PARAMS ((void));
3827 extern void push_decl_namespace                 PARAMS ((tree));
3828 extern void pop_decl_namespace                  PARAMS ((void));
3829 extern void push_scope                          PARAMS ((tree));
3830 extern void pop_scope                           PARAMS ((tree));
3831 extern void do_namespace_alias                  PARAMS ((tree, tree));
3832 extern void do_toplevel_using_decl              PARAMS ((tree));
3833 extern void do_local_using_decl                 PARAMS ((tree));
3834 extern tree do_class_using_decl                 PARAMS ((tree));
3835 extern void do_using_directive                  PARAMS ((tree));
3836 extern void check_default_args                  PARAMS ((tree));
3837 extern void mark_used                           PARAMS ((tree));
3838 extern tree handle_class_head                   PARAMS ((tree, tree, tree));
3839 extern tree lookup_arg_dependent                PARAMS ((tree, tree, tree));
3840 extern void finish_static_data_member_decl      PARAMS ((tree, tree, tree, int));
3841
3842 /* in parse.y */
3843 extern void cp_parse_init                       PARAMS ((void));
3844
3845 /* in errfn.c */
3846 /* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */
3847 extern void cp_error                            PARAMS ((const char *, ...));
3848 extern void cp_error_at                         PARAMS ((const char *, ...));
3849 extern void cp_warning                          PARAMS ((const char *, ...));
3850 extern void cp_warning_at                       PARAMS ((const char *, ...));
3851 extern void cp_pedwarn                          PARAMS ((const char *, ...));
3852 extern void cp_pedwarn_at                       PARAMS ((const char *, ...));
3853 extern void cp_compiler_error                   PARAMS ((const char *, ...));
3854 extern void cp_sprintf                          PARAMS ((const char *, ...));
3855 extern void cp_deprecated                       PARAMS ((const char*));
3856
3857 /* in error.c */
3858 extern void init_error                          PARAMS ((void));
3859 extern const char *type_as_string               PARAMS ((tree, enum tree_string_flags));
3860 extern const char *decl_as_string               PARAMS ((tree, enum tree_string_flags));
3861 extern const char *expr_as_string               PARAMS ((tree, enum tree_string_flags));
3862 extern const char *context_as_string            PARAMS ((tree, enum tree_string_flags));
3863 extern const char *lang_decl_name               PARAMS ((tree, int));
3864 extern const char *cp_file_of                   PARAMS ((tree));
3865 extern int cp_line_of                           PARAMS ((tree));
3866
3867 /* in except.c */
3868 extern void init_exception_processing           PARAMS ((void));
3869 extern tree expand_start_catch_block            PARAMS ((tree));
3870 extern void expand_end_catch_block              PARAMS ((tree));
3871 extern void expand_builtin_throw                PARAMS ((void));
3872 extern tree expand_start_eh_spec                PARAMS ((void));
3873 extern void expand_end_eh_spec                  PARAMS ((tree, tree));
3874 extern void expand_exception_blocks             PARAMS ((void));
3875 extern tree build_throw                         PARAMS ((tree));
3876 extern void mark_all_runtime_matches            PARAMS ((void));
3877
3878 /* in expr.c */
3879 extern void init_cplus_expand                   PARAMS ((void));
3880 extern void fixup_result_decl                   PARAMS ((tree, struct rtx_def *));
3881 extern int extract_init                         PARAMS ((tree, tree));
3882 extern void do_case                             PARAMS ((tree, tree));
3883 extern tree cplus_expand_constant               PARAMS ((tree));
3884
3885 /* friend.c */
3886 extern int is_friend                            PARAMS ((tree, tree));
3887 extern void make_friend_class                   PARAMS ((tree, tree));
3888 extern void add_friend                          PARAMS ((tree, tree));
3889 extern tree do_friend                           PARAMS ((tree, tree, tree, tree, tree, enum overload_flags, tree, int));
3890
3891 /* in init.c */
3892 extern void init_init_processing                PARAMS ((void));
3893 extern tree emit_base_init                      PARAMS ((tree));
3894 extern void check_base_init                     PARAMS ((tree));
3895 extern void expand_member_init                  PARAMS ((tree, tree, tree));
3896 extern tree build_aggr_init                     PARAMS ((tree, tree, int));
3897 extern int is_aggr_typedef                      PARAMS ((tree, int));
3898 extern int is_aggr_type                         PARAMS ((tree, int));
3899 extern tree get_aggr_from_typedef               PARAMS ((tree, int));
3900 extern tree get_type_value                      PARAMS ((tree));
3901 extern tree build_member_call                   PARAMS ((tree, tree, tree));
3902 extern tree build_offset_ref                    PARAMS ((tree, tree));
3903 extern tree resolve_offset_ref                  PARAMS ((tree));
3904 extern tree decl_constant_value                 PARAMS ((tree));
3905 extern tree build_new                           PARAMS ((tree, tree, tree, int));
3906 extern tree build_new_1                         PARAMS ((tree));
3907 extern tree build_vec_init                      PARAMS ((tree, tree, tree, tree, int));
3908 extern tree build_x_delete                      PARAMS ((tree, int, tree));
3909 extern tree build_delete                        PARAMS ((tree, tree, tree, int, int));
3910 extern tree build_vbase_delete                  PARAMS ((tree, tree));
3911 extern tree build_vec_delete                    PARAMS ((tree, tree, tree, int));
3912 extern tree create_temporary_var                PARAMS ((tree));
3913 extern void begin_init_stmts                    PARAMS ((tree *, tree *));
3914 extern tree finish_init_stmts                   PARAMS ((tree, tree));
3915 extern void initialize_vtbl_ptrs                PARAMS ((tree, tree));
3916
3917 /* in input.c */
3918
3919 /* in lex.c */
3920 extern char *file_name_nondirectory             PARAMS ((const char *));
3921 extern tree make_pointer_declarator             PARAMS ((tree, tree));
3922 extern tree make_reference_declarator           PARAMS ((tree, tree));
3923 extern tree make_call_declarator                PARAMS ((tree, tree, tree, tree));
3924 extern void set_quals_and_spec                  PARAMS ((tree, tree, tree));
3925 extern const char *operator_name_string         PARAMS ((tree));
3926 extern void lang_init                           PARAMS ((void));
3927 extern void lang_finish                         PARAMS ((void));
3928 #if 0
3929 extern void reinit_lang_specific                PARAMS ((void));
3930 #endif
3931 extern void reinit_parse_for_function           PARAMS ((void));
3932 extern void print_parse_statistics              PARAMS ((void));
3933 extern void extract_interface_info              PARAMS ((void));
3934 extern void do_pending_inlines                  PARAMS ((void));
3935 extern void process_next_inline                 PARAMS ((struct pending_inline *));
3936 extern struct pending_input *save_pending_input PARAMS ((void));
3937 extern void restore_pending_input               PARAMS ((struct pending_input *));
3938 extern void yyungetc                            PARAMS ((int, int));
3939 extern void reinit_parse_for_method             PARAMS ((int, tree));
3940 extern void reinit_parse_for_block              PARAMS ((int, struct obstack *));
3941 extern tree cons_up_default_function            PARAMS ((tree, tree, int));
3942 extern void check_for_missing_semicolon         PARAMS ((tree));
3943 extern void note_got_semicolon                  PARAMS ((tree));
3944 extern void note_list_got_semicolon             PARAMS ((tree));
3945 extern void do_pending_lang_change              PARAMS ((void));
3946 extern int identifier_type                      PARAMS ((tree));
3947 extern void see_typename                        PARAMS ((void));
3948 extern tree do_identifier                       PARAMS ((tree, int, tree));
3949 extern tree do_scoped_id                        PARAMS ((tree, int));
3950 extern tree identifier_typedecl_value           PARAMS ((tree));
3951 extern int real_yylex                           PARAMS ((void));
3952 extern int is_rid                               PARAMS ((tree));
3953 extern tree build_lang_decl                     PARAMS ((enum tree_code, tree, tree));
3954 extern void retrofit_lang_decl                  PARAMS ((tree));
3955 extern void copy_lang_decl                      PARAMS ((tree));
3956 extern tree cp_make_lang_type                   PARAMS ((enum tree_code));
3957 extern tree make_aggr_type                      PARAMS ((enum tree_code));
3958 extern void dump_time_statistics                PARAMS ((void));
3959 extern void compiler_error                      PARAMS ((const char *, ...))
3960   ATTRIBUTE_PRINTF_1;
3961 extern void yyerror                             PARAMS ((const char *));
3962 extern void clear_inline_text_obstack           PARAMS ((void));
3963 extern void maybe_snarf_defarg                  PARAMS ((void));
3964 extern tree snarf_defarg                        PARAMS ((void));
3965 extern void add_defarg_fn                       PARAMS ((tree));
3966 extern void do_pending_defargs                  PARAMS ((void));
3967 extern int identifier_type                      PARAMS ((tree));
3968 extern void yyhook                              PARAMS ((int));
3969 extern int cp_type_qual_from_rid                PARAMS ((tree));
3970
3971 /* in method.c */
3972 extern void init_method                         PARAMS ((void));
3973 extern char *build_overload_name                PARAMS ((tree, int, int));
3974 extern tree build_static_name                   PARAMS ((tree, tree));
3975 extern tree build_decl_overload                 PARAMS ((tree, tree, int));
3976 extern tree build_decl_overload_real            PARAMS ((tree, tree, tree, tree,
3977                                                        tree, int)); 
3978 extern void set_mangled_name_for_decl           PARAMS ((tree));
3979 extern tree build_typename_overload             PARAMS ((tree));
3980 extern tree build_overload_with_type            PARAMS ((tree, tree));
3981 extern tree build_destructor_name               PARAMS ((tree));
3982 extern tree build_opfncall                      PARAMS ((enum tree_code, int, tree, tree, tree));
3983 extern tree hack_identifier                     PARAMS ((tree, tree));
3984 extern tree make_thunk                          PARAMS ((tree, int, int));
3985 extern void emit_thunk                          PARAMS ((tree));
3986 extern void synthesize_method                   PARAMS ((tree));
3987 extern tree get_id_2                            PARAMS ((const char *, tree));
3988
3989 /* In optimize.c */
3990 extern void optimize_function                   PARAMS ((tree));
3991 extern int calls_setjmp_p                       PARAMS ((tree));
3992
3993 /* in pt.c */
3994 extern void init_pt                             PARAMS ((void));
3995 extern void check_template_shadow               PARAMS ((tree));
3996 extern tree innermost_args                      PARAMS ((tree));
3997 extern tree tsubst                              PARAMS ((tree, tree, int, tree));
3998 extern tree tsubst_expr                         PARAMS ((tree, tree, int, tree));
3999 extern tree tsubst_copy                         PARAMS ((tree, tree, int, tree));
4000 extern void maybe_begin_member_template_processing PARAMS ((tree));
4001 extern void maybe_end_member_template_processing PARAMS ((void));
4002 extern tree finish_member_template_decl         PARAMS ((tree));
4003 extern void begin_template_parm_list            PARAMS ((void));
4004 extern void begin_specialization                PARAMS ((void));
4005 extern void reset_specialization                PARAMS ((void));
4006 extern void end_specialization                  PARAMS ((void));
4007 extern void begin_explicit_instantiation        PARAMS ((void));
4008 extern void end_explicit_instantiation          PARAMS ((void));
4009 extern tree check_explicit_specialization       PARAMS ((tree, tree, int, int));
4010 extern tree process_template_parm               PARAMS ((tree, tree));
4011 extern tree end_template_parm_list              PARAMS ((tree));
4012 extern void end_template_decl                   PARAMS ((void));
4013 extern tree current_template_args               PARAMS ((void));
4014 extern tree push_template_decl                  PARAMS ((tree));
4015 extern tree push_template_decl_real             PARAMS ((tree, int));
4016 extern void redeclare_class_template            PARAMS ((tree, tree));
4017 extern tree lookup_template_class               PARAMS ((tree, tree, tree, tree, int));
4018 extern tree lookup_template_function            PARAMS ((tree, tree));
4019 extern int uses_template_parms                  PARAMS ((tree));
4020 extern tree instantiate_class_template          PARAMS ((tree));
4021 extern tree instantiate_template                PARAMS ((tree, tree));
4022 extern void overload_template_name              PARAMS ((tree));
4023 extern int fn_type_unification                  PARAMS ((tree, tree, tree, tree, tree, unification_kind_t));
4024 struct tinst_level *tinst_for_decl              PARAMS ((void));
4025 extern void mark_decl_instantiated              PARAMS ((tree, int));
4026 extern int more_specialized                     PARAMS ((tree, tree, tree));
4027 extern void mark_class_instantiated             PARAMS ((tree, int));
4028 extern void do_decl_instantiation               PARAMS ((tree, tree, tree));
4029 extern void do_type_instantiation               PARAMS ((tree, tree));
4030 extern tree instantiate_decl                    PARAMS ((tree));
4031 extern tree get_bindings                        PARAMS ((tree, tree, tree));
4032 extern void add_tree                            PARAMS ((tree));
4033 extern void add_maybe_template                  PARAMS ((tree, tree));
4034 extern void pop_tinst_level                     PARAMS ((void));
4035 extern int more_specialized_class               PARAMS ((tree, tree));
4036 extern int is_member_template                   PARAMS ((tree));
4037 extern int template_parms_equal                 PARAMS ((tree, tree));
4038 extern int comp_template_parms                  PARAMS ((tree, tree));
4039 extern int template_class_depth                 PARAMS ((tree));
4040 extern int is_specialization_of                 PARAMS ((tree, tree));
4041 extern int comp_template_args                   PARAMS ((tree, tree));
4042 extern void maybe_process_partial_specialization PARAMS ((tree));
4043 extern void maybe_check_template_type           PARAMS ((tree));
4044 extern tree most_specialized_instantiation      PARAMS ((tree, tree));
4045 extern void print_candidates                    PARAMS ((tree));
4046 extern int instantiate_pending_templates        PARAMS ((void));
4047 extern tree tsubst_default_argument             PARAMS ((tree, tree, tree));
4048 extern tree most_general_template               PARAMS ((tree));
4049
4050 extern int processing_template_parmlist;
4051
4052 /* in repo.c */
4053 extern void repo_template_used                  PARAMS ((tree));
4054 extern void repo_template_instantiated          PARAMS ((tree, int));
4055 extern void init_repo                           PARAMS ((const char *));
4056 extern void finish_repo                         PARAMS ((void));
4057
4058 /* in rtti.c */
4059 extern void init_rtti_processing                PARAMS((void));
4060 extern tree build_typeid                        PARAMS((tree));
4061 extern tree get_tinfo_decl                      PARAMS((tree));
4062 extern tree get_typeid                          PARAMS((tree));
4063 extern tree get_typeid_1                        PARAMS((tree));
4064 extern tree build_dynamic_cast                  PARAMS((tree, tree));
4065 extern void synthesize_tinfo_fn                 PARAMS((tree));
4066 extern void emit_support_tinfos                 PARAMS((void));
4067 extern int tinfo_decl_p                         PARAMS((tree, void *));
4068 extern int emit_tinfo_decl                      PARAMS((tree *, void *));
4069
4070 /* in search.c */
4071 extern int types_overlap_p                      PARAMS ((tree, tree));
4072 extern tree get_vbase                           PARAMS ((tree, tree));
4073 extern tree get_binfo                           PARAMS ((tree, tree, int));
4074 extern int get_base_distance                    PARAMS ((tree, tree, int, tree *));
4075 extern tree get_dynamic_cast_base_type          PARAMS ((tree, tree));
4076 extern void type_access_control                 PARAMS ((tree, tree));
4077 extern int accessible_p                         PARAMS ((tree, tree));
4078 extern tree lookup_field                        PARAMS ((tree, tree, int, int));
4079 extern int lookup_fnfields_1                    PARAMS ((tree, tree));
4080 extern tree lookup_fnfields                     PARAMS ((tree, tree, int));
4081 extern tree lookup_member                       PARAMS ((tree, tree, int, int));
4082 extern tree lookup_nested_tag                   PARAMS ((tree, tree));
4083 extern tree get_matching_virtual                PARAMS ((tree, tree, int));
4084 extern void get_pure_virtuals                   PARAMS ((tree));
4085 extern tree init_vbase_pointers                 PARAMS ((tree, tree));
4086 extern void expand_indirect_vtbls_init          PARAMS ((tree, tree));
4087 extern void clear_search_slots                  PARAMS ((tree));
4088 extern void get_vbase_types                     PARAMS ((tree));
4089 extern void maybe_suppress_debug_info           PARAMS ((tree));
4090 extern void note_debug_info_needed              PARAMS ((tree));
4091 extern void push_class_decls                    PARAMS ((tree));
4092 extern void pop_class_decls                     PARAMS ((void));
4093 extern void unuse_fields                        PARAMS ((tree));
4094 extern void print_search_statistics             PARAMS ((void));
4095 extern void init_search_processing              PARAMS ((void));
4096 extern void reinit_search_statistics            PARAMS ((void));
4097 extern tree current_scope                       PARAMS ((void));
4098 extern int at_function_scope_p                  PARAMS ((void));
4099 extern tree lookup_conversions                  PARAMS ((tree));
4100 extern tree binfo_for_vtable                    PARAMS ((tree));
4101 extern int  binfo_from_vbase                    PARAMS ((tree));
4102 extern tree dfs_walk                            PARAMS ((tree, 
4103                                                        tree (*)(tree, void *),
4104                                                        tree (*) (tree, void *),
4105                                                        void *));
4106 extern tree dfs_walk_real                      PARAMS ((tree, 
4107                                                        tree (*) (tree, void *),
4108                                                        tree (*) (tree, void *),
4109                                                        tree (*) (tree, void *),
4110                                                        void *));
4111 extern tree dfs_unmark                          PARAMS ((tree, void *));
4112 extern tree dfs_vbase_unmark                    PARAMS ((tree, void *));
4113 extern tree dfs_vtable_path_unmark              PARAMS ((tree, void *));
4114 extern tree markedp                             PARAMS ((tree, void *));
4115 extern tree unmarkedp                           PARAMS ((tree, void *));
4116 extern tree dfs_skip_nonprimary_vbases_unmarkedp PARAMS ((tree, void *));
4117 extern tree dfs_skip_nonprimary_vbases_markedp  PARAMS ((tree, void *));
4118 extern tree dfs_unmarked_real_bases_queue_p     PARAMS ((tree, void *));
4119 extern tree dfs_marked_real_bases_queue_p       PARAMS ((tree, void *));
4120 extern tree dfs_vtable_path_unmarked_real_bases_queue_p
4121                                                 PARAMS ((tree, void *));
4122 extern tree dfs_vtable_path_marked_real_bases_queue_p
4123                                                 PARAMS ((tree, void *));
4124 extern tree dfs_skip_vbases                     PARAMS ((tree, void *));
4125 extern void mark_primary_bases                  PARAMS ((tree));
4126 extern tree convert_pointer_to_vbase            PARAMS ((tree, tree));
4127 extern tree find_vbase_instance                 PARAMS ((tree, tree));
4128
4129 /* in semantics.c */
4130 extern void finish_expr_stmt                    PARAMS ((tree));
4131 extern tree begin_if_stmt                       PARAMS ((void));
4132 extern void finish_if_stmt_cond                 PARAMS ((tree, tree));
4133 extern tree finish_then_clause                  PARAMS ((tree));
4134 extern void begin_else_clause                   PARAMS ((void));
4135 extern void finish_else_clause                  PARAMS ((tree));
4136 extern void finish_if_stmt                      PARAMS ((void));
4137 extern tree begin_while_stmt                    PARAMS ((void));
4138 extern void finish_while_stmt_cond              PARAMS ((tree, tree));
4139 extern void finish_while_stmt                   PARAMS ((tree));
4140 extern tree begin_do_stmt                       PARAMS ((void));
4141 extern void finish_do_body                      PARAMS ((tree));
4142 extern void finish_do_stmt                      PARAMS ((tree, tree));
4143 extern void finish_return_stmt                  PARAMS ((tree));
4144 extern tree begin_for_stmt                      PARAMS ((void));
4145 extern void finish_for_init_stmt                PARAMS ((tree));
4146 extern void finish_for_cond                     PARAMS ((tree, tree));
4147 extern void finish_for_expr                     PARAMS ((tree, tree));
4148 extern void finish_for_stmt                     PARAMS ((tree, tree));
4149 extern void finish_break_stmt                   PARAMS ((void));
4150 extern void finish_continue_stmt                PARAMS ((void));
4151 extern tree begin_switch_stmt                   PARAMS ((void));
4152 extern void finish_switch_cond                  PARAMS ((tree, tree));
4153 extern void finish_switch_stmt                  PARAMS ((tree, tree));
4154 extern void finish_case_label                   PARAMS ((tree, tree));
4155 extern void finish_goto_stmt                    PARAMS ((tree));
4156 extern tree begin_try_block                     PARAMS ((void));
4157 extern void finish_try_block                    PARAMS ((tree));
4158 extern void finish_handler_sequence             PARAMS ((tree));
4159 extern tree begin_function_try_block            PARAMS ((void));
4160 extern void finish_function_try_block           PARAMS ((tree));
4161 extern void finish_function_handler_sequence    PARAMS ((tree));
4162 extern void finish_cleanup_try_block            PARAMS ((tree));
4163 extern tree begin_handler                       PARAMS ((void));
4164 extern tree finish_handler_parms                PARAMS ((tree, tree));
4165 extern void begin_catch_block                   PARAMS ((tree));
4166 extern void finish_handler                      PARAMS ((tree, tree));
4167 extern void finish_cleanup                      PARAMS ((tree, tree));
4168 extern tree begin_compound_stmt                 PARAMS ((int));
4169 extern tree finish_compound_stmt                PARAMS ((int, tree));
4170 extern void finish_asm_stmt                     PARAMS ((tree, tree, tree, tree, tree));
4171 extern void finish_label_stmt                   PARAMS ((tree));
4172 extern void finish_label_decl                   PARAMS ((tree));
4173 extern void finish_subobject                    PARAMS ((tree));
4174 extern tree finish_parenthesized_expr           PARAMS ((tree));
4175 extern tree begin_stmt_expr                     PARAMS ((void));
4176 extern tree finish_stmt_expr                    PARAMS ((tree));
4177 extern tree finish_call_expr                    PARAMS ((tree, tree, int));
4178 extern tree finish_increment_expr               PARAMS ((tree, enum tree_code));
4179 extern tree finish_this_expr                    PARAMS ((void));
4180 extern tree finish_object_call_expr             PARAMS ((tree, tree, tree));
4181 extern tree finish_qualified_object_call_expr   PARAMS ((tree, tree, tree));
4182 extern tree finish_pseudo_destructor_call_expr  PARAMS ((tree, tree, tree));
4183 extern tree finish_qualified_call_expr          PARAMS ((tree, tree));
4184 extern tree finish_label_address_expr           PARAMS ((tree));
4185 extern tree finish_unary_op_expr                PARAMS ((enum tree_code, tree));
4186 extern tree finish_id_expr                      PARAMS ((tree));
4187 extern void save_type_access_control            PARAMS ((tree));
4188 extern void decl_type_access_control            PARAMS ((tree));
4189 extern int begin_function_definition            PARAMS ((tree, tree));
4190 extern tree begin_constructor_declarator        PARAMS ((tree, tree));
4191 extern tree finish_declarator                   PARAMS ((tree, tree, tree, tree, int));
4192 extern void finish_translation_unit             PARAMS ((void));
4193 extern tree finish_template_type_parm           PARAMS ((tree, tree));
4194 extern tree finish_template_template_parm       PARAMS ((tree, tree));
4195 extern tree finish_parmlist                     PARAMS ((tree, int));
4196 extern tree begin_class_definition              PARAMS ((tree));
4197 extern tree finish_class_definition             PARAMS ((tree, tree, int, int));
4198 extern void finish_default_args                 PARAMS ((void));
4199 extern void begin_inline_definitions            PARAMS ((void));
4200 extern void finish_inline_definitions           PARAMS ((void));
4201 extern tree finish_member_class_template        PARAMS ((tree));
4202 extern void finish_template_decl                PARAMS ((tree));
4203 extern tree finish_template_type                PARAMS ((tree, tree, int));
4204 extern void enter_scope_of                      PARAMS ((tree));
4205 extern tree finish_base_specifier               PARAMS ((tree, tree));
4206 extern void finish_member_declaration           PARAMS ((tree));
4207 extern void check_multiple_declarators          PARAMS ((void));
4208 extern tree finish_typeof                       PARAMS ((tree));
4209 extern void add_decl_stmt                       PARAMS ((tree));
4210 extern void finish_decl_cleanup                 PARAMS ((tree, tree));
4211 extern void finish_named_return_value           PARAMS ((tree, tree));
4212 extern tree expand_stmt                         PARAMS ((tree));
4213 extern void expand_body                         PARAMS ((tree));
4214 extern void begin_stmt_tree                     PARAMS ((tree *));
4215 extern void finish_stmt_tree                    PARAMS ((tree *));
4216 extern void prep_stmt                           PARAMS ((tree));
4217 extern tree add_scope_stmt                      PARAMS ((int, int));
4218 extern void do_pushlevel                        PARAMS ((void));
4219 extern tree do_poplevel                         PARAMS ((void));
4220 /* Non-zero if we are presently building a statement tree, rather
4221    than expanding each statement as we encounter it.  */
4222 #define building_stmt_tree() (last_tree != NULL_TREE)
4223
4224 /* in spew.c */
4225 extern void init_spew                           PARAMS ((void));
4226 extern int peekyylex                            PARAMS ((void));
4227 extern int yylex                                PARAMS ((void));
4228 extern tree arbitrate_lookup                    PARAMS ((tree, tree, tree));
4229
4230 /* in tree.c */
4231 extern void init_tree                           PARAMS ((void));
4232 extern int pod_type_p                           PARAMS ((tree));
4233 extern void unshare_base_binfos                 PARAMS ((tree));
4234 extern int member_p                             PARAMS ((tree));
4235 extern cp_lvalue_kind real_lvalue_p             PARAMS ((tree));
4236 extern tree build_min                           PARAMS ((enum tree_code, tree, ...));
4237 extern tree build_min_nt                        PARAMS ((enum tree_code, ...));
4238 extern int lvalue_p                             PARAMS ((tree));
4239 extern int lvalue_or_else                       PARAMS ((tree, const char *));
4240 extern tree build_cplus_new                     PARAMS ((tree, tree));
4241 extern tree get_target_expr                     PARAMS ((tree));
4242 extern tree break_out_cleanups                  PARAMS ((tree));
4243 extern tree break_out_calls                     PARAMS ((tree));
4244 extern tree build_cplus_method_type             PARAMS ((tree, tree, tree));
4245 extern tree build_cplus_staticfn_type           PARAMS ((tree, tree, tree));
4246 extern tree build_cplus_array_type              PARAMS ((tree, tree));
4247 extern tree hash_tree_cons                      PARAMS ((tree, tree, tree));
4248 extern tree hash_tree_chain                     PARAMS ((tree, tree));
4249 extern tree hash_chainon                        PARAMS ((tree, tree));
4250 extern tree make_binfo                          PARAMS ((tree, tree, tree, tree));
4251 extern tree binfo_value                         PARAMS ((tree, tree));
4252 extern tree reverse_path                        PARAMS ((tree));
4253 extern int count_functions                      PARAMS ((tree));
4254 extern int is_overloaded_fn                     PARAMS ((tree));
4255 extern tree get_first_fn                        PARAMS ((tree));
4256 extern int bound_pmf_p                          PARAMS ((tree));
4257 extern tree ovl_cons                            PARAMS ((tree, tree));
4258 extern int ovl_member                           PARAMS ((tree, tree));
4259 extern tree build_overload                      PARAMS ((tree, tree));
4260 extern tree fnaddr_from_vtable_entry            PARAMS ((tree));
4261 extern tree function_arg_chain                  PARAMS ((tree));
4262 extern int promotes_to_aggr_type                PARAMS ((tree, enum tree_code));
4263 extern int is_aggr_type_2                       PARAMS ((tree, tree));
4264 extern const char *lang_printable_name          PARAMS ((tree, int));
4265 extern tree build_exception_variant             PARAMS ((tree, tree));
4266 extern tree copy_template_template_parm         PARAMS ((tree));
4267 extern void print_lang_statistics               PARAMS ((void));
4268 extern tree array_type_nelts_total              PARAMS ((tree));
4269 extern tree array_type_nelts_top                PARAMS ((tree));
4270 extern tree break_out_target_exprs              PARAMS ((tree));
4271 extern tree get_type_decl                       PARAMS ((tree));
4272 extern tree vec_binfo_member                    PARAMS ((tree, tree));
4273 extern tree decl_namespace_context              PARAMS ((tree));
4274 extern tree lvalue_type                         PARAMS ((tree));
4275 extern tree error_type                          PARAMS ((tree));
4276 extern tree build_ptr_wrapper                   PARAMS ((void *));
4277 extern tree build_expr_ptr_wrapper              PARAMS ((void *));
4278 extern tree build_int_wrapper                   PARAMS ((int));
4279 extern tree build_srcloc_here                   PARAMS ((void));
4280 extern int varargs_function_p                   PARAMS ((tree));
4281 extern int really_overloaded_fn                 PARAMS ((tree));
4282 extern int cp_tree_equal                        PARAMS ((tree, tree));
4283 extern int can_free                             PARAMS ((struct obstack *, tree));
4284 extern tree no_linkage_check                    PARAMS ((tree));
4285 extern void debug_binfo                         PARAMS ((tree));
4286 extern tree build_dummy_object                  PARAMS ((tree));
4287 extern tree maybe_dummy_object                  PARAMS ((tree, tree *));
4288 extern int is_dummy_object                      PARAMS ((tree));
4289 typedef tree (*walk_tree_fn)                    PARAMS ((tree *, int *, void *));
4290 extern tree walk_tree                           PARAMS ((tree *, walk_tree_fn, void *));
4291 extern tree copy_tree_r                         PARAMS ((tree *, int *, void *));
4292 extern int cp_valid_lang_attribute              PARAMS ((tree, tree, tree, tree));
4293 extern tree make_ptrmem_cst                     PARAMS ((tree, tree));
4294 extern tree cp_build_qualified_type_real        PARAMS ((tree, int, int));
4295 extern void remap_save_expr                     PARAMS ((tree *, splay_tree, tree, int *));
4296 #define cp_build_qualified_type(TYPE, QUALS) \
4297   cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1)
4298 extern tree build_shared_int_cst                PARAMS ((int));
4299
4300 /* in typeck.c */
4301 extern int string_conv_p                        PARAMS ((tree, tree, int));
4302 extern tree condition_conversion                PARAMS ((tree));
4303 extern tree target_type                         PARAMS ((tree));
4304 extern tree require_complete_type               PARAMS ((tree));
4305 extern tree complete_type                       PARAMS ((tree));
4306 extern tree complete_type_or_else               PARAMS ((tree, tree));
4307 extern int type_unknown_p                       PARAMS ((tree));
4308 extern int fntype_p                             PARAMS ((tree));
4309 extern tree commonparms                         PARAMS ((tree, tree));
4310 extern tree original_type                       PARAMS ((tree));
4311 extern tree common_type                         PARAMS ((tree, tree));
4312 extern int comp_except_specs                    PARAMS ((tree, tree, int));
4313 extern int comptypes                            PARAMS ((tree, tree, int));
4314 extern int comp_target_types                    PARAMS ((tree, tree, int));
4315 extern int compparms                            PARAMS ((tree, tree));
4316 extern int comp_target_types                    PARAMS ((tree, tree, int));
4317 extern int comp_cv_qualification                PARAMS ((tree, tree));
4318 extern int comp_cv_qual_signature               PARAMS ((tree, tree));
4319 extern tree unsigned_type                       PARAMS ((tree));
4320 extern tree signed_type                         PARAMS ((tree));
4321 extern tree signed_or_unsigned_type             PARAMS ((int, tree));
4322 extern tree expr_sizeof                         PARAMS ((tree));
4323 extern tree c_sizeof                            PARAMS ((tree));
4324 extern tree c_sizeof_nowarn                     PARAMS ((tree));
4325 extern tree c_alignof                           PARAMS ((tree));
4326 extern tree inline_conversion                   PARAMS ((tree));
4327 extern tree decay_conversion                    PARAMS ((tree));
4328 extern tree default_conversion                  PARAMS ((tree));
4329 extern tree build_object_ref                    PARAMS ((tree, tree, tree));
4330 extern tree build_component_ref_1               PARAMS ((tree, tree, int));
4331 extern tree build_component_ref                 PARAMS ((tree, tree, tree, int));
4332 extern tree build_x_component_ref               PARAMS ((tree, tree, tree, int));
4333 extern tree build_x_indirect_ref                PARAMS ((tree, const char *));
4334 extern tree build_indirect_ref                  PARAMS ((tree, const char *));
4335 extern tree build_array_ref                     PARAMS ((tree, tree));
4336 extern tree build_x_function_call               PARAMS ((tree, tree, tree));
4337 extern tree get_member_function_from_ptrfunc    PARAMS ((tree *, tree));
4338 extern tree build_function_call_real            PARAMS ((tree, tree, int, int));
4339 extern tree build_function_call                 PARAMS ((tree, tree));
4340 extern tree build_function_call_maybe           PARAMS ((tree, tree));
4341 extern tree convert_arguments                   PARAMS ((tree, tree, tree, int));
4342 extern tree build_x_binary_op                   PARAMS ((enum tree_code, tree, tree));
4343 extern tree build_binary_op                     PARAMS ((enum tree_code, tree, tree));
4344 extern tree build_binary_op_nodefault           PARAMS ((enum tree_code, tree, tree, enum tree_code));
4345 extern tree build_x_unary_op                    PARAMS ((enum tree_code, tree));
4346 extern tree build_unary_op                      PARAMS ((enum tree_code, tree, int));
4347 extern tree unary_complex_lvalue                PARAMS ((enum tree_code, tree));
4348 extern int mark_addressable                     PARAMS ((tree));
4349 extern tree build_x_conditional_expr            PARAMS ((tree, tree, tree));
4350 extern tree build_conditional_expr              PARAMS ((tree, tree, tree));
4351 extern tree build_x_compound_expr               PARAMS ((tree));
4352 extern tree build_compound_expr                 PARAMS ((tree));
4353 extern tree build_static_cast                   PARAMS ((tree, tree));
4354 extern tree build_reinterpret_cast              PARAMS ((tree, tree));
4355 extern tree build_const_cast                    PARAMS ((tree, tree));
4356 extern tree build_c_cast                        PARAMS ((tree, tree));
4357 extern tree build_x_modify_expr                 PARAMS ((tree, enum tree_code, tree));
4358 extern tree build_modify_expr                   PARAMS ((tree, enum tree_code, tree));
4359 extern tree convert_for_initialization          PARAMS ((tree, tree, tree, int, const char *, tree, int));
4360 extern void c_expand_asm_operands               PARAMS ((tree, tree, tree, tree, int, char *, int));
4361 extern void c_expand_return                     PARAMS ((tree));
4362 extern tree c_expand_start_case                 PARAMS ((tree));
4363 extern int comp_ptr_ttypes                      PARAMS ((tree, tree));
4364 extern int ptr_reasonably_similar               PARAMS ((tree, tree));
4365 extern tree build_ptrmemfunc                    PARAMS ((tree, tree, int));
4366 extern tree strip_array_types                   PARAMS ((tree));
4367 extern int cp_type_quals                        PARAMS ((tree));
4368 extern int cp_has_mutable_p                     PARAMS ((tree));
4369 extern int at_least_as_qualified_p              PARAMS ((tree, tree));
4370 extern int more_qualified_p                     PARAMS ((tree, tree));
4371 extern tree build_ptrmemfunc1                   PARAMS ((tree, tree, tree, tree, tree));
4372 extern void expand_ptrmemfunc_cst               PARAMS ((tree, tree *, tree *, tree *, tree *));
4373 extern tree delta2_from_ptrmemfunc              PARAMS ((tree));
4374 extern tree pfn_from_ptrmemfunc                 PARAMS ((tree));
4375 extern tree type_after_usual_arithmetic_conversions PARAMS ((tree, tree));
4376 extern tree composite_pointer_type              PARAMS ((tree, tree, tree, tree,
4377                                                        const char*));
4378 extern tree check_return_expr                   PARAMS ((tree));
4379
4380 /* in typeck2.c */
4381 extern tree error_not_base_type                 PARAMS ((tree, tree));
4382 extern tree binfo_or_else                       PARAMS ((tree, tree));
4383 extern void readonly_error                      PARAMS ((tree, const char *, int));
4384 extern int abstract_virtuals_error              PARAMS ((tree, tree));
4385 extern void incomplete_type_error               PARAMS ((tree, tree));
4386 extern void my_friendly_abort                   PARAMS ((int))
4387   ATTRIBUTE_NORETURN;
4388 extern void my_friendly_assert                  PARAMS ((int, int));
4389 extern tree store_init_value                    PARAMS ((tree, tree));
4390 extern tree digest_init                         PARAMS ((tree, tree, tree *));
4391 extern tree build_scoped_ref                    PARAMS ((tree, tree));
4392 extern tree build_x_arrow                       PARAMS ((tree));
4393 extern tree build_m_component_ref               PARAMS ((tree, tree));
4394 extern tree build_functional_cast               PARAMS ((tree, tree));
4395 extern char *enum_name_string                   PARAMS ((tree, tree));
4396 extern void report_case_error                   PARAMS ((int, tree, tree, tree));
4397 extern void check_for_new_type                  PARAMS ((const char *, flagged_type_tree));
4398 extern tree add_exception_specifier             PARAMS ((tree, tree, int));
4399
4400 /* in xref.c */
4401 extern void GNU_xref_begin                      PARAMS ((const char *));
4402 extern void GNU_xref_end                        PARAMS ((int));
4403 extern void GNU_xref_file                       PARAMS ((const char *));
4404 extern void GNU_xref_start_scope                PARAMS ((HOST_WIDE_INT));
4405 extern void GNU_xref_end_scope                  PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, int, int));
4406 extern void GNU_xref_ref                        PARAMS ((tree, const char *));
4407 extern void GNU_xref_decl                       PARAMS ((tree, tree));
4408 extern void GNU_xref_call                       PARAMS ((tree, const char *));
4409 extern void GNU_xref_function                   PARAMS ((tree, tree));
4410 extern void GNU_xref_assign                     PARAMS ((tree));
4411 extern void GNU_xref_hier                       PARAMS ((tree, tree, int, int, int));
4412 extern void GNU_xref_member                     PARAMS ((tree, tree));
4413
4414 /* in dump.c */
4415 extern void dump_node_to_file                   PARAMS ((tree, const char *));
4416
4417 /* -- end of C++ */
4418
4419 #endif /* not _CP_TREE_H */