]> gcc.gnu.org Git - gcc.git/blob - gcc/cp/ChangeLog
class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT.
[gcc.git] / gcc / cp / ChangeLog
1 2000-02-17 Mark Mitchell <mark@codesourcery.com>
2
3 * class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT.
4 * decl2.c (grokclassfn): Likewise.
5
6 * ir.texi: Document DECL_TEMPLATE_INSTANTIATIONS.
7
8 * decl2.c (lang_decode_option): Don't set default message length
9 here.
10 * lex.c (lang_init_options): Set it here.
11
12 2000-02-16 Mark Mitchell <mark@codesourcery.com>
13
14 Make DECL_CONTEXT mean the class in which a member function was
15 declared, even for a virtual function.
16 * cp-tree.h (DECL_CLASS_CONTEXT): Adjust.
17 (DECL_FRIEND_CONTEXT): New macro.
18 (DECL_REAL_CONTEXT): Remove.
19 (SET_DECL_FRIEND_CONTEXT): Likewise.
20 (DECL_VIRTUAL_CONTEXT): Adjust.
21 (DECL_CLASS_SCOPE_P): Use TYPE_P.
22 (add_friends): Remove.
23 (hack_decl_function_context): Likewise.
24 * call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with
25 CP_DECL_CONTEXT.
26 (build_over_call): Fix indentation. Use DECL_CONTEXT
27 instead of DECL_CLASS_CONTEXT.
28 * class.c (dfs_build_vcall_offset_vtbl_entries): Likewise.
29 (add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
30 (strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
31 (build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT.
32 (build_base_field): Likewise.
33 (finish_struct_1): Likewise.
34 (build_self_reference): Likewise.
35 * decl.c (push_class_binding): Use CP_DECL_CONTEXT, not
36 DECL_REAL_CONTEXT.
37 (pushtag): Use decl_function_context, not
38 hack_decl_function_context.
39 (decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
40 (duplicate_decls): Use DECL_VIRTUAL_CONTEXT.
41 (pushdecl): Remove bogus code.
42 (start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT.
43 (cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
44 (grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
45 Use decl_function_context, nothack_decl_function_context.
46 (grokvardecl): Don't set DECL_CLASS_CONTEXT.
47 (grokdeclarator): Likewise. Use decl_function_context, not
48 hack_decl_function_context.
49 (copy_args_p): Document. Don't use DECL_CLASS_CONTEXT.
50 (start_function): Use DECL_FRIEND_CONTEXT, not
51 DECL_CLASS_CONTEXT. Use decl_function_context, not
52 hack_decl_function_context.
53 (finish_function): Use decl_function_context, not
54 hack_decl_function_context.
55 (maybe_retrofit_in_chrg): Use DECL_CONTEXT, not
56 DECL_CLASS_CONTEXT.
57 (grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT.
58 (finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT.
59 (grokfield): Likewise.
60 (finish_builtin_type): Likewise.
61 (finish_vtable_vardec): Use decl_function_context, not
62 hack_decl_function_context.
63 (import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
64 (start_static_initialization_or_destruction): Likewise.
65 (finish_static_initialization_or_destruction): Likewise.
66 (mark_used): Adjust logic for deciding when to synthesize methods.
67 * dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not
68 DECL_REAL_CONTEXT.
69 * error.c (dump_function_decl): Use DECL_CONTEXT, not
70 DECL_CLASS_CONTEXT.
71 * friend.c (is_friend): Likewise.
72 (add_friends): Remove.
73 (do_friend): Use SET_DECL_FRIEND_CONTEXT.
74 * lex.c (begin_definition_of_inclass_inline): Use
75 decl_function_context, not hack_decl_function_context.
76 (process_next_inline): Likewise.
77 (do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
78 * method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not
79 DECL_CLASSS_CONTEXT.
80 (hack_identifier): Likewise.
81 (synthesize_method): Use decl_function_context, not
82 hack_decl_function_context.
83 * pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not
84 DECL_REAL_CONTEXT.
85 (is_member_template): Use decl_function_context, not
86 hack_decl_function_context. Use DECL_CONTEXT, not
87 DECL_CLASS_CONTEXT.
88 (build_template_decl): Set DECL_VIRTUAL_CONTEXT, not
89 DECL_CLASS_CONTEXT.
90 (check_default_tmpl_args): Use CP_DECL_CONTEXT, not
91 DECL_REAL_CONTEXT.
92 (push_template_decl_real): Likewise.
93 (instantiate_class_template): Don't call add_friends.
94 (tsubst_default_argument): Use DECL_CONTEXT, not
95 DECL_REAL_CONTEXT.
96 (tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
97 Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
98 (set_meangled_name_for_template_decl): Use DECL_CONTEXT, not
99 DECL_CLASS_CONTEXT.
100 * repo.c (repo_inline_used): Likewise.
101 * search.c (current_scope): Adjust for new _CONTEXT macros.
102 (context_for_name_lookup): Use CP_DECL_CONTEXT, not
103 DECL_REAL_CONTEXT.
104 (friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
105 (lookup_fnfields_here):Likewise.
106 (check_final_overrider): Likewise.
107 (init_vbase_pointers): Likewise.
108 (virtual_context): Likewise.
109 * semantics.c (finish_member_declaration): Just set DECL_CONTEXT.
110 (expand_body): Use decl_function_context, not
111 hack_decl_function_context.
112 * tree.c (hack_decl_function_context): Remove.
113 * typeck.c (build_x_function_call): Use DECL_CONTEXT, not
114 DECL_CLASS_CONTEXT.
115 * typeck2.c (error_not_base_type): Likewise.
116
117 2000-02-15 Jason Merrill <jason@casey.cygnus.com>
118
119 * decl.c (xref_tag): Don't SET_IDENTIFIER_NAMESPACE_VALUE.
120
121 2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
122
123 * Make-lang.in (g++spec.o): Depend on $(GCC_H), not gcc.h.
124
125 2000-02-15 Jonathan Larmour <jlarmour@redhat.co.uk>
126
127 * lang-specs.h: Add new __GNUC_PATCHLEVEL__ define to default spec.
128
129 2000-01-16 Gabriel Dos Reis <gdr@codesourcery.com>
130
131 * decl2.c (lang_decode_option): Enable automatic line wrapping.
132
133 2000-02-13 Jason Merrill <jason@casey.cygnus.com>
134
135 * parse.y (frob_specs): Split out...
136 (parse_decl): From here.
137 (fn.def2): Call initial_deferred_type_access_control.
138 (after_type_component_declarator0): Call frob_specs.
139 (notype_component_declarator0): Likewise.
140 * search.c (friend_accessible_p): Nested classes are friends of their
141 enclosing classes.
142
143 2000-02-10 Mark Mitchell <mark@codesourcery.com>
144
145 * ir.texi (ADDR_EXPR): Document the fact that an ADDR_EXPR can be
146 used to create an implicit temporary.
147
148 * class.c (dfs_modify_vtables): Tweak calculation of functions to
149 override.
150
151 2000-02-08 Nathan Sidwell <nathan@acm.org>
152
153 * typeck.c (strip_all_pointer_quals): Use TYPE_MAIN_VARIANT, to
154 strip array element qualifiers too.
155
156 2000-02-07 Mark Mitchell <mark@codesourcery.com>
157
158 * decl.c (store_parm_decls): Don't build cleanups for parameters
159 while processing_template_decl.
160
161 2000-02-07 Jason Merrill <jason@casey.cygnus.com>
162
163 * cp-tree.h (struct saved_scope): Add incomplete field.
164 (namespace_scope_incomplete): New macro.
165 * decl.c (pushdecl): Use it.
166 (hack_incomplete_structures): Use it. See through artificial
167 binding levels.
168 (mark_saved_scope): Mark it.
169
170 Implement access control for nested types.
171 * search.c (type_access_control): New fn.
172 (accessible_p): Now we do perform access control for types.
173 * semantics.c (deferred_type_access_control): New fn.
174 (initial_deferred_type_access_control): New fn.
175 (begin_function_definition): Call it. Add lookups parm.
176 * decl.c (struct binding_level): Add this_class field.
177 (pushlevel_class): Set it.
178 (mark_binding_level): Mark it.
179 (lookup_name_real): Use it. Call type_access_control.
180 (mark_saved_scope): Mark lookups field.
181 * cp-tree.h (flagged_type_tree): Add lookups field.
182 (struct saved_scope): Add lookups field.
183 (type_lookups): New macro.
184 * parse.y (declmods): Now <ftype>.
185 (parse_decl): Add lookups parm. Call
186 initial_deferred_type_access_control.
187 (lang_extdef): Clear type_lookups.
188 (typed_declspecs, declmods, typespec): Set lookups field.
189 (initdcl): Call deferred_type_access_control.
190 (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0,
191 component_decl_1, named_parm): Adjust.
192 * friend.c (is_friend): Nested classes are friends of their
193 enclosing classes.
194
195 * class.c (currently_open_derived_class): New fn.
196 * method.c (hack_identifier): Use it.
197
198 * lex.c (do_identifier): Remove obsolete code.
199
200 * parse.y (typed_typespecs): Propagate new_type_flag properly.
201
202 2000-02-05 Zack Weinberg <zack@wolery.cumb.org>
203
204 * tinfo.h: Remove apostrophes from C++ comment (xgettext
205 thinks this file is plain C).
206
207 2000-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
208
209 * Makefile.in (call.o): Depend on $(EXPR_H).
210
211 * call.c: Include "expr.h".
212
213 * class.c (dump_class_hierarchy): Add prototype.
214
215 * search.c (dfs_get_pure_virtuals): Likewise.
216
217 2000-02-1 Ulrich Drepper <drepper@redhat.com>
218
219 * parse.y (simple_stmt): Allow :: token in asm parameter list.
220 * parse.c: Rebuilt.
221
222 Mon Jan 31 15:35:29 2000 Jim Wilson <wilson@cygnus.com>
223
224 * class.c (build_vtbl_or_vbase_field): New parameter fcontext.
225 Store it in DECL_FCONTEXT.
226 (build_vbase_pointer_fields, create_vtable_ptr): Fix callers.
227
228 2000-01-31 Jason Merrill <jason@casey.cygnus.com>
229
230 * tinfo.h (old abi): #include "tconfig.h".
231 * tinfo.cc (convert_to_base): Move into old abi section.
232
233 2000-01-31 Mark Mitchell <mark@codesourcery.com>
234
235 * cp-tree.h (BINFO_VIRTUALS): Tweak documentation.
236 (CLASSTYPE_PRIMARY_BINFO): Use BINFO_PRIMARY_BINFO.
237 (BINFO_PRIMARY_BINFO): New macro.
238 (BF_DELTA): Rename to ...
239 (BV_DELTA): ... this.
240 (BF_VCALL_INDEX): Rename to ...
241 (BV_VCALL_INDEX): ... this.
242 (BF_FN): Rename to ...
243 (BV_FN): ... this.
244 * class.c (build_vbase_path): Adjust for changes to reverse_path.
245 (set_rtti_entry): Rename BF_ macros to BV_ variants.
246 (modify_vtable_entry): Simplify.
247 (add_virtual_function): Rename BF_ macros to BV_ variants.
248 (build_vtable_initializer): Likewise.
249 (get_class_offset_1): Remove.
250 (dfs_get_class_offset): Likewise.
251 (get_class_offset): Likewise.
252 (dfs_find_final_overrider): New function.
253 (find_final_overrider): Likewise.
254 (modify_one_vtable): Remove.
255 (dfs_find_base): New function.
256 (dfs_modify_vtables): Fold modify_one_vtable in here. Use
257 find_final_overrider.
258 (modify_all_vtables): Adjust. Set BV_VCALL_INDEX on new
259 virtuals.
260 (dfs_fixup_vtable_deltas): Remove.
261 (override_one_vtable): Remove.
262 (merge_overrides): Likewise.
263 (layout_virtual_bases): Make sure BINFO_OFFSET is set right for
264 unreal chilren of virtual bases.
265 (finish_struct_1): Don't use merge_overrides. Don't use
266 dfs_fixup_vtable_deltas.
267 * tree.c (reverse_path): Return a TREE_LIST, not a chain of
268 BINFOs.
269
270 2000-01-31 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
271 Jason Merrill <jason@yorick.cygnus.com>
272
273 * tinfo.h: Rename USItype to myint32, depend on BITS_PER_UNIT.
274
275 2000-01-31 Alfred Minarik <a8601248@unet.univie.ac.at>
276
277 * exception.cc (__throw_bad_typeid): Add missing std::.
278
279 2000-01-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
280
281 * cp-tree.h (make_thunk): PROTO -> PARAMS.
282
283 2000-01-31 Nathan Sidwell <sidwell@codesourcery.com>
284
285 * cp-tree.h (new_abi_rtti_p): Use flag_new_abi.
286
287 Runtime support for new-abi rtti.
288 * inc/typeinfo (type_info::operator!=): Define in class.
289 (type_info::before, type_info::name, type_info::operator==,
290 type_info::operator!=): Define new ABI implementations.
291 (type_info::is_pointer_p, type_info::is_function_p): Declare
292 new virtual functions.
293 (type_info::do_catch, type_info::do_upcast): Likewise.
294
295 * tinfo.h (__base_class_info): Define new class.
296 (__class_type_info): Likewise.
297 (__si_class_type_info): Likewise.
298 (__vmi_class_type_info): Likewise.
299 (__dynamic_cast): Prototype.
300
301 * tinfo.cc: Conditionalize old and new rtti mechanisms.
302 (type_info::is_pointer_p): Define new function.
303 (type_info::is_function_p): Likewise.
304 (type_info::do_catch): Likewise.
305 (type_info::do_upcast): Likewise.
306 (vtable_prefix): New structure for vtable access.
307 (adjust_pointer): Define new template function.
308 (contained_p, public_p, virtual_p, contained_public_p,
309 contained_nonpublic_p, contained_nonvirtual_p): Define new
310 functions.
311 (nonvirtual_base_type): New local variable.
312 (__class_type_info::~__class_type_info): Define.
313 (__si_class_type_info::~__si_class_type_info): Likewise.
314 (__vmi_class_type_info::~__vmi_class_type_info): Likewise.
315 (__class_type_info::do_catch): Define new function.
316 (__class_type_info::do_upcast): Likewise.
317 (__class_type_info::find_public_src): Likewise.
318 (__class_type_info::do_find_public_src): Likewise.
319 (__si_class_type_info::do_find_public_src): Likewise.
320 (__vmi_class_type_info::do_find_public_src): Likewise.
321 (__class_type_info::do_dyncast): Likewise.
322 (__si_class_type_info::do_dyncast): Likewise.
323 (__vmi_class_type_info::do_dyncast): Likewise.
324 (__class_type_info::do_upcast): Likewise.
325 (__si_class_type_info::do_upcast): Likewise.
326 (__vmi_class_type_info::do_upcast): Likewise.
327 (__dynamic_cast): Likewise.
328
329 * tinfo2.cc (__fundamental_type_info): Define new class.
330 (__pointer_type_info): Likewise.
331 (__reference_type_info): Likewise.
332 (__array_type_info): Likewise.
333 (__function_type_info): Likewise.
334 (__enum_type_info): Likewise.
335 (__ptr_to_member_type_info): Likewise.
336 (__fundamental_type_info::~__fundamental_type_info): Define.
337 (__pointer_type_info::~__pointer_type_info): Likewise.
338 (__reference_type_info::~__reference_type_info): Likewise.
339 (__array_type_info::~__array_type_info): Likewise.
340 (__function_type_info::~__function_type_info): Likewise.
341 (__enum_type_info::~__enum_type_info): Likewise.
342 (__ptr_to_member_type_info::~__ptr_to_member_type_info): Likewise.
343 (__pointer_type_info::do_catch): Define new function.
344 (__ptr_to_member_type_info::do_catch): Define new function.
345
346 (__throw_type_match_rtti_2): Use new ABI interface, if enabled.
347 (__is_pointer): Likewise.
348
349 * exception.cc (__cplus_type_matcher): Deal with new-abi rtti.
350
351 2000-01-30 Mark Mitchell <mark@codesourcery.com>
352
353 * cp/class.c (build_vtable): Rename to build_primary_vtable.
354 (prepare_fresh_vtable): Rename to build_secondary_vtable.
355 (make_new_vtable): New function.
356 (modify_vtable_entry): Handle generation of new vtables correctly.
357 (modify_one_vtable): Remove unused parameter.
358 (dfs_fixup_vtable_deltas): Likewise.
359 (override_one_vtable): Use build_secondary_vtable.
360 (finish_struct_1): Use build_primary_vtable and
361 build_secondary_vtable.
362
363 2000-01-28 Ulrich Drepper <drepper@redhat.com>
364
365 * cp/decl.c: Adjust variable names, comments, help strings.
366
367 2000-01-29 Nathan Sidwell <nathan@acm.org>
368
369 * new2.cc (operator delete[]): Use operator delete, don't assume
370 implementation.
371
372 2000-01-29 Nathan Sidwell <sidwell@codesourcery.com>
373
374 * class.c (build_vtbl_initializer): Add argument to
375 build_vtable_entry call.
376
377 2000-01-27 Mark Mitchell <mark@codesourcery.com>
378
379 * cp-tree.def (THUNK_DECL): Discuss vcall indices.
380 * cp-tree.h (BINFO_VIRTUALS): Update documentation.
381 (BF_DELTA): New macro.
382 (BF_VCALL_INDEX): Likewise.
383 (BF_FN): Likewise.
384 (THUNK_VCALL_OFFSET): Likewise.
385 (make_thunk): Change prototype.
386 * class.c (build_vtable_entry): Integrate
387 build_vtable_entry_for_fn. Handle vcall indices.
388 (build_vtable_entry_for_fn): Remove.
389 (set_rtti_entry): Handle vcall indices. Use BF_DELTA,
390 BF_VCALL_INDEX, BF_FN.
391 (modify_vtable_entry): Integrate common code from
392 modify_one_vtable and dfs_fixup_vtable_deltas.
393 (add_virtual_function): Set BF_VCALL_INDEX.
394 (build_vtbl_initializer): Simplify. Use BF_DELTA, BF_VCALL_INDEX,
395 and BF_FN.
396 (modify_one_vtable): Simplify.
397 (dfs_fixup_vtable_deltas): Likewise.
398 (override_one_vtable): Use BF_DELTA, BF_VCALL_INDEX, BF_FN.
399 * method.c (make_thunk): Handle vcall indices.
400
401 2000-01-28 Nathan Sidwell <sidwell@codesourcery.com>
402
403 Compiler side new abi rtti (not enabled).
404 * cp-tree.h (new_abi_rtti_p): New macro.
405 (emit_support_tinfos): Prototype new function.
406 (tinfo_decl_p): Likewise.
407 (emit_tinfo_decl): Likwise.
408 * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL): New accessor
409 macros.
410 (doing_runtime): New local static.
411 (init_rtti_processing): Add new-abi initializer.
412 (get_tinfo_decl): Add new-abi logic.
413 (tinfo_from_decl): Likewise.
414 (build_dynamic_cast_1): Likewise.
415 (qualifier_flags): New static function.
416 (tinfo_base_init): Likewise.
417 (generic_initializer): Likewise.
418 (ptr_ref_initializer): Likewise.
419 (ptmd_initializer): Likewise.
420 (class_hint_flags): Likewise.
421 (class_initializer): Likewise.
422 (synthesize_tinfo_var): Likewise.
423 (create_real_tinfo_var): Likewise.
424 (create_pseudo_type_info): Likewise.
425 (get_vmi_pseudo_type_info): Likewise.
426 (create_tinfo_types): Likewise.
427 (emit_support_tinfos): New global function.
428 (tinfo_decl_p): New global predicate.
429 (emit_tinfo_decl): New global function.
430 * class.c (set_rtti_entry): Generalize for old and new rtti.
431 (build_vtbl_initializer): Likewise.
432 * decl2.c (finish_file): Likewise.
433
434 Thu Jan 27 20:53:36 2000 Jim Wilson <wilson@cygnus.com>
435
436 * cp/optimize.c (remap_decl): Add walk_tree calls for DECL_SIZE (t)
437 and TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))).
438
439 Thu Jan 27 13:54:12 2000 Mike Stump <mrs@wrs.com>
440
441 * decl.c (pushdecl): Fix up shadow warnings with respect to implicit
442 for scopes.
443
444 2000-01-26 Jason Merrill <jason@casey.cygnus.com>
445
446 * pt.c (unify): Use fold, not maybe_fold_nontype_arg.
447
448 Wed Jan 26 22:19:14 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
449
450 * cp/optimize.c (calls_setjmp_r): Supply new argument
451 to special_function_p.
452
453 2000-01-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
454
455 * call.c: PROTO -> PARAMS.
456 * class.c: Likewise.
457 * cp-tree.h: Likewise.
458 * cvt.c: Likewise.
459 * decl.c: Likewise.
460 * decl.h: Likewise.
461 * decl2.c: Likewise.
462 * dump.c: Likewise.
463 * errfn.c: Likewise.
464 * error.c: Likewise.
465 * except.c: Likewise.
466 * expr.c: Likewise.
467 * init.c: Likewise.
468 * input.c: Likewise.
469 * lex.c: Likewise.
470 * lex.h: Likewise.
471 * method.c: Likewise.
472 * optimize.c: Likewise.
473 * parse.y: Likewise.
474 * pt.c: Likewise.
475 * repo.c: Likewise.
476 * rtti.c: Likewise.
477 * search.c: Likewise.
478 * semantics.c: Likewise.
479 * spew.c: Likewise.
480 * tree.c: Likewise.
481 * typeck.c: Likewise.
482 * typeck2.c: Likewise.
483 * xref.c: Likewise.
484
485 2000-01-25 Richard Henderson <rth@cygnus.com>
486
487 * typeck.c (build_binary_op_nodefault): Remove UNNE_EXPR.
488
489 2000-01-25 Mark Mitchell <mark@codesourcery.com>
490
491 * cp-tree.h (vcall_offset_in_vtable_p): New macro.
492 * class.c (build_vbase_offset_vtbl_entries): Fix typo in commment.
493 (struct vcall_offset_data_s): New type.
494 (dfs_vcall_offset_queue_p): New function.
495 (dfs_build_vcall_offset_vtbl_entries): Likewise.
496 (build_vcall_offset_vtbl_entries): Likewise.
497 (layout_vtable_decl): Likewise.
498 (num_vfun_entries): Likewise.
499 (num_extra_vtbl_entries): Add the entries for vcall offsets.
500 (build_vtbl_initializer): Likewise.
501 (dfs_finish_vtabls): Use layout_vtable_decl.
502 (modify_one_vtables): Always duplicate vtables under the new ABI.
503 (finish_struct_1): Use layout_vtable_decl.
504
505 2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
506
507 * decl.c (member_function_or_else): Change third arg from a format
508 specifier to an `enum overload_flags'. Callers changed.
509
510 2000-01-25 Gabriel Dos Reis <gdr@codesourcery.com>
511
512 * typeck.c (composite_pointer_type, c_sizeof, expr_sizeof,
513 build_binary_op_nodefault, build_unary_op, build_reinterpret_cast,
514 build_const_cast, get_delta_difference, check_return_expr): Avoid
515 ANSI string concatenation usage.
516
517 2000-01-24 Mark Mitchell <mark@codesourcery.com>
518
519 * class.c (layout_class_type): Put the fields required to make a
520 class non-empty at the end, not the beginning, of the TYPE_FIELDs
521 list.
522
523 2000-01-24 Jason Merrill <jason@casey.cygnus.com>
524
525 * pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a
526 template.
527
528 * decl2.c (mark_used): Do instantiate inlines that have been
529 explicitly instantiated.
530
531 2000-01-24 Richard Henderson <rth@cygnus.com>
532
533 * call.c (build_over_call): Use expand_tree_builtin.
534 * typeck.c (build_function_call_real): Likewise.
535 (build_binary_op_nodefault): Handle unordered compares.
536
537 2000-01-24 Nathan Sidwell <sidwell@codesourcery.com>
538
539 * cp-tree.h (CPTI_BAD_CAST, CPTI_BAD_TYPEID, CPTI_DCAST): New
540 cp_tree_index values.
541 (throw_bad_cast_node, throw_bad_typeid_node, dynamic_cast_node):
542 New global node #defines for them.
543 * rtti.c (call_void_fn): Replace with ...
544 (build_runtime_decl): ... new static function.
545 (throw_bad_cast): Use throw_bad_cast_node and build_runtime_decl.
546 (throw_bad_typeid): Use throw_bad_typeid_node and build_runtime_decl.
547 (build_dynamic_cast_1): Always produce correctly typed result.
548 Explicitly produce type_info addresses. Use dynamic_cast_node.
549 * exception.cc (__throw_bad_cast): Return `void *'.
550 (__throw_bad_typeid): Return `const type_info &'.
551
552 2000-01-24 Nathan Sidwell <sidwell@codesourcery.com>
553
554 * cp-tree.h (get_vtable_decl): Prototype new function.
555 * class.c (get_vtable_decl): New function. Broken out from ...
556 (build_vtable): ... here. Use it.
557 * decl2.c (finish_vtable_vardecl): Ignore dummy vtables created
558 by get_vtable_decl.
559
560 2000-01-24 Nathan Sidwell <sidwell@codesourcery.com>
561
562 * cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE,
563 CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE,
564 CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations.
565 (CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE,
566 CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE,
567 CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations.
568 (CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ...
569 (CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here.
570 (CPTI_TINFO_VAR_ID): New enumeration.
571 (__tp_desc_type_node, __access_mode_type_node,
572 __bltn_desc_type_node, __user_desc_type_node,
573 __class_desc_type_node, __ptr_desc_type_node,
574 __attr_desc_type_node, __func_desc_type_node,
575 __ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines.
576 (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node,
577 ref_desc_type_node, ary_desc_type_node, func_desc_type_node,
578 enum_desc_type_node, class_desc_type_node,
579 si_class_desc_type_node, vmi_class_desc_type_node,
580 ptmd_desc_type_node, base_desc_type_node): New #defines.
581 (tinfo_fn_id, tinfo_fn_type): Rename to ...
582 (tinfo_decl_id, tinfo_decl_type): ... here. Adjust.
583 (tinfo_var_id): New enumeration.
584 (DECL_TINFO_FN_P): Augment comment.
585 * decl.c (cp_global_trees): Adjust documentation.
586 * rtti.c (init_rtti_processing): Adjust for tinfo_decl_id,
587 tinfo_decl_type and tinfo_var_id.
588 (get_tinfo_decl_dynamic): Adjust for tinfo_decl_type.
589 (build_typeid): Remove unused variable.
590 (get_tinfo_var): Use tinfo_var_id.
591 (tinfo_name): New static function.
592 (get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type.
593 (tinfo_from_decl): Likewise.
594 (get_base_offset): New static function, broken out of
595 expand_class_desc.
596 (expand_si_desc): Use tinfo_name.
597 (expand_class_desc): Likewise. Lose local static variable.
598 Use base_desc_type_node. Use get_base_offset.
599 (expand_ptr_desc): Use tinfo_name.
600 (expand_attr_desc): Likewise.
601 (expand_generic_desc): Likewise.
602
603 * tinfo.cc (__GXX_ABI_VERSION): Test value and existance.
604 * tinfo.h (__GXX_ABI_VERSION): Test value and existance.
605
606 2000-01-23 Mark Mitchell <mark@codesourcery.com>
607
608 * cp-tree.h (__eprintf): Remove declaration.
609 * tree.c (__eprintf): Remove definition.
610
611 2000-01-23 Zack Weinberg <zack@rabi.columbia.edu>
612 Mark Mitchell <mark@codesourcery.com>
613
614 * cp-tree.h (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
615 CLEAR_CLASSTYPE_MARKED_N): Avoid signed vs. unsigned warnings.
616
617 2000-01-23 Brad Lucier <lucier@math.purdue.edu>
618
619 * class.c (dump_class_hierarchy): Print HOST_WIDE_INT properly.
620
621 2000-01-23 Mark Mitchell <mark@codesourcery.com>
622
623 * cp-tree.h (register_dtor_fn): New function.
624 * decl.c (destroy_local_static): Rename to ...
625 (register_dtor_fn): ... this. Give it external linkage.
626 (expand_static_init): Use it.
627 * decl2.c (do_static_initialization): Likewise, if using
628 __cxa_atexit.
629 (do_static_destruction): Check that __cxa_atexit is not in use.
630 (finish_file): Don't call do_static_destruction if using
631 __cxa_atexit.
632
633 * typeck.c (convert_arguments): Restore two-message error
634 reporting.
635
636 2000-01-20 Nathan Sidwell <sidwell@codesourcery.com>
637
638 Remap dynamic cast hint values to be consistent across ABIs.
639 * search.c (dynamic_cast_base_recurse): Remap generated value.
640 (get_dynamic_cast_base_type): Adjust documentation.
641 * tinfo.h (__user_type_info::dyncast): Likewise.
642 (__user_type_info::find_public_subobj): Remap BOFF meaning.
643 * tinfo.cc (__si_type_info::do_dyncast): Remap BOFF meaning.
644 (__class_type_info::do_dyncast): Likewise.
645 (__class_type_info::do_find_public_subobj): Likewise.
646 * tinfo2.cc (__dynamic_cast): Remap BOFF parameter.
647
648 2000-01-19 Gabriel Dos Reis <gdr@codesourcery.coom>
649
650 * typeck.c (build_unary_op): Use cp_pedwarn, not pedwarn.
651
652 * typeck2.c (incomplete_type_error): Restore previous
653 cp_error and cp_error_at call sequence.
654
655 2000-01-20 Brad Lucier <lucier@math.purdue.edu>
656
657 * class.c (dump_class_hierarchy): Make format agree with argument;
658 cast pointer to unsigned long and print with %lx.
659
660 2000-01-19 Gabriel Dos Reis <gdr@codesourcery>
661
662 * decl2.c (lang_decode_option): Set default line-wrap length to 72.
663
664 * typeck.c (composite_pointer_type, common_type,
665 comp_target_parms, c_sizeof, expr_sizeof, build_array_ref,
666 build_function_call_real, convert_arguments,
667 build_binary_op_nodefault, pointer_int_sum, pointer_diff,
668 build_unary_op, mark_addressable, build_compound_expr,
669 build_static_cast, build_reinterpret_cast, build_const_cast,
670 build_c_cast, build_modify_expr, get_delta_difference,
671 build_ptrmemfunc, check_return_expr): Replace 'ANSI C++' with
672 'ISO C++'. Fusion consecutive calls to diagnotic message routines
673 into a single one.
674 * typeck2.c (readonly_error, abstract_virtuals_error,
675 process_init_constructor, check_for_new_type): Likewise.
676
677 2000-01-19 Mark Mitchell <mark@codesourcery.com>
678
679 * tree.c (bot_manip): Set DECL_CONTEXT for newly created
680 VAR_DECLs.
681
682 2000-01-18 Nathan Sidwell <sidwell@codesourcery.com>
683
684 * cp-tree.h (get_tinfo_fn_dynamic): Remove prototype.
685 (build_x_typeid): Likewise.
686 (get_tinfo_fn): Likewise.
687 (get_tinfo_fn_unused): Rename to ...
688 (get_tinfo_decl): ... here.
689 * rtti.c (build_headof): Replace logic error with assertion.
690 (get_tinfo_fn_dynamic): Rename to ...
691 (get_tinfo_decl_dynamic): ... here. Make static. Use
692 complete_type_or_else.
693 (build_x_typeid): Move into ...
694 (build_typeid): ... here. Adjust call to
695 get_tinfo_decl_dynamic. Use tinfo_from_decl. Simplify
696 throw_bad_typeid expression.
697 (get_tinfo_fn_unused): Rename to ...
698 (get_tinfo_decl): ... here. Adjust comment.
699 (get_tinfo_fn): Delete.
700 (tinfo_from_decl): New static function.
701 (get_typeid_1): Call get_tinfo_decl and tinfo_from_decl.
702 (get_typeid): Use complete_type_or_else.
703 (build_dynamic_cast_1): Adjust calls to
704 get_tinfo_decl_dynamic. Simplify throw_bad_cast expression.
705 * parse.y (primary): Adjust call to build_typeid.
706 * except.c (build_eh_type_type_ref): Adjust call to
707 get_tinfo_decl. Mark as used.
708 * class.c (set_rtti_entry): Adjust call to get_tinfo_decl.
709 * decl2.c (build_expr_from_tree): Adjust call to build_typeid.
710 * parse.c: Regenerated.
711
712 2000-01-17 Mark Mitchell <mark@codesourcery.com>
713
714 * class.c (fixed_type_or_null): Don't clear NONNULL. Document
715 calling convention.
716 (resolves_to_fixed_type_p): Document calling convention.
717 * rtti.c (build_x_typeid): Initialize NONNULL.
718
719 * cp-tree.h (build_shared_int_cst): New function.
720 * call.c (build_over_call): Use DECL_VIRTUAL_CONTEXT, for clarity.
721 * class.c (modify_vtable_entry): Likewise.
722 (add_virtual_function): Split out code to generated shared
723 INTEGER_CSTs to build_share_int_cst.
724 (modify_all_vtables): Handle all the overridden functions here.
725 Add overridden functions from non-primary virtual bases to the
726 primary vtable.
727 (finish_struct_1): Adjust call to modify_all_vtables. Add
728 overridden functions from non-primary bases to the vtable.
729 * tree.c (build_shared_int_cst): New function.
730
731 * cp-tree.h (scratchalloc): Remove.
732 (build_scratch_list): Likewise.
733 * call.c (convert_class_to_reference): Replace build_scratch_list
734 and build_expr_list with build_tree_list.
735 (add_candidate): Replace scratchalloc with expralloc. Note memory
736 leak.
737 (build_user_type_conversion_1): Replace build_scratch_list
738 and build_expr_list with build_tree_list.
739 (build_new_op): Likewise.
740 (build_op_delete_call): Likewise.
741 (convert_like): Likewise.
742 * cvt.c (ocp_convert): Likewise.
743 * decl.c (start_decl): Likewise.
744 (start_function): Likewise.
745 (finish_destructor_body): Likewise.
746 (maybe_build_cleanup_1): Likewise.
747 * decl2.c (reparse_decl_as_expr): Likewise.
748 * init.c (perform_member_init): Likewise.
749 (expand_cleanup_for_base): Likewise.
750 (build_builtin_delete_call): Likewise.
751 (build_new_1): Likewise.
752 (build_delete): Likewise.
753 * method.c (do_build_assign_ref): Likewise.
754 * parse.y (already_scoped_stmt): Likewise.
755 (nontrivial_exprlist): Likewise.
756 (net_initializer): Likewise.
757 (initlist): Likewise.
758 * parse.c: Regenerated.
759 * rtti.c (build_x_typeid): Likewise.
760 (build_dynamic_cast_1): Likewise.
761 * typeck.c (build_x_compound_expr): Likewise.
762 (build_static_cast): Likewise.
763 (build_modify_expr): Likewise.
764
765 * cp-tree.h (DECL_VINDEX): Add documentation.
766 * class.c (build_vtable_entry): Likewise.
767 (start_vtable): Add comment.
768 (add_virtual_function): Replace pending_hard_virtuals with
769 overridden_virtuals and pending_virtuals with new_virtuals.
770 Replace redundant assignments with assertions.
771 (check_for_override): Add comment.
772 (check_bases_and_members): Replace pending_hard_virtuals with
773 overridden_virtuals and pending_virtuals with new_virtuals.
774 (create_vtbl_ptr): Likewise.
775 (layout_class_type): Likewise.
776 (finish_struct_1): Likewise. Add comments.
777
778 2000-01-16 Mark Mitchell <mark@codesourcery.com>
779
780 * class.c (finish_struct_1): Replace redundant code with
781 assertions.
782
783 * cp-tree.h (flag_new_abi): Move.
784 (flag_use_cxa_atexit): Likewise.
785 (flag_honor_std): Likewise.
786 (flag_rtti): Likewise.
787 (vbase_offsets_in_vtable_p): Define.
788 (vptrs_present_everywhere_p): Likewise.
789 (TYPE_CONTAINS_VPTR_P): Likewise.
790 (dfs_walk_real): Declare.
791 * class.c (build_vbase_pointer_fields): Check
792 vbase_offsets_in_vtable_p.
793 (dfs_build_vbase_offset_vtbl_entries): Record the vbase indices in
794 BINFO_VPTR_FIELD.
795 (build_vbase_offset_vtbl_entries): Simplify.
796 (build_vbase_offset_vtbl_entries): Adjust.
797 (build_vbase_pointer): Add ability to look up vbase offsets in
798 vtable.
799 (start_vtable): New function.
800 (add_virtual_function): Use it.
801 (determine_primary_base): Use TYPE_CONTAINS_VPTR_P.
802 (num_extra_vtbl_entries): Use vbase_offsets_in_vtable_p.
803 (build_vtbl_initializer): Take the type of the complete object as
804 input. Use it to correctly calculate vbase offsets.
805 (dfs_finish_vtbls): Pass the complete type to
806 build_vtbl_initializer.
807 (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
808 (create_vtable_ptr): Create a vtable even if there are no
809 new virtual functions, under the new ABI.
810 (finish_struct_1): Likewise.
811 (get_vfield_name): Use TYPE_CONTAINS_VPTR_P.
812 * decl.c (exapnd_static_init): Remove call to
813 preserve_initializer.
814 * decl2.c (mark_vtable_entries): Tweak to handle vbase offsets in
815 vtables.
816 * init.c (initialize_vtbl_ptrs): Initialize them in pre-order.
817 (expand_virtual_init): Use vbase_offsets_in_vtable_p.
818 (construct_virtual_bases): Don't initialize virtual base pointers
819 under the new ABI.
820 (build_aggr_init): Clean up comment.
821 (expand_aggr_init_1): Likewise.
822 * rtti.c (expand_class_desc): Store the virtual function table
823 index where the vbase offset lives in the offset field.
824 * search.c (dfs_walk_real): Make it global.
825 (dfs_debug_mark): Use TYPE_CONTAINS_VPTR_P.
826 * tree.c (make_binfo): Don't clear BINFO_VPTR_FIELD.
827
828 * tinfo.h (USItype): Make it signed under the new ABI.
829 * tinfo.cc (convert_to_base): New function. Encapsulate base
830 conversion logic here.
831 (__class_type_info::do_upcast): Use it.
832 (__class_type_info::do_dyncast): Likewise.
833 (__class_type_info::do_find_public_subobj): Likewise.
834
835 * init.c (construct_virtual_bases): Don't look up the addresses of
836 virtual bases at run-time.
837
838 * class.c (build_vbase_pointer): Relocate.
839 (build_vbase_pointer_fields): Likewise.
840 (dfs_build_vbase_offset_vtbl_entries): Likewise.
841 (build_vbase_offset_vtbl_entries): Likewise.
842
843 * decl.c (init_decl_processing): Complain if -fnew-abi
844 -fno-vtable-thunks is used.
845
846 * decl2.c (lang_decode_option): Don't couple flag_honor_std to
847 flag_new_abi.
848
849 2000-01-15 Mark Mitchell <mark@codesourcery.com>
850
851 * cp-tree.h (num_extra_vtbl_entries): New function.
852 (size_extra_vtbl_entries): Likewise.
853 (dfs_vtable_path_unmark): Likewise.
854 (dfs_vtable_path_unmarked_real_bases_queue_p): Likewise.
855 (dfs_vtable_path_marked_real_bases_queue_p): Likewise.
856 * class.c (num_extra_vtbl_entries): New function.
857 (size_extra_vtbl_entries): Likewise.
858 (dfs_build_vbase_offset_vtbl_entries): New function.
859 (build_vbase_offset_vtbl_entries): Likewise.
860 (build_vtbl_initializer): Use it.
861 (finish_struct_1): Adjust vtable sizes (using
862 num_extra_vtbl_entries).
863 * expr.c (cplus_expand_expr): Assert that the DECL_RTL for a
864 THUNK_DECL is non-NULL before expanding it.
865 * init.c (expand_virtual_init): Adjust the vtable pointer by
866 size_extra_vtbl_entries before storing it.
867 * search.c (get_shared_vase_if_not_primary): Adjust prototype.
868 Handle TREE_LIST parameters here, not in the dfs_* functions.
869 (dfs_unmarked_real_bases_queue_p): Adjust.
870 (dfs_marked_real_bases_queue_p): Likewise.
871 (dfs_vtable_path_unmarked_real_bases_queue_p): New function.
872 (dfs_vtable_path_marked_real_bases_queue_p): New function.
873 (dfs_vtable_path_unmark): Likewise.
874
875 2000-01-14 Mark Mitchell <mark@codesourcery.com>
876
877 * optimize.c (copy_body_r): Clear the operand three of a
878 TARGET_EXPR when copying it.
879
880 2000-01-14 Martin v. Löwis <loewis@informatik.hu-berlin.de>
881
882 * method.c (build_decl_overload_real): Check whether we are in ::
883 before returning __builtin_new/delete.
884
885 2000-01-13 Mark Mitchell <mark@codesourcery.com>
886
887 * pt.c (tsubst_friend_function): Improve comment.
888 (instantiate_decl): Avoid crashing when a "nested" function is
889 instantiated from the top level.
890
891 * dump.c (dqeueue_and_dump): Dump
892 DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION.
893
894 2000-01-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
895
896 * call.c: If GATHER_STATISTICS, declare `n_build_method_call'.
897
898 2000-01-13 Nathan Sidwell <sidwell@codesourcery.com>
899
900 * g++spec.c (lang_specific_driver): Add -fnew-abi if
901 ENABLE_NEW_GXX_ABI defined.
902 * Make-lang.in (tinfo.o, tinfo2.o, exception.o, new.o,
903 opnew.o, opnewnt.o, opvnew.o, opvnewnt.o, opdel.o, opdelnt.o,
904 opvdel.o, opvdelnt.o): Use GXX_ABI_FLAG switch.
905
906 2000-01-12 Mark Mitchell <mark@codesourcery.com>
907
908 * decl.c (start_cleanup_fn): Call pushdecl.
909
910 * call.c (convert_class_to_reference): Fix typos.
911 (build_conditional_expr): Handle errors gracefully.
912 * class.c (push_nested_class): Likewise.
913 * cp-tree.h (VAR_FUNCTION_OR_PARM_DECL_CHECK): New macro.
914 (DECL_THIS_EXTERN): Use it.
915 (DECL_THIS_STATIC): Likewise.
916 * cvt.c (convert_to_void): Handle errors gracefully.
917 (build_expr_type_conversion): Likewise.
918 * decl.c (maybe_push_decl): Likewise.
919 (start_decl_1): Likewise.
920 (require_complete_types_for_parms): Likewise.
921 * parse.y (structsp): Likewise.
922 (base_class): Likewise.
923 * parse.c: Regenerated.
924 * pt.c (finish_member_template_decl): Likewise.
925 * typeck.c (decay_conversion): Likewise.
926
927 * cp-tree.h (dfs_skip_vbases): New function.
928 (find_vbase_instance): Likewise.
929 * class.c (determine_primary_base): Allow a nearly empty base to
930 serve as a primary base class under the new ABI.
931 (get_class_offset_1): Rename to ...
932 (dfs_get_class_offset): ... this. Simplify. Don't issue error
933 messages here.
934 (get_class_offset): Use it. Issue error messages here.
935 (dfs_modify_vtables): Rely on dfs_unmarked_real_bases_queue_p to
936 find the right copies of virtual bases.
937 (fixup_vtable_deltas1): Rename to ...
938 (dfs_fixup_vtable_deltas): ... this. Adjust to handle virtual
939 bases as primary bases.
940 (fixup_vtable_deltas): Remove.
941 (override_one_vtable): Handle virtual bases as primary bases.
942 (merge_overrides): Likewise.
943 (finish_struct_1): Likewise.
944 (dump_class_hierarchy): Dump primary-ness of bases as well.
945 * search.c (mark_primary_bases): Use a pre-order traversal to
946 handle primary virtual bases.
947 (dfs_skip_vbases): New fiunction.
948 (expand_upcast_fixups): Adjust to handle primary virtual bases.
949 (fixup_virtual_upcast_offsets): Likewise.
950 (fixup_all_virtual_upcast_offsets): Likewise.
951 (dfs_find_vbase_instances): New function.
952 (find_vbase_instance): Likewise.
953
954 2000-01-11 Mumit Khan <khan@xraylith.wisc.edu>
955
956 * lex.c (DIR_SEPARATOR): Delete macro.
957
958 2000-01-12 Gabriel Dos Reis <gdr@codesourcery.com>
959
960 * decl2.c (lang_decode_option): Handle automatic line wrapping
961 option.
962
963 2000-01-11 Mark Mitchell <mark@codesourcery.com>
964
965 * friend.c (do_friend): Don't resolve scopes when processing
966 template declarations, even if the qualifying scope doesn't
967 involve template parameters.
968
969 2000-01-10 Mark Mitchell <mitchell@dumbledore.codesourcery.com>
970
971 * class.c (dfs_modify_vtables_queue_p): Remove.
972 (modify_all_vtables): Use dfs_unmarked_real_bases_queue_p
973 and dfs_marked_real_bases_queue_p instead of
974 dfs_modify_vtables_queue_p.
975
976 * class.c (build_vbase_path): Simplify.
977 (dfs_propagate_binfo_offsets): New function.
978 (propagate_binfo_offsets): Use it.
979 (remove_base_field): Simplify.
980 (dfs_set_offset_for_vbases): Remove.
981 (dfs_set_offset_for_shared_vbases): New function.
982 (dfs_set_offset_for_unshared_vbases): Likewise.
983 (layout_virtual_bases): Use them.
984 (layout_basetypes): Don't call propagate_binfo_offsets.
985 * search.c (dfs_get_vbase_types): Clone completely fresh binfos
986 for the vbases.
987
988 * class.c (build_base_field): New function, split out from ...
989 (build_base_fields): ... here. Use it. Allocate primary bases
990 first, under the new ABI.
991 (get_vtable_entry): Remove.
992 (remove_base_field): New function, split out from ...
993 (remove_base_fields): ... here. Adjust since primary bases come
994 first under the new ABI.
995
996 * cp-tree.h (expand_direct_vtbls_init): Remove declaration.
997 (initialize_vtbl_ptrs): New function.
998 (expand_indirect_vtbls_init): Change prototype.
999 (convert_pointer_to_vbase): Declare.
1000 * init.c (expand_direct_vtbls_init): Remove.
1001 (dfs_initialize_vtbl_ptrs): New function.
1002 (initialize_vtbl_ptrs): Likewise.
1003 (emit_base_init): Use initialize_vtbl_ptrs.
1004 * search.c (convert_pointer_to_vbase): Make it global.
1005 (expand_indirect_vtbls_init): Remove vtable initialization code.
1006 * semantics.c (setup_vtbl_ptr): Use initialize_vtbl_ptrs.
1007
1008 * class.c (dfs_finish_vtbls): New function.
1009 (finish_vtbls): Use it.
1010 (dump_class_hierarchy): New function.
1011
1012 * cp-tree.h (BINFO_PRIMARY_MARKED_P): Change definition.
1013 (BINFO_VBASE_PRIMARY_P): New macro.
1014 (BINFO_VIRTUALS): Add to documentation.
1015 (SET_BINFO_PRIMARY_MARKED_P): Remove.
1016 (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise.
1017 (dfs_mark_primary_bases_queue_p): Likewise.
1018 (dfs_unmarked_real_bases_queue_p): New function.
1019 (dfs_marked_real_bases_queue_p): Likewise.
1020 * search.c (dfs_mark_primary_bases): Adjust.
1021 (mark_primary_bases): Likewise.
1022 (get_shared_vbase_if_not_primary): New function.
1023 (dfs_unmarked_real_bases_queue_p): Likewise.
1024 (dfs_marked_real_bases_queue_p): Likewise.
1025 (dfs_get_pure_virtuals): Simplify.
1026 (get_pure_virtuals): Likewise.
1027
1028 2000-01-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1029
1030 * lex.c: Include tm_p.h.
1031
1032 2000-01-07 Nathan Sidwell <sidwell@codesourcery.com>
1033
1034 * lang-specs.h (__GXX_ABI_VERSION): New preprocessor macro.
1035
1036 2000-01-06 Jason Merrill <jason@casey.cygnus.com>
1037
1038 * decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT.
1039 * pt.c (instantiate_decl): Defer comdat templates that might not be
1040 needed.
1041
1042 * cp-tree.h (DECL_NEEDED_P): Also true if !DECL_COMDAT.
1043 * decl2.c (finish_vtable_vardecl): Don't check !DECL_COMDAT.
1044 (finish_file): Likewise.
1045
1046 * decl2.c (import_export_class): Undo 12/14 change.
1047
1048 * error.c (dump_decl): operator new, not operatornew.
1049
1050 * class.c (field_decl_cmp): A nontype is "greater" than a type.
1051 * search.c (lookup_field_1): Look for the last field with the
1052 desired name.
1053
1054 2000-01-05 Nathan Sidwell <nathan@acm.org>
1055
1056 * decl2.c (lookup_arg_dependent): Deal with FNS not being a
1057 FUNCTION_DECL.
1058
1059 2000-01-05 Nathan Sidwell <nathan@acm.org>
1060
1061 * typeck.c (build_static_cast): Don't strip target qualifiers
1062 when casting from a class.
1063
1064 2000-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1065
1066 * class.c (warn_hidden): Initialize variable `fndecl'.
1067
1068 2000-01-03 Ulrich Drepper <drepper@cygnus.com>
1069
1070 * decl.c (flag_isoc9x): New variable to be able to use code in
1071 c-common.c. For now always zero.
1072
1073 2000-01-03 Mark Mitchell <mark@codesourcery.com>
1074
1075 * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation.
1076 * class.c (layout_basetypes): Don't set BINFO_INHERITANCE_CHAIN
1077 or unshare_base_binfos for virtual bases here.
1078 * search.c (dfs_get_vbase_types): Do it here.
1079 (get_vbase_types): Adjust.
1080
1081 2000-01-02 Mark Mitchell <mark@codesourcery.com>
1082
1083 * cp-tree.h (CLASSTYPE_VFIELDS): Move definition.
1084 (BINFO_PRIMARY_MARKED_P): Use flag 5.
1085 (SET_BINFO_PRIMARY_MARKED_P): Likewise.
1086 (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise.
1087 (unmark_primary_bases): Remove declaration.
1088 (unmarkedp): Declare.
1089 (dfs_vbase_unmark): Likewise.
1090 * class.c (determine_primary_base): Return immediately if there
1091 are no base classes. Call mark_primary_bases here.
1092 (modify_all_direct_vtables): Remove.
1093 (modify_all_indirect_vtables): Remove.
1094 (dfs_modify_vtables_queue_p): New function.
1095 (dfs_modify_vtables): New function.
1096 (modify_all_vtables): Use them.
1097 (build_base_fields): Build FIELD_DECLs for primary virtual base
1098 classes.
1099 (create_vtable_ptr): Don't call determine_primary_base here.
1100 (dfs_mark_primary_bases_and_set_vbase_offsets): Rename to ...
1101 (dfs_set_offset_for_vbases): ... this.
1102 (layout_virtual_bases): Use it.
1103 (layout_class_type): Call determine_primary_base here.
1104 * search.c (unmarkedp): Make it global.
1105 (shared_marked_p): Simplify.
1106 (shared_unmarked_p): Likewise.
1107 (dfs_primary_bases_queue_p): Remove.
1108 (dfs_unmark_primary_bases): Likewise.
1109 (unmark_primary_bases): Likewise.
1110 (mark_primary_bases): Simplify.
1111 (get_pure_virtuals): Don't call mark_primary_bases here.
1112 (dfs_vbase_unmark): New function.
1113 (get_vbase_types): Simplify.
1114
1115 * class.c (struct base_info): Remove.
1116 (determine_primary_base): Take has_virtual_p rather than a
1117 base_info as input. Don't calculate max_has_virtual.
1118 (finish_struct_bits): Remove max_has_virtual argument.
1119 (create_vtable_ptr): Remove max_has_virtual_p argument.
1120 (layout_virtual_bases): Remove max argument.
1121 (layout_basetypes): Likewise.
1122 (layout_class_type): Remove max_has_virtual_p argument.
1123 (finish_struct_1): Remove max_has_virtual.
1124
1125 * cp-tree.h (dfs_mark_primary_bases_queue_p): New function.
1126 (layout_basetypes): Remove.
1127 * class.c (propagate_binfo_offsets): Moved here from tree.c.
1128 Update to handle primary virtual bases.
1129 (remove_base_fields): New function, split out from
1130 layout_basetypes.
1131 (dfs_mark_primary_bases_and_set_vbase_offsets): New function.
1132 (layout_virtual_bases): New function, split out from
1133 layout_basetypes. Update to handle primary virtual bases.
1134 (layout_basetypes): Moved here from tree.c. Use
1135 remove_base_fields and layout_virtual_bases.
1136 * search.c (dfs_mark_primary_bases_queue_p): New function.
1137 (mark_primary_bases): Use it.
1138 * tree.c (CEIL): Remove.
1139 (propagate_binfo_offsets): Remove.
1140 (layout_basetypes): Remove.
1141
1142 2000-01-01 Mark Mitchell <mark@codesourcery.com>
1143
1144 * cp-tree.h (CLASSTYPE_N_BASECLASSES): Use BINFO_N_BASETYPES.
1145 (BINFO_PRIMARY_MARKED_P): New macro.
1146 (SET_BINFO_PRIMARY_MARKED_P): Likewise.
1147 (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise.
1148 (mark_primary_bases): New function.
1149 (unmark_primary_bases): Likewise.
1150 * search.c (get_abstract_virtuals_1): Remove.
1151 (dfs_mark_primary_bases): New function.
1152 (mark_primary_bases): Likewise.
1153 (dfs_unmark_primary_bases): Likewise.
1154 (unmark_primary_bases): Likewise.
1155 (dfs_get_pure_virtuals): Likewise.
1156
1157 2000-01-01 Mark Mitchell <mark@codesourcery.com>
1158
1159 * cp-tree.h (skip_rtti_stuff): Adjust prototype.
1160 * class.c (skip_rtti_stuff): Reorganize parameters and return value.
1161 (modify_one_vtable): Adjust.
1162 (fixup_vtable_deltas1): Likewise.
1163 (override_one_vtable): Likewise.
1164 * search.c (get_abstract_virtuals_1): Likewise.
1165 (get_pure_virtuals): Likewise.
1166 (expand_upcast_fixups): Likewise.
1167 * tree.c (debug_binfo): Likewise.
1168
1169 * class.c (build_vtable): Don't return a value. Don't rebuild
1170 vtables for bases that have already been handled.
1171 (prepare_fresh_vtable): Don't rebuild vtables for bases that have
1172 already been handled.
1173 (modify_one_vtable): Adjust accordingly.
1174 (fixup_vtable_deltas1): Likewise.
1175 (finish_struct_1): Likewise.
1176
1177 2000-01-01 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1178
1179 * call.c (build_new_method_call): Also check destructors.
1180
1181 1999-12-31 Mark Mitchell <mark@codesourcery.com>
1182
1183 * cp-tree.h (VF_NORMAL_VALUE): Remove.
1184 * class.c (struct base_info): Remove vfield, vfields, and rtti.
1185 (set_primary_base): New function, split out from ...
1186 (finish_base_struct): ... here. Rename to ...
1187 (determine_primary_base): ... this. Simplify.
1188 (create_vtable_ptr): Tweak accordingly.
1189 (finish_struct_1): Simplify.
1190
1191 * cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation.
1192 (CLASSTYPE_N_BASECLASSES): Likewise.
1193 (BINFO_FOR_VBASE): New macro.
1194 (get_vbase_types): Change prototype.
1195 * class.c (build_vbase_path): Use BINFO_FOR_VBASE.
1196 (prepare_fresh_vtable): Likewise.
1197 (finish_vtbls): Likewise.
1198 (get_class_offset_1): Likewise.
1199 (modify_all_indirect_vtables): Likewise.
1200 (build_vbase_pointer_fields): Likewise.
1201 * decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here.
1202 * init.c (sort_base_init): Use BINFO_FOR_VBASE.
1203 (expand_member_init): Likewise.
1204 * search.c (get_base_distance): Likewise.
1205 (lookup_field_queue_p): Likewise.
1206 (virtual_context): Likewise.
1207 (get_vbase_types): Don't return a value. Set
1208 CLASSTYPE_VBASECLASSES here.
1209 * typeck.c (get_delta_difference): Use BINFO_FOR_VBASE.
1210
1211 1999-12-30 Mark Mitchell <mark@codesourcery.com>
1212
1213 * class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS.
1214
1215 1999-12-29 Mark Mitchell <mark@codesourcery.com>
1216
1217 * class.c (create_vtable_ptr): Put the vtable at the beginning of
1218 the class, not the end, in the new ABI.
1219 * tree.c (propagate_binfo_offsets): Do the right thing for the new
1220 ABI.
1221
1222 1999-12-29 Mark Mitchell <mark@codesourcery.com>
1223
1224 * cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy.
1225 (CLASSTYPE_NEARLY_EMPTY_P): New macro.
1226 * class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P.
1227 (check_field_decls): Likewise.
1228 (check_bases_and_members): Likewise.
1229
1230 1999-12-28 Mark Mitchell <mark@codesourcery.com>
1231
1232 * cp-tree.h (do_inline_function_hair): Remove.
1233 * class.c (layout_class_type): New function, split out from
1234 finish_struct_1.
1235 (fixup_pending_inline): Likewise.
1236 (fixup_inline_methods): New function.
1237 * method.c (fixup_pending_inline): Remove.
1238 (do_inline_function_hair): Likewise.
1239
1240 * decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the
1241 new ABI.
1242
1243 * cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals.
1244 (CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ...
1245 (CLASSTYPE_PURE_VIRTUALS): ... this.
1246 (lang_decl_flags): Replace abstract_virtual with pure_virtual.
1247 (DECL_ABSTRACT_VIRTUAL_P): Rename to ...
1248 (DECL_PURE_VIRTUAL_P): ... this.
1249 (get_abstract_virtuals): Rename to ...
1250 (get_pure_virtuals): ... this.
1251 * call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with
1252 DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with
1253 CLASSTYPE_PURE_VIRTUALS.
1254 * class.c (build_vtable_entry): Likewise.
1255 (finish_struct_bits): Likewise. Call get_pure_virtuals, not
1256 get_abstract_virtuals.
1257 (build_vtbl_initializer): Likewise.
1258 (override_one_vtable): Likewise.
1259 (check_methods): Likewise.
1260 * decl.c (duplicate_decls): Likewise.
1261 (redeclaration_error_message): Likewise.
1262 (lang_mark_tree): Likewise.
1263 * decl2.c (grok_function_init): Likewise.
1264 (import_export_vtable): Likewise.
1265 (import_expor_class): Likewise.
1266 * typeck2.c (abstract_virtuals_error): Likewise.
1267 * xref.c (GNU_xref_member): Likewise.
1268 * search.c (get_abstract_virtuals): Rename to get_pure_virtuals.
1269
1270 1999-12-26 Zack Weinberg <zack@wolery.cumb.org>
1271
1272 * cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING
1273 throughout.
1274
1275 1999-12-26 Mark Mitchell <mark@codesourcery.com>
1276
1277 * decl.c (store_return_init): Use mode of old RTL generated for
1278 DECL_RESULT, not the mode of DECL_RESULT itself.
1279 * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE
1280 for functions that used named return values.
1281
1282 1999-12-24 Mark Mitchell <mark@codesourcery.com>
1283
1284 * semantics.c (expand_body): Use
1285 note_deferral_of_defined_inline_function.
1286
1287 1999-12-22 Mark Mitchell <mark@codesourcery.com>
1288
1289 * dump.c (dequeue_and_dump): Handle CTOR_STMTs.
1290
1291 1999-12-22 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
1292
1293 * error.c (dump_decl): Support named return values.
1294
1295 1999-12-20 Mark Mitchell <mark@codesourcery.com>
1296
1297 * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments.
1298 (CLASSTYPE_HAS_PRIMARY_BASE_P): New macro.
1299 (CLASSTYPE_PRIMARY_BINFO): Likewise.
1300 * class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF,
1301 TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here.
1302 (check_bases_and_members): Set them here instead.
1303 (create_vtable_ptr): New function, split out from ...
1304 (finish_struct_1): ... here. Use it. Tidy. Use
1305 CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO.
1306 * search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as
1307 the first field in the class.
1308 * tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle
1309 seeing TYPE_VFIELD as the first field in the class.
1310
1311 * cp-tree.h (TYPE_VIRTUAL_P): Rename to ...
1312 (TYPE_POLYMORPHIC_P): ... this.
1313 (TYPE_USES_COMPLEX_INHERITANCE): Rename to ...
1314 (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this.
1315 (TREE_CALLS_NEW): Remove.
1316 (TREE_MANGLED): Likewise.
1317 * call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P,
1318 and TYPE_POLYMORPHIC_P.
1319 * class.c (check_bases): Likewise.
1320 (finish_base_struct): Likewise.
1321 (finish_struct_bits): Likewise.
1322 (check_for_override): Likewise.
1323 (finish_struct_1): Likewise.
1324 (get_vfield_name): Likewise.
1325 * decl.c (xref_basetypes): Likewise.
1326 * decl2.c (import_export_class): Likewise.
1327 (import_export_decl): Likewise.
1328 * error.c (dump_function_decl): Likewise.
1329 * pt.c (instantiate_class_template): Likewise.
1330 * repo.c (repo_inline_used): Likewise.
1331 * rtti.c (build_headof): Likewise.
1332 (get_tinfo_fn_dynamic): Likewise.
1333 (build_x_typeid): Likewise.
1334 (get_tinfo_var): Likewise.
1335 (build_dynamic_cast_1): Likewise.
1336 (synthesize_tinfo_fn): Likewise.
1337 * search.c (lookup_field_1): Likewise.
1338 (dfs_debug_mark): Likewise.
1339 (maybe_suppress_debug_info): Likewise.
1340 * typeck.c (build_component_ref): Likewise.
1341 (build_component_addr): Likewise.
1342 * typeck2.c (process_init_constructor): Likewise.
1343
1344 1999-12-20 Nathan Sidwell <nathan@acm.org>
1345
1346 * typeck.c (strip_all_pointer_quals): New static function.
1347 (build_static_cast): Use it. Don't use at_least_as_qualified_p.
1348
1349 1999-12-16 Mark Mitchell <mark@codesourcery.com>
1350
1351 * cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE.
1352 (dso_handle_node): New macro.
1353 (flag_use_cxa_atexit): New variable.
1354 (declare_global_var): New function.
1355 (start_anon_func): Remove declaration.
1356 (end_anon_func): Likewise.
1357 * decl.c (get_atexit_node): New function, split out from
1358 destroy_local_static. Handle flag_use_cxa_atexit.
1359 (get_dso_handle_node): Likewise.
1360 (start_cleanup_fn): Renamed from start_anon_func. Moved here from
1361 except.c. Handle flag_use_cxa_atexit.
1362 (end_cleanup_fn): Renamed from end_anon_func. Moved here from
1363 except.c.
1364 (declare_global_var): New variable.
1365 (destroy_local_static): Handle flag_use_cxa_atexit.
1366 * decl2.c (flag_use_cxa_atexit): New variable.
1367 (lang_f_options): Likewise.
1368 * except.c (start_anon_func): Remove.
1369 (end_anon_func): Liekwise.
1370 * lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit.
1371 * rtti.c (get_tinfo_var): Use declare_global_var.
1372
1373 1999-12-16 Mark Mitchell <mark@codesourcery.com>
1374
1375 * class.c (check_field_decls): Don't return a value.
1376 (avoid_overlap): Moved here from tree.c.
1377 (build_base_fields): Likewise.
1378 (check_bases): New function, split out from finish_base_struct.
1379 (check_bases_and_members): New function, split out from
1380 finish_struct_1.
1381 (struct base_info): Remove cant_have_default_ctor,
1382 cant_have_const_ctor, cant_have_asn_ref.
1383 (finish_base_struct): Split semantic analysis into check_bases.
1384 (finish_struct_methods): Fix bogus assertion.
1385 (check_field_decls): Call finish_struct_anon here.
1386 (build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES.
1387 (finish_struct_1): Use check_bases_and_members. Reorganize.
1388 * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation.
1389 (build_base_fields): Don't declare.
1390 * tree.c (avoid_overlap): Remove.
1391 (build_base_fields): Likewise.
1392
1393 * optimize.c (struct inline_data): Remove scope_stmt.
1394 (remap_block): Don't use insert_block_after_note. Don't update
1395 scope_stmt.
1396 (expand_call_inline): Don't update scope_stmt.
1397 (optimize_function): Don't initialize scope_stmt.
1398 * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted
1399 NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes.
1400
1401 1999-12-15 Mark Mitchell <mark@codesourcery.com>
1402
1403 * class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS
1404 out of the class, rather than taking them as parameters.
1405 (build_vbase_pointer_fields): Move here from tree.c.
1406 (build_vtbl_or_vbase_field): New function.
1407 (check_methods): Likewise.
1408 (remove_zero_width_bitfields): Likewise.
1409 (add_virtual_function): Use tree_cons instead of temp_tree_cons.
1410 (delete_duplicate_fields_1): Tidy. Don't delete duplicate
1411 USING_DECLs here.
1412 (finish_struct_methods): Handle the case where there are no
1413 methods here.
1414 (get_basefndecls): Use tree_cons instead of temp_tree_cons.
1415 (check_field_decls): Call delete_duplicate_fields here.
1416 (finish_struct_1): Tidy. Use check_methods and
1417 remove_zero_width_bitfields.
1418 * cp-tree.h (build_vbase_pointer_fields): Remove.
1419 * decl.c (grokdeclarator): Use tree_cons instead of
1420 temp_tree_cons.
1421 * decl2.c (qualified_lookup_using_namespace): Use tree_cons
1422 instead of temp_tree_cons.
1423 * lex.c (cons_up_default_function): Remove dead code.
1424 * method.c (fixup_pending_inline): New function, split out from ...
1425 (do_inline_function_hair): ... here.
1426 * tree.c (build_vbase_pointer_fields): Remove.
1427
1428 1999-12-15 Jason Merrill <jason@casey.cygnus.com>
1429
1430 * tree.c (walk_tree): Walk operand subtrees in forward order.
1431 * optimize.c (expand_call_inline): Likewise.
1432 (optimize_function): Initialize id->scope_stmt to something useful.
1433 (remap_block): Assume id->scope_stmt has a useful value.
1434
1435 1999-12-15 Nathan Sidwell <nathan@acm.org>
1436
1437 * typeck.c (build_c_cast): Expand warning message. Move pointer
1438 alignment warning to after the cast. Don't warn about pointer
1439 alignment when given a pointer to incomplete.
1440
1441 1999-12-15 Richard Henderson <rth@cygnus.com>
1442
1443 * cp-tree.h (make_aggr_type): Declare.
1444 * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE.
1445 (make_aggr_type): New.
1446
1447 * decl.c (build_typename_type, init_decl_processing): Use it.
1448 (build_ptrmemfunc_type, xref_tag): Likewise.
1449 * except.c (call_eh_info): Likewise.
1450 * init.c (init_init_processing): Likewise.
1451 * pt.c (process_template_parm, lookup_template_class): Likewise.
1452 * rtti.c (expand_class_desc): Likewise.
1453 * semantics.c (begin_class_definition, finish_typeof): Likewise.
1454 * tree.c (copy_template_template_parm): Likewise.
1455
1456 1999-12-15 Jason Merrill <jason@yorick.cygnus.com>
1457
1458 * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using
1459 sizeof (struct tree_common).
1460
1461 1999-12-14 Jason Merrill <jason@casey.cygnus.com>
1462
1463 * optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the
1464 outermost block to point to the inlined function decl.
1465
1466 * error.c (dump_decl): operator==, not operator ==.
1467 (op_to_string): Likewise.
1468
1469 * decl.c (compute_array_index_type): Handle null name.
1470
1471 * decl2.c (ambiguous_decl): Fix to match comment.
1472 (lookup_using_namespace): Adjust.
1473
1474 * decl2.c (import_export_class): Don't ignore dllimport.
1475
1476 1999-12-14 Mark Mitchell <mark@codesourcery.com>
1477
1478 * class.c (check_field_decls): Split out from ...
1479 (finish_struct_1): ... here. Use it. Tidy.
1480
1481 * cp-tree.h (remap_save_expr): Add walk_subtrees parameter.
1482 * optimize.c (copy_body_r): Pass it.
1483 * tree.c (remap_save_expr): Clear walk_subtrees for an
1484 already-handled SAVE_EXPR.
1485 (cp_unsave_r): Pass walk_subtrees to remap_save_expr.
1486
1487 * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
1488 * ir.texi (DECL_NAMESPACE_ALIAS): Document it.
1489
1490 * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.
1491
1492 1999-12-14 Mumit Khan <khan@xraylith.wisc.edu>
1493
1494 * class.c (finish_base_struct): Allow multiple COM base classes
1495 as well as non-COM bases as long as it's not the leftmost.
1496
1497 1999-12-13 Mumit Khan <khan@xraylith.wisc.edu>
1498
1499 * lex.c (saving_parse_to_obstack): New global.
1500 (reinit_parse_for_block): Use.
1501 (reinit_parse_for_expr): Use.
1502 (check_newline): Use.
1503
1504 1999-12-13 Mark Mitchell <mark@codesourcery.com>
1505
1506 * optimize.c (initialize_inlined_parameters): Take FN to which the
1507 parameters belong as an argument.
1508 (expand_call_inline): Expand calls into the parameter
1509 initializations before pushing the function onto the list of
1510 functions we are presently expanding.
1511
1512 1999-12-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1513
1514 * class.c (get_vtable_name): Use a literal format string and
1515 VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT.
1516 (prepare_fresh_vtable): Likewise.
1517
1518 * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of
1519 VTABLE_NAME_FORMAT.
1520
1521 * decl.c (make_rtl_for_local_static): Remove unused variable `type'.
1522
1523 * init.c (build_vec_init): Initialize variable `try_body'.
1524
1525 * lex.c (yyerror): Don't call a variadic function with a
1526 non-literal format string.
1527
1528 * optimize.c (optimize_function): Call memset, not bzero.
1529
1530 * pt.c (for_each_template_parm_r): Add static prototype.
1531
1532 1999-12-09 Andreas Jaeger <aj@suse.de>
1533
1534 * except.c (expand_throw): Add static attribute to match
1535 prototype.
1536
1537 * Makefile.in (semantics.o): Add dependency on output.h.
1538 * semantics.c: Include output.h for declaration of
1539 make_function_rtl.
1540
1541 1999-12-09 Mark Mitchell <mark@codesourcery.com>
1542
1543 * decl.c (init_decl_processing): Reenable inlining on trees.
1544 (finish_function): Likewise.
1545 * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here.
1546 * semantics.c (simplify_aggr_init_exprs): New function.
1547 (expand_body): Use it.
1548 * tree.c (walk_tree): Special-case TARGET_EXPRs since they
1549 sometimes present the same sub-tree twice.
1550
1551 * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
1552 `csl'.
1553
1554 * semantics.c (finish_switch_cond): Do conversions here, not ...
1555 * typeck.c (c_expand_start_case): Here.
1556
1557 * semantics.c (do_poplevel): Remove unused variable.
1558
1559 1999-12-06 Mark Mitchell <mark@codesourcery.com>
1560
1561 * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE
1562 unless we're declaring the variable in question.
1563
1564 1999-12-06 Mark Mitchell <mark@codesourcery.com>
1565
1566 * decl.c (init_decl_processing): #if 0 last patch.
1567 (finish_function): Likewise.
1568
1569 1999-12-05 Mark Mitchell <mark@codesourcery.com>
1570
1571 * decl.c (init_decl_processing): Set flag_inline_trees if
1572 !flag_no_inline.
1573
1574 * cp-tree.h (calls_setjmp_p): Declare.
1575 * decl.c (finish_function): Mark functions that call setjmp as
1576 uninlinable.
1577 * optimize.c (calls_setjmp_r): New function.
1578 (calls_setjmp_p): Likewise.
1579
1580 1999-12-04 Mark Mitchell <mark@codesourcery.com>
1581
1582 * optimize.c (expand_call_inline): Wrap the expanded call in an
1583 EXPR_WITH_FILE_LOCATION node to get correct line numbers for
1584 inlined functions.
1585
1586 * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add
1587 in_target_cleanup_p.
1588 (remap_decl): New function.
1589 (remap_block): Likewise.
1590 (copy_scope_stmt): Likewise.
1591 (copy_body_r): Use remap_decl and copy_scope_stmt.
1592 (copy_body): Use VARRAY_TOP_TREE.
1593 (initialize_inlined_parameters): Likewise.
1594 (declare_return_variable): Likewise.
1595 (inlinable_function_p): Check flag_inline_trees.
1596 (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs
1597 specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the
1598 parameters of the inlined function.
1599 (optimize_function): Prevent recursion into partially complete
1600 functions.
1601
1602 * cp-tree.def (SCOPE_STMT): Take one operand.
1603 * cp-tree.h (SCOPE_STMT_BLOCK): New macro.
1604 (SCOPE_NULLIFIED_P): Redefine.
1605 (SCOPE_NO_CLEANUPS_P): New macro.
1606 (add_scope_stmt): Change prototype.
1607 * decl.c (poplevel): Tidy. Warn about unused variables here.
1608 Record SCOPE_STMT_BLOCKs.
1609 (finish_function): Keep DECL_INITIAL for functions that might be
1610 inlined.
1611 * ir.texi: Document SCOPE_NO_CLEANUPS_P.
1612 * semantics.c: Include rtl.h.
1613 (add_scope_stmt): Return the new scope statement and, for an
1614 end-of-scope statement, its matching begin statement. Don't set
1615 SCOPE_NULLIFIED_P.
1616 (do_pushlevel): Simplify, now that we are always
1617 function-at-a-time.
1618 (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs.
1619 (expand_stmt): Don't call expand_start_bindings or
1620 expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
1621 * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
1622 SCOPE_NULLIFIED_P.
1623 * Makefile.in (semantics.o): Depend on RTL_H.
1624
1625 * decl2.c (pending_statics_used): Make it a macro.
1626 (saved_inlines_used): Likewise.
1627 (finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
1628 (mark_inline_for_output): Likewise.
1629 (ssdf_decls_used): Remove.
1630 (start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
1631 (generate_ctor_or_dtor_function): Adjust accordingly.
1632
1633 1999-11-24 Geoffrey Keating <geoffk@cygnus.com>
1634 Greg McGary <gkm@gnu.org>
1635
1636 * decl.c (duplicate_decls): Merge
1637 DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
1638 DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
1639
1640 1999-12-02 Mike Stump <mrs@wrs.com>
1641
1642 * init.c (perform_member_init): Handle parse errors better.
1643
1644 1999-12-01 Mark Mitchell <mark@codesourcery.com>
1645
1646 * cp-tree.h (min_tree_cons): Remove.
1647 (scratch_ovl_cons): Likewise.
1648 * decl.c (saveable_obstack): Don't declare.
1649 (duplicate_decls): Tweak error-message.
1650 (initialize_local_var): Explicitly mark the definition as static.
1651 (finish_function): Call permanent_allocation, just so
1652 that the middle-end sees the obstacks it expects.
1653 (mark_cp_function_context): Likewise.
1654 * init.c (build_new): Don't use min_tree_cons.
1655 * lex.c (permanent_obstack): Don't declare.
1656 (current_obstack, saveable_obstack): Likewise.
1657 * spew.c (current_obstack, saveable_obstack): Likewise.
1658 * tree.c (current_obstack, saveable_obstack): Likewise.
1659 (scratch_ovl_cons): Remove.
1660 (build_min_nt): Don't mess with obstacks.
1661 (build_min): Likewise.
1662 (min_tree_cons): Remove
1663 * typeck.c (build_component_ref): Don't use scratch_ovl_cons.
1664 (build_x_function_call): Likewise.
1665 (build_c_cast): Don't use min_tree_cons.
1666
1667 1999-11-29 Mark Mitchell <mark@codesourcery.com>
1668
1669 * pt.c (tsubst_decl): Robustify.
1670
1671 1999-11-27 Mark Mitchell <mark@codesourcery.com>
1672
1673 * decl2.c (finish_file): Call expand_body for inline functions
1674 that will be written out but that do not yet have RTL.
1675 * semantics.c (expand_body): Do not generate RTL For inline
1676 functions that do not yet need to be written out.
1677
1678 1999-11-25 Mark Mitchell <mark@codesourcery.com>
1679
1680 * Make-lang.in (CXX_SRCS): Add optimize.c.
1681 * Makefile.in (CXX_OBJS): Add optimize.o.
1682 (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
1683 (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
1684 (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
1685 (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
1686 (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
1687 (dump.o): Likewise.
1688 (optimize.o): New target.
1689 * class.c: Don't include splay-tree.h.
1690 * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
1691 * cp-tree.h: Include splay-tree.h.
1692 (DECL_UNINLINABLE): New macro.
1693 (CTOR_BEGIN_P, CTOR_END_P): New macros.
1694 (flag_inline_trees): New variable.
1695 (local_variable_p): New function.
1696 (nonstatic_local_decl_p): Likewise.
1697 (optimize_function): Likewise.
1698 (cplus_unsave_expr_now): Remove.
1699 (copy_tree_r): Declare.
1700 (remap_save_expr): Likewise.
1701 * decl.c (local_variable_p): Don't
1702 make it static.
1703 (local_variable_p_walkfn): New function.
1704 (make_rtl_for_local_static): Remove code to try to avoid writing
1705 out static constants.
1706 (emit_local_var): Fix indentation.
1707 (nonstatic_local_decl_p): New function.
1708 (check_default_argument): Use local_variable_p_walkfn, not
1709 local_variable_p, when walking the tree.
1710 (start_function): Set the DECL_CONTEXT for automatically generated
1711 labels.
1712 (finish_constructor_body): Use CTOR_STMT to mark the end of a
1713 constructor.
1714 * decl2.c: Don't include splay-tree.h.
1715 (flag_inline_trees): Define.
1716 * dump.c: Don't include
1717 splay-tree.h.
1718 * except.c (expand_end_catch_block): Fix comment formatting.
1719 (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
1720 (expand_throw): Tidy comment.
1721 * init.c (build_vec_delete_1): Use create_temporary_var.
1722 * lex.c (cplus_tree_code_type): Make it static.
1723 (cplus_tree_code_length): Likewise.
1724 (cplus_tree_code_name): Likewise.
1725 * optimize.c: New file.
1726 * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
1727 with computed gotos.
1728 (setup_vtbl_ptr): Mark the beginnings of constructors with
1729 CTOR_STMT.
1730 (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
1731 (expand_body): Call optimize_function. Save bodies if we're doing
1732 inlining on trees.
1733 * tree.c: Don't include splay-tree.h. Include insn-config.h and
1734 integrate.h.
1735 (copy_tree_r): Make it public.
1736 (statement_code_p): New function.
1737 (mark_local_for_remap_r): Likewise.
1738 (cp_usave_r): Likewise.
1739 (cp_unsave): Likewise.
1740 (build_cplus_new): Set DECL_CONTEXT for temporary variables.
1741 (walk_tree): Walk into `s' class nodes. Walk statement chains.
1742 (copy_tree_r): Handle 's' class nodes. Restore chains for
1743 statements. Nullify scopes. Don't copy types.
1744 (init_tree): Set lang_unsave to cp_unsave.
1745 (remap_save_expr): Define.
1746 * ir.texi: Document CTOR_STMT.
1747
1748 1999-11-24 Jason Merrill <jason@casey.cygnus.com>
1749
1750 * search.c (note_debug_info_needed): Do perform this optimization
1751 for dwarf2.
1752 (maybe_suppress_debug_info): Likewise. Start by clearing
1753 TYPE_DECL_SUPPRESS_DEBUG.
1754
1755 1999-11-24 Mark Mitchell <mark@codesourcery.com>
1756
1757 * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
1758
1759 * decl2.c (finish_vtable_vardecl): Don't prune vtables here.
1760
1761 1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1762
1763 * decl.c (pushdecl, grokdeclarator): Don't call a variadic
1764 function with a non-literal format string.
1765
1766 * lex.c (do_identifier): Likewise.
1767
1768 * typeck.c (build_unary_op): Likewise.
1769
1770 1999-11-23 Mark Mitchell <mark@codesourcery.com>
1771
1772 * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
1773
1774 1999-11-22 Mark Mitchell <mark@codesourcery.com>
1775
1776 * cp-tree.def (CTOR_COMPLETE): New tree node.
1777 * decl.c (finish_constructor_body): Add it, to mark the end of the
1778 constructor.
1779 (finish_function): Don't call end_protect_partials here.
1780 * ir.texi (CTOR_COMPLETE): Document it.
1781 * semantics.c (expand_stmt): Handle it.
1782
1783 * cp-tree.def (FUNCTION_NAME): New tree node.
1784 * cp-tree.h (current_function_name_declared): Tweak documentation.
1785 (lang_decl_flags): Add pretty_function_p, adjust dummy.
1786 (DECL_PRETTY_FUNCTION_P): New macro.
1787 * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
1788 etc., in a template function. Use at_function_scope_p instead of
1789 expanding it inline.
1790 * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
1791 specially.
1792 (tsubst): Handle FUNCTION_NAME.
1793 (tsubst_copy): Likewise.
1794 (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
1795 etc. in instantiation.
1796 * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
1797 even in template functions.
1798 (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
1799 conditional scope at the top of a destructor.
1800
1801 * error.c (dump_function_decl): Use `[ with ... ]' syntax for
1802 specializations too.
1803
1804 1999-11-22 Nathan Sidwell <nathan@acm.org>
1805
1806 * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
1807 when actually negative.
1808
1809 * typeck.c (convert_for_assignment): Expand comment about
1810 strange NULL check, moved from ...
1811 (convert_for_initialization): ... here. Remove unneeded
1812 code.
1813
1814 1999-11-21 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
1815
1816 * cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
1817 * init.c (build_vec_delete, build_vec_delete_1): Likewise.
1818 Always destruct virtual bases of array components, but never
1819 delete them.
1820 (build_vec_init): Adjust invocations.
1821 (build_delete): Likewise.
1822 * decl2.c (delete_sanity): Likewise.
1823
1824 1999-11-19 Nathan Sidwell <nathan@acm.org>
1825
1826 * cp-tree.h (grok_method_quals): Return this pointer qualifiers.
1827 * decl.c (grokdeclarator): Adjust calls to grok_method_quals.
1828 * decl2.c (grok_method_quals): Accept `restrict' as applying to
1829 the object pointer. Return such qualifiers.
1830 (grokclassfn): Apply this pointer qualifiers. Cleanup unused
1831 variables.
1832
1833 1999-11-18 Mark Mitchell <mark@codesourcery.com>
1834
1835 * except.c (expand_end_catch_block): Fix typo.
1836 (expand_exception_blocks): Simplify. Don't call
1837 expand_leftover_cleanups.
1838
1839 1999-11-15 Jason Merrill <jason@casey.cygnus.com>
1840
1841 * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
1842 * pt.c (tsubst, case INTEGER_TYPE): Call it.
1843 Check uses_template_parms.
1844
1845 * class.c (finish_struct): If we're a local class in a template
1846 function, add a TAG_DEFN.
1847 * pt.c (lookup_template_class): If this is a local class in a
1848 template function, call pushtag.
1849 (tsubst_expr, case TAG_DEFN): Handle classes, too.
1850
1851 Emit debug info with the vtable.
1852 * search.c (maybe_suppress_debug_info): New function...
1853 * class.c (finish_struct_1): ...split out from here.
1854 * cp-tree.h: Declare it.
1855 * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
1856 if we're writing out the vtable.
1857 * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
1858 note_debug_info_needed): #if 0 out.
1859
1860 1999-11-14 Mark Mitchell <mark@codesourcery.com>
1861
1862 * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
1863 * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
1864 TREE_PERMANENT.
1865 * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
1866 * decl2.c (lookup_arg_dependent): Use it.
1867
1868 * cp-tree.h (cp_finish_decl): Change prototype.
1869 (finish_static_data_member_decl): Likewise.
1870 (push_permanent_obstack): Remove declaration.
1871 (push_expression_obstack): Likewise.
1872 (push_scratch_obstack): Likewise.
1873 (DECL_TEMPLATE_PARM_P): Robustify.
1874 (SET_DECL_TEMPLATE_PARM_P): New macro.
1875 * class.c (add_method): Don't manipulate obstacks.
1876 (finish_vtbls): Likewise.
1877 * cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
1878 * decl.c (binding_for_name): Don't manipulate obstacks.
1879 (maybe_push_to_top_level): Likewise.
1880 (pop_from_top_level): Likewise.
1881 (duplicate_decls): Likewise.
1882 (pushdecl): Likewise.
1883 (implicitly_declare): Likewise.
1884 (build_typename_type): Likewise.
1885 (start_decl): Likewise.
1886 (cp_finish_decl): Likewise.
1887 (finish_decl): Likewise.
1888 (destroy_local_static): Likewise.
1889 (expand_static_init): Likewise.
1890 (complete_array_type): Likewise.
1891 (grokvardecl): Likewise.
1892 (build_ptrmemfnc_type): Likewise.
1893 (grokdeclarator): Likewise.
1894 (xref_tag): Likewise.
1895 (xref_basetypes): Likewise.
1896 (start_enum): Likewise.
1897 (finish_enum): Likewise.
1898 (start_function): Likewise.
1899 (finish_function): Likewise.
1900 (start_method): Adjust call to cp_finish_decl.
1901 * decl2.c (finish_static_data_member_decl): Don't manipulate
1902 obstacks.
1903 (grokfield): Likewise.
1904 (grokbitfield): Likewise.
1905 (get_temp_name): Likewise.
1906 (get_sentry): Likewise.
1907 (fnish_file): Likewise.
1908 (lookup_arg_dependent): Likewise.
1909 * except.c (call_eh_info): Likewise.
1910 (push_eh_info): Likewise.
1911 (do_pop_exception): Likewise.
1912 (initialize_handler_parm): Likewise.
1913 (expand_end_eh_spec): Likewise.
1914 (alloc_eh_object): Likewise.
1915 (expand_throw): Likewise.
1916 * expr.c (extract_scalar_init): Likewise.
1917 * init.c (build_java_class_ref): Likewise.
1918 * lex.c (get_time_identifier): Likewise.
1919 (snarf_defarg): Likewise.
1920 (add_defarg_fn): Likewise.
1921 (is_global): Simplify.
1922 (do_identifier): Don't check TREE_PERMANENT.
1923 * method.c (emit_thunk): Don't manipulate obstacks.
1924 * parse.y (condition): Adjust call to cp_finish_decl.
1925 (primary): Likewise.
1926 (initdcl): Likewise.
1927 (initdcl0_innards): Likewise.
1928 (nomods_initdcl0): Likewise.
1929 * pt.c (push_inline_template_parms_recursive): Use
1930 SET_DECL_TEMPLATE_PARM_P.
1931 (process_template_parm): Likewise.
1932 (lookup_template_class): Don't manipulate obstacks.
1933 (instantiate_class_template): Adjust call to
1934 finish_static_data_member_decl.
1935 (tsubst_decl): Don't manipulate obstacks.
1936 (tsubst_expr): Likewise.
1937 (instantiate_template): Likewise.
1938 (instantiate_decl): Adjust calls to cp_finish_decl.
1939 * rtti.c (call_void_fn): Don't manipulate obstacks.
1940 (get_tinfo_var): Likewise.
1941 (get_tinfo_fn_unused): Likewise.
1942 (build_dynamic_cast_1): Likewise.
1943 (expand_si_desc): Likewise.
1944 (expand_class_desc): Likewise.
1945 (expand_ptr_desc): Likewise.
1946 (expand_attr_desc): Likewise.
1947 (expand_generic_desc): Likewise.
1948 (synthesize_tinfo_fn): Likewise.
1949 * search.c (expand_upcast_fixups): Likewise.
1950 * semantics.c (finish_asm_stmt): Likewise.
1951 (finish_named_return_value): Likewise.
1952 (begin_class_definition): Likewise.
1953 (finish_class_definition): Likewise.
1954 (finish_typeof): Likewise.
1955 * tree.c (build_cplus_method_type): Likewise.
1956 (reverse_path): Likewise.
1957 (copy_template_template_parm): Likewise.
1958 (build_expr_ptr_wrapper): Likewise.
1959 (push_expression_obstack): Remove.
1960 (push_permanent_obstack): Likewise.
1961 * typeck.c (mark_addressable): Likewise.
1962
1963 1999-11-13 Mark Mitchell <mark@codesourcery.com>
1964
1965 * call.c (build_conditional_expr): Use build_target_expr_with_type.
1966 (convert_like): Likewise.
1967 (build_over_call): Likewise.
1968 * cp-tree.h (build_target_expr): Remove.
1969 (build_target_expr_with_type): New function.
1970 * cvt.c (build_up_reference): Use get_target_expr.
1971 * decl.c (build_target_expr): Move to ...
1972 * tree.c (build_target_expr): Here. Make it static.
1973 (build_target_expr_with_type): New function. Set DECL_CONTEXT on
1974 the temporary VAR_DECLs.
1975 (get_target_expr): Use it.
1976
1977 1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
1978
1979 * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
1980 * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
1981 * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
1982 * class.c (set_rtti_entry): Use it.
1983
1984 1999-11-12 Mark Mitchell <mark@codesourcery.com>
1985
1986 * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
1987 here.
1988 * semantics.c (finish_expr_stmt): Call it here instead. Move
1989 default_conversion logic to semantic-analysis time.
1990
1991 1999-11-12 Jason Merrill <jason@yorick.cygnus.com>
1992
1993 * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
1994
1995 Fri Nov 12 12:56:32 MST 1999 Diego Novillo <dnovillo@cygnus.com>
1996
1997 * init.c (init_init_processing): Re-instated Nov 11 patch after
1998 approval.
1999
2000 Fri Nov 12 10:42:02 MST 1999 Diego Novillo <dnovillo@cygnus.com>
2001
2002 * init.c (init_init_processing): Undo patch from Nov 11, 1999.
2003 Patch had not been approved yet.
2004
2005 1999-11-12 Mark Mitchell <mark@codesourcery.com>
2006
2007 * decl.c (compute_array_index_type): New function, split out from
2008 grokdeclarator.
2009 (create_array_type_for_decl): Likewise.
2010 (grokdeclarator): Use them.
2011
2012 * semantics.c (expand_stmt): Don't suspend_momentary or
2013 resume_momentary.
2014
2015 Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com>
2016
2017 * init.c (init_init_processing): Header information for
2018 arrays allocated via `new' should have the same alignment used by
2019 malloc.
2020
2021 1999-11-10 Mark Mitchell <mark@codesourcery.com>
2022
2023 * error.c (dump_function_name): Don't crash if given a friend
2024 pseudo-instantiation.
2025
2026 * cp-tree.h (build_enumerator): Change prototype.
2027 * decl.c (enum_next_value): Remove.
2028 (enum_overflow): Likewise.
2029 (init_decl_processing): Don't register enum_next_value as a root.
2030 (start_enum): Clear TYPE_VALUES for a redefined enum.
2031 (finish_enum): Reset the type of enumeration constants.
2032 (build_enumerator): Fix indentation. Don't copy CONST_DECLs when
2033 we don't need to. Maintain the TYPE_VALUES list and look there
2034 for the previously defined enumeration constant. Let enumeration
2035 constants have the type of their values until the enumeration type
2036 is complete.
2037 * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
2038 (structsp): Adjust.
2039 * parse.c: Regenerated.
2040 * pt.c (tsubst_enum): Adjust according to build_enumerator changes.
2041
2042 Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
2043 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2044
2045 * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
2046
2047 1999-11-09 Mark Mitchell <mark@codesourcery.com>
2048
2049 * cp-tree.h (language_function): Remove x_last_dtor_insn and
2050 x_last_parm_cleanup_insn.
2051 * decl.c (last_dtor_insn): Remove.
2052 (last_parm_cleanup_insn): Likewise.
2053 (expand_start_early_try_stmts): Don't set them.
2054 (store_parm_decls): Likewise.
2055 (save_function_data): Or save them.
2056 (mark_lang_function): Or mark them.
2057
2058 1999-11-08 Mark Mitchell <mark@codesourcery.com>
2059
2060 * decl.c (store_parm_decls): Generate cleanup code at
2061 semantic-analysis time. Destroy objects in the correct order.
2062
2063 1999-11-07 Mark Mitchell <mark@codesourcery.com>
2064
2065 * cp-tree.h (begin_new_placement): Remove.
2066 (finish_new_placement): Likewise.
2067 * class.c (finish_struct_1): Don't suspend_momentary or
2068 resume_momentary.
2069 * decl.c (grokdeclarator): Likewise.
2070 (maybe_build_cleanup_1): Likewise.
2071 * except.c (push_eh_cleanup): Likewise.
2072 (build_terminate_handler): Likewise.
2073 * init.c (build_new_1): Likewise.
2074 * parse.y (parse_decl): Change prototype.
2075 (initdecls, notype_initdecls, initdcl): Don't return int.
2076 (initdcl0, notype_initdcl0, initdcl0_innards): Likewise.
2077 (.begin_new_placement): Remove.
2078 (.finish_new_placement): Likewise.
2079 (nonmomentary_expr): Likewise.
2080 (suspend_mom): Likewise.
2081 (condition): Don't suspend_momentary, resume_momentary, or keep
2082 track of need to resume.
2083 (unary_expr): Likewise.
2084 (new_placement): Likewise.
2085 (decl): Likewise.
2086 (structsp): Likewise.
2087 (new_type_id): Likewise.
2088 (maybe_parmlist): Likewise.
2089 (direct_after_type_declaration): Likewise.
2090 (direct_new_declarator): Likewise.
2091 (direct_abstract_declaration): Likewise.
2092 * parse.c: Regenerated.
2093 * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary.
2094 * semantics.c (begin_new_placement): Remove.
2095 (finish_new_placement): Likewise.
2096
2097 1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de>
2098
2099 * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
2100 (DECL_TEMPLATE_INFO): Use it.
2101 * decl.c (warn_extern_redeclared_static): Do nothing for
2102 TEMPLATE_DECLs.
2103 * decl2.c (mark_used): Explicitly check for function or variable.
2104 * semantics.c (finish_unary_op_expr): Check whether result is also
2105 an INTEGER_CST.
2106
2107 1999-11-05 Mark Mitchell <mark@codesourcery.com>
2108
2109 * Makefile.in (typeck2.o): Depend on output.h.
2110 * typeck2.c: Include output.h.
2111
2112 * decl.c (flag_ansi): Remove declaration.
2113
2114 * pt.c (tinst_level_tick): Make it static.
2115 (last_template_error_tick): Likewise.
2116
2117 * cp-tree.h (mapcar): Remove declaration.
2118 (search_tree): Likewise.
2119 (walk_tree_fn): New typedef.
2120 (walk_tree): New function.
2121 * tree.c (bot_manip): Change prototype. Adjust to be called via
2122 walk_tree.
2123 (bot_replace): Likewise.
2124 (no_linkage_helper): Likewise.
2125 (copy_tree_r): New function.
2126 (search_tree): Rename, and adjust, to become ...
2127 (walk_tree): New function.
2128 (mapcar): Remove.
2129 (target_remap): Remove.
2130 (target_remap_count): Likewise.
2131 (break_out_target_exprs): Use walk_tree.
2132 * decl.c (local_variable_p): Change prototype.
2133 (check_default_argument): Use walk_tree.
2134 * pt.c (for_each_template_parm_r): New function, split out from ...
2135 (for_each_template_parm): Here. Use it, via walk_tree.
2136
2137 1999-11-03 Mark Mitchell <mark@codesourcery.com>
2138
2139 * class.c (check_bitfield_decl): New function, split out from
2140 finish_stuct_1.
2141 (check_field_decl): Likewise. Recursively examine members of
2142 anonymous structs.
2143 (finish_struct_1): Use them.
2144 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
2145
2146 1999-11-02 Mark Mitchell <mark@codesourcery.com>
2147
2148 * decl.c (grokfndecl): Remove dead code.
2149
2150 * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
2151
2152 1999-11-02 Scott Snyder <snyder@fnal.gov>
2153
2154 * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
2155 IMAGPART_EXPR.
2156 * pt.c (tsubst_copy): Likewise.
2157
2158 1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
2159
2160 * decl2.c (maybe_make_one_only): Always make things comdat on
2161 ELF targets, too.
2162
2163 1999-10-31 Mark Mitchell <mark@codesourcery.com>
2164
2165 * decl.c (finish_function): Call free_after_parsing for functions
2166 we are not immediately turning into RTL.
2167
2168 1999-10-31 Brendan Kehoe <brendan@cygnus.com>
2169
2170 * cp-tree.h (flag_dump_translation_unit): Add decl.
2171
2172 Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
2173
2174 * lex.c (yylex): Accept 'f' in mantissa of hex float constant.
2175
2176 1999-10-30 Mark Mitchell <mark@codesourcery.com>
2177
2178 * decl.c (pop_cp_function_context): Don't call free on a NULL
2179 pointer.
2180 * semantics.c: Include ggc.h.
2181 (expand_body): Do garbage-collection after processing a template
2182 function. Clear DECL_SAVED_TREE after generating RTL for a
2183 function.
2184 * Makefile.in (semantics.o): Depend on ggc.h.
2185
2186 1999-10-29 Mark Mitchell <mark@codesourcery.com>
2187
2188 * cp-tree.h (make_typename_type): Change prototype.
2189 * decl.c (make_typename_type): Only complain if so requested.
2190 * parse.y (nested_name_specifier): Adjust calls.
2191 (typename_sub0): Likewise.
2192 (typename_sub1): Likewise.
2193 * parse.c: Regenerated.
2194 * pt.c (convert_template_argument): Pass complain to
2195 make_typename_type.
2196 (tsubst): Likewise.
2197
2198 1999-10-28 Mark Mitchell <mark@codesourcery.com>
2199
2200 * semantics.c (finish_handler): End the scope of the handler
2201 before attaching it to the statement-tree.
2202
2203 1999-10-28 Ian Lance Taylor <ian@zembu.com>
2204
2205 * rtti.c (build_dynamic_cast_1): Give a better error message for
2206 an attempt to dynamic_cast from a non-polymorphic type.
2207
2208 1999-10-27 Mark Mitchell <mark@codesourcery.com>
2209
2210 * cp-tree.h (make_temp_vec): Remove.
2211 (make_scratch_vec): Likewise.
2212 * call.c (add_function_candidate): Use make_tree_vec.
2213 (add_conv_candidate): Likewise.
2214 (build_builtin_candidate): Likewise.
2215 (add_template_candidate_real): Likewise.
2216 * class.c (resolve_address_of_overloaded_function): Likewise.
2217 * decl.c (start_function): Don't fool with the momentary obstack.
2218 (finish_function): Likewise.
2219 * init.c (expand_direct_vtbls_init): Likewise.
2220 (begin_init_stmts): Likewise.
2221 (finish_init_stmts): Likewise.
2222 * pt.c (add_to_template_args): Use make_tree_vec.
2223 (check_explicit_specialization): Likewise.
2224 (coerce_template_parms): Likewise.
2225 (lookup_template_class): Don't fool with the momentary obstack.
2226 (instantiate_class_template): Likewise.
2227 (tsubst_template_arg_vector): Use make_tree_vec.
2228 (tsubst_aggr_type): Don't fool with the momentary obstack.
2229 (tsubst_decl): Likewise. Use make_tree_vec.
2230 (try_one_overload): Likewise.
2231 (try_class_unification): Don't fool with the momentary obstack.
2232 (get_bindings_real): Use make_tree_vec.
2233 (set_mangled_name_for_template_decl): Likewise.
2234 * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
2235 * semantics.c (finish_expr_stmt): Likewise.
2236 (finish_do_stmt): Likewise.
2237 (finish_for_expr): Likewise.
2238 (finish_switch_cond): Likewise.
2239 (do_pushlevel): Likewise.
2240 (do_poplevel): Likewise.
2241 * tree.c (make_temp_vec): Remove.
2242
2243 * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump
2244 CLEANUP_P for a TRY_BLOCK.
2245 * ir.texi: Document SAVE_EXPR.
2246
2247 Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
2248
2249 * call.c (build_over_call): Check that the built-in function is
2250 of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
2251 * typeck.c (build_function_call_real): Similarly.
2252
2253 1999-10-26 Mark Mitchell <mark@codesourcery.com>
2254
2255 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
2256 remember_end_note.
2257
2258 1999-10-24 Mark Mitchell <mark@codesourcery.com>
2259
2260 * decl.c (push_overloaded_decl_1): Use pushdecl.
2261
2262 * decl.c (auto_function): Replace #ifdef'd __inline with just
2263 plain inline.
2264 * lex.c (my_get_run_time): Likeise.
2265 (yyprint): Likewise.
2266 (identifier_type): Likewise.
2267 * method.c (start_squangling): Likewise.
2268 (end_squangling): Likewise.
2269 (icat): Likewise.
2270 (old_backref_index): Likewise.
2271 (flush_repeats): Likewise.
2272 (issue_ktype): Likewise.
2273 * parse.y (empty_parms): Likewise.
2274 * parse.c: Regenerated.
2275
2276 1999-10-21 Mark Mitchell <mark@codesourcery.com>
2277
2278 * dump.c (dequeue_and_dump): Replace several uses of
2279 queue_and_dump_index with dump_child.
2280
2281 1999-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2282
2283 * expr.c: Include tm_p.h.
2284
2285 1999-10-21 Mark Mitchell <mark@codesourcery.com>
2286
2287 * cp-tree.h (SCOPE_PARTIAL_P): New macro.
2288 (pushlevel_temporary): Remove.
2289 (add_scope_stmt): New function.
2290 * decl.c (pushlevel_temporary): Remove.
2291 (poplevel): Use add_scope_stmt.
2292 (start_decl_1): Likewise.
2293 * semantics.c (add_scope_stmt): New function.
2294 (do_pushlevel): Use it.
2295 (do_poplevel): Use it.
2296 (expand_stmt): Check SCOPE_PARTIAL_P.
2297
2298 * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
2299 * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
2300 * expr.c (cplus_expand_expr): Expand it.
2301 * ir.texi: Document EMPTY_CLASS_EXPR.
2302
2303 1999-10-20 Mark Mitchell <mark@codesourcery.com>
2304
2305 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
2306 parameters as having namespace scope.
2307
2308 1999-10-19 Mark Mitchell <mark@codesourcery.com>
2309
2310 * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
2311 (mangling_flags): New type.
2312 (build_overload_int): Change prototype.
2313 (build_overload_value): Likewise.
2314 (numeric_output_need_bar): Improve comment.
2315 (mangle_expression): New function, broken out from ...
2316 (build_overload_int): Here.
2317 (build_overload_value): Adjust for use of mangling flags. Don't
2318 warn about real-valued template parameters here. Do handle
2319 complex expressions involving real-valued template parameters.
2320 (build_template_parm_names): Encase non-type template parameters
2321 in underscores, if necessary.
2322 (process_overload_item): Remove conditional on
2323 PARM_CAN_BE_ARRAY_TYPE.
2324
2325 1999-10-17 Mark Mitchell <mark@codesourcery.com>
2326
2327 * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
2328
2329 * ir.texi: Clean up documentation of RETURN_INIT.
2330
2331 1999-10-15 Greg McGary <gkm@gnu.org>
2332
2333 * lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
2334 (lang_init): Set default for flag_bounds_check if still "unspecified".
2335
2336 1999-10-13 Andrew Haley <aph@cygnus.com>
2337
2338 * class.c (finish_struct_1): Force alignment of non-bitfields to
2339 BITS_PER_UNIT.
2340
2341 Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
2342
2343 * typeck2.c (process_init_constructor): Handle empty constructors.
2344
2345 1999-10-13 Jason Merrill <jason@yorick.cygnus.com>
2346
2347 * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
2348
2349 * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
2350 array error.
2351
2352 1999-10-13 Mark Mitchell <mark@codesourcery.com>
2353
2354 * decl.c (make_rtl_for_local_static): Don't create register RTL
2355 for addressable constants.
2356
2357 1999-10-13 Nathan Sidwell <nathan@acm.org>
2358
2359 * cp-tree.h (build_x_va_arg): Prototype new function.
2360 * call.c (build_x_va_arg): Define it.
2361 * parse.y (unary_expr): Call build_x_va_arg.
2362
2363 * cp-tree.h (convert_type_from_ellipsis): Prototype new function.
2364 * call.c (convert_type_from_ellipsis): Define it.
2365 * decl.c (init_decl_processing): Set lang_type_promotes_to.
2366
2367 * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
2368
2369 1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
2370
2371 * class.c (fixed_type_or_null): Always set *nonnull.
2372
2373 1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2374
2375 * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
2376 __GNUC__ and __GNUC_MINOR__.
2377
2378 1999-10-09 Mark Mitchell <mark@codesourcery.com>
2379
2380 * cp-tree.h (make_rtl_for_local_static): New function.
2381 * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
2382 local statics ...
2383 (make_rtl_for_local_static): Here.
2384 * semantics.c (expand_stmt): Use make_rtl_for_local_static.
2385
2386 1999-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2387
2388 * method.c: Include tm_p.h.
2389
2390 1999-10-7 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
2391
2392 * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
2393 * lex.c (cp_make_lake_type): Likewise.
2394 * tree.c (init_tree): Init make_lang_type_fn.
2395
2396 1999-10-07 Mark Mitchell <mark@codesourcery.com>
2397
2398 * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
2399 paramter.
2400
2401 * semantics.c (expand_stmt): Don't pretend to have asmspecs for
2402 local statics if we don't really have them.
2403
2404 * ir.texi: Improve documentation for STMT_EXPR. Describe
2405 CLEANUP_POINT_EXPR.
2406
2407 1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
2408
2409 * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
2410
2411 1999-10-07 Greg McGary <gkm@gnu.org>
2412
2413 * class.c (finish_struct_1): Use simpler method of
2414 removing elements of a singly-linked list which doesn't
2415 lose for classes without data members.
2416
2417 1999-10-07 Mark Mitchell <mark@codesourcery.com>
2418
2419 * friend.c (make_friend_class): Robustify.
2420
2421 * semantics.c (finish_object_call_expr): Reject calls to template
2422 types.
2423
2424 1999-10-06 Mark Mitchell <mark@codesourcery.com>
2425
2426 * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
2427
2428 * cp-tree.h (CLASSTYPE_VFIELD): Remove.
2429 * call.c (build_vfield_ref): Use TYPE_VFIELD, not
2430 CLASSTYPE_VFIELD.
2431 * class.c (get_vfield_offset): Likewise.
2432 (finish_base_struct): Likewise.
2433 (modify_one_vtable): Likewise.
2434 (fixup_vtable_deltas): Likewise.
2435 (finish_struct_1): Likewise.
2436 * init.c (expand_virtual_init): Likewise.
2437 * search.c (lookup_field_1): Likewise.
2438 (expand_upcast_fixups): Likewise.
2439 * typeck.c (build_component_ref): Likewise.
2440 (build_binary_op_nodefault): Likewise.
2441
2442 * dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
2443 * ir.texi: Document TYPE_VFIELD.
2444
2445 1999-10-06 Brendan Kehoe <brendan@cygnus.com>
2446
2447 * decl.c (grokdeclarator): Only warn about non-zero arrays if
2448 !in_system_header (linux socketbits.h can give this for
2449 __cmsg_data, which is using a GNU extension).
2450
2451 1999-10-05 Mark Mitchell <mark@codesourcery.com>
2452
2453 * decl2.c (start_static_storage_duration_function): Push the
2454 function declaration so it ends up in namespace scope.
2455
2456 * dump.c (DUMP_CHILDREN): Remove.
2457 (DUMP_BINFO): Adjust.
2458 (struct dump_node_info): Remove dump_children_p.
2459 (queue_and_dump_type): Remove dump_children_p parameter.
2460 (queue): Don't set dump_children_p.
2461 (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
2462 queue_and_dump_index.
2463 (dequeue_and_dump): Unconditionally print children. Adjust calls
2464 to functions mentioned above.
2465 (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
2466
2467 * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
2468 * dump.c (dequeue_and_dump): Dump them.
2469
2470 * method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
2471
2472 * decl.c (start_function): Set current_in_charge_parm for
2473 constructors, too, where appropriate.
2474 * search.c (fixup_all_virtual_upcast_offsets): New function.
2475 (expand_indirect_vtbls_init): Use it.
2476
2477 1999-10-04 Nathan Sidwell <nathan@acm.org>
2478
2479 * decl2.c (grok_alignof): Don't decay lvalues.
2480
2481 * init.c (build_new): Remove unused variable.
2482
2483 1999-10-04 Mark Mitchell <mark@codesourcery.com>
2484
2485 * cp-tree.h (struct language_function): Remove static_labelno.
2486 (static_labelno): Remove macro.
2487 * method.c (build_overload_nested_name): Make static_labelno
2488 static here.
2489
2490 * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
2491 to decide whether or not a function is defined.
2492
2493 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
2494 situations where make_node will do it automatically.
2495 * decl.c (grok_reference_init): Likewise.
2496 (expand_static_init): Likewise.
2497 (do_static_initialization): Likewise.
2498 * init.c (perform_member_init): Likewise.
2499 (expand_aggr_init_1): Likewise.
2500 (build_new_1): Likewise.
2501 * method.c (do_build_copy_constructor): Likewise.
2502 (do_build_assign_ref): Likewise.
2503 * search.c (expand_upcast_fixups): Likewise.
2504 * semantics.c (finish_stmt_expr): Likewise.
2505 * typeck.c (build_unary_op): Likewise.
2506 (check_return_expr): Likewise.
2507
2508 1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
2509
2510 * init.c (build_vec_delete_1): Fold COND_EXPRs.
2511
2512 1999-10-03 Mark Mitchell <mark@codesourcery.com>
2513
2514 * cp-tree.def (VEC_INIT_EXPR): Remove.
2515 * cp-tree.h (struct stmt_tree): New type.
2516 (struct saved_scope): Remove firstobj. Add x_saved_tree,
2517 x_stmt_tree.
2518 (class_cache_firstobj): Remove.
2519 (struct language_function): Remove stmts_are_full_exprs_p,
2520 x_last_tree, and x_last_expr_type. Add x_stmt_tree.
2521 (current_stmt_tree): New macro.
2522 (last_tree): Adjust.
2523 (last_expr_type): Likewise.
2524 (doing_semantic_analysis_p): Simplify.
2525 (stmts_are_full_exprs_p): Adjust.
2526 (begin_tree): Remove prototype.
2527 (end_tree): Likewise.
2528 (begin_stmt_tree): Change prototype.
2529 (finish_stmt_tree): Likewise.
2530 (building_stmt_tree): Simplify.
2531 * decl.c (mark_stmt_tree): New function.
2532 (mark_saved_scope): Use it.
2533 (start_function): Rearrange slightly to call begin_stmt_tree
2534 earlier.
2535 (save_function_data): Tweak.
2536 (finish_function): Adjust call to finish_stmt_tree.
2537 (mark_lang_function): Use mark_stmt_tree.
2538 * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
2539 * init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
2540 (build_vec_init): Remove creation of stand-in intializer.
2541 * pt.c (begin_tree): Remove.
2542 (end_tree): Likewise.
2543 * semantics.c (SET_LAST_STMT): New macro. Use it throughout.
2544 (begin_compound_stmt): Handle a compound-statement outside of a
2545 function.
2546 (begin_stmt_expr): Handle a statement-expression outsidef of a
2547 function.
2548 (finish_stmt_expr): Likewise.
2549 (begin_class_definition): Don't call begin_tree.
2550 (finish_inline_definitions): Don't call end_tree.
2551 (begin_stmt_tree): Take a pointer to tree, not a function as input.
2552 (finish_stmt_tree): Likewise.
2553 * tree.c (search_tree): Don't handle VEC_INIT_EXPR.
2554 (mapcar): Likewise.
2555
2556 * parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
2557 * parse.c: Regenerated.
2558
2559 * dump.c (dqueue_and_dump): Dump bitfieldness.
2560
2561 * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
2562 bitfields, rather than DECL_BIT_FIELD.
2563 * ir.texi: Document how to tell whether or not a field is a
2564 bitfield.
2565
2566 * lex.c (make_lang_type): Fix typo in comment.
2567
2568 1999-10-01 Jason Merrill <jason@yorick.cygnus.com>
2569
2570 * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
2571
2572 1999-10-01 Mark Mitchell <mark@codesourcery.com>
2573
2574 * pt.c (tsubst_decl): If the type of a template instantiation is
2575 bogus, so is the whole instantiation.
2576
2577 1999-09-30 Mark Mitchell <mark@codesourcery.com>
2578
2579 * decl.c (initialize_local_var): Handle static variables here.
2580 (cp_finish_decl): Tweak handling of function-scope static
2581 variables.
2582 * semantics.c (expand_stmt): Handle DECL_STMTs for static
2583 variables.
2584
2585 * method.c (emit_thunk): Don't crash when -fsyntax-only.
2586
2587 * cp-tree.h (lang_decl_flags): Add global_ctor_p and
2588 global_dtor_p. Add init_priority.
2589 (DECL_ACCESS): Adjust accordingly.
2590 (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
2591 (GLOBAL_INIT_PRIORITY): Likewise.
2592 * decl.c (lang_mark_tree): Adjust accordingly.
2593 (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
2594 and GLOBAL_INIT_PRIORITY.
2595 * dump.c (dequeue_and_dump): Print them.
2596 * ir.texi: Document them.
2597
2598 * decl2.c (struct priority_info_s): Remove initialization_sequence
2599 and destruction_sequence.
2600 (start_static_storage_duration_function): Return the body of the
2601 function. Convert for function-at-a-time mode.
2602 (generate_inits_for_priority): Remove.
2603 (finish_static_storage_duration_function): Change prototype.
2604 Adjust for function-at-a-time mode.
2605 (do_static_initialization): Likewise.
2606 (do_static_destruction): Likewise.
2607 (do_static_initialization_and_destruction): Remove.
2608 (start_static_initialization_or_destruction): New function.
2609 (finish_static_initialization_or_destruction): Likewise.
2610 (get_priority_info): Don't manipulation initialization_sequence or
2611 destruction_sequence.
2612 (prune_vars_needing_no_initialization): New function.
2613 (write_out_vars): Likewise.
2614 (finish_file): Use the various new functions instead of the old.
2615
2616 Thu Sep 30 00:13:27 1999 Dirk Zoller <duz@rtsffm.com>
2617
2618 * cp-tree.h (warn_float_equal): Declare.
2619 * decl2.c (warn_float_equal): Define.
2620 (lang_decode_option): Recognize -W[no-]float-equal.
2621 * typeck.c (build_binary_op_nodefault): Conditionally warn
2622 about equality tests of floating point types.
2623
2624 1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
2625
2626 Support normal type_info-based EH mechanisms with -fno-rtti.
2627 * except.c (build_eh_type_type): Remove special -fno-rtti handling.
2628 (build_eh_type_type_ref): Likewise.
2629 (build_eh_type): Remove.
2630 (expand_throw): Call build_eh_type_type, not build_eh_type.
2631 * decl2.c (import_export_decl): Don't associate the tinfo fn with
2632 the vtable if -fno-rtti.
2633 * decl.c (init_decl_processing): Always init_rtti_processing.
2634
2635 * rtti.c (get_typeid): Don't complain about -fno-rtti.
2636
2637 * class.c (class_cache_obstack, class_obstack): Remove.
2638 (init_class_processing): Don't initialize class_obstack.
2639 (push_cache_obstack): Remove.
2640 (pushclass): Don't call it.
2641 * cp-tree.h: Remove prototype for push_cache_obstack.
2642 * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
2643 (pushlevel_class): Don't push_decl_level.
2644 (poplevel_class): Don't pop_stack_level.
2645 (push_class_level_binding): Don't push_cache_obstack.
2646 (init_decl_processing): Don't intialize decl_obstack.
2647 * search.c (push_class_decls): Don't push_cache_obstack.
2648 * tree.c (list_hash_add): Put hash node on permanent_obstack.
2649 (hash_tree_cons): Don't mess with obstacks.
2650 (print_lang_statistics): Don't print stats for class_obstack and
2651 decl_obstack.
2652
2653 1999-09-29 Mark Mitchell <mark@codesourcery.com>
2654
2655 * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
2656 * ir.texi: Document DECL_EXTERNAL.
2657
2658 * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
2659 * ir.texi: Document THUNK_DECLs.
2660
2661 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
2662 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
2663 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
2664 * error.c (dump_template_bindings): Remove unused parameter.
2665 Handle multiple levels of template parameters.
2666 (dump_template_decl): Use `parms', not `args', for template
2667 parameters. Fix thinko.
2668 (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass
2669 flags to dump_template_bindings.
2670 * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
2671 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
2672 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
2673 (tsubst_copy): Clarify variable name.
2674 (most_general_template): Robustify.
2675
2676 1999-09-29 Nathan Sidwell <nathan@acm.org>
2677
2678 * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
2679 to change primary template rendering.
2680
2681 1999-09-29 Mark Mitchell <mark@codesourcery.com>
2682
2683 * cp-tree.h (UPT_TEMPLATE): Remove.
2684 (UPT_PARMS): Likewise.
2685 (DECL_NEEDED_P): New macro.
2686 * decl2.c (finish_vtable_vardecl): Use it.
2687 (finish_objects): Don't crash with -fsyntax-only.
2688 (finish_file): Use DECL_NEEDED_P. Don't prune vtables when
2689 -fsyntax-only.
2690 * pt.c (tsubst_friend_function): Remove FIXME that talks about
2691 obstacks.
2692 (tsubst_expr): Correct handling of function try-blocks.
2693 * semantics.c: Include flags.h.
2694 (expand_body): Don't do RTL generation if -fsyntax-only.
2695 * Makefile.in (semantics.o): Depends on flags.h.
2696
2697 1999-09-28 Gabriel Dos Reis <gdr@codesourcery.com>
2698
2699 * pt.c (most_general_template): Adjust declaration.
2700
2701 * cp-tree.h: (most_general_template): Declare.
2702
2703 * error.c (dump_template_value): Rename to ...
2704 (dump_template_argument): This.
2705 (dump_template_argument_list): New function.
2706 (dump_type): Use it.
2707 (dump_template_parameter): New function.
2708 (dump_template_decl): Use it.
2709 (dump_template_bindings): New function.
2710 (dump_function_decl): Use it. Pretty print function template
2711 instantiations.
2712
2713 1999-09-28 Nathan Sidwell <nathan@acm.org>
2714
2715 * decl.c (grokdeclarator): Distinguish parameter context for
2716 diagnostics. Tidy up missing type diagnostic.
2717 Diagnose `explicit' in one place. Diagnose `mutable' in one place.
2718
2719 1999-09-28 Mark Mitchell <mark@codesourcery.com>
2720
2721 * ir.texi: Improve documentation for TARGET_EXPR.
2722
2723 1999-09-27 Nathan Sidwell <nathan@acm.org>
2724
2725 Augment stringification of trees.
2726 * cp-tree.h (tree_string_flags): New error stringifying enumeration.
2727 (fndecl_as_string, type_as_string_real, args_as_string,
2728 code_as_string, language_as_string, parm_as_string,
2729 op_as_string, assop_as_string, cv_as_string): Remove.
2730 (type_as_string, decl_as_string, expr_as_string): Adjust prototype.
2731 (context_as_string): Declare new function.
2732 * error.c (cp_printers): Move definition.
2733 (OB_UNPUT): Remove.
2734 (OB_END_TEMPLATE_ID): Adjust.
2735 (interesting_scope_p): Remove.
2736 (dump_scope): New static function.
2737 (dump_qualifiers): Adjust prototype, reimplement.
2738 (dump_template_value): Use tree_string_flags.
2739 (dump_type_real): Move back to dump_type.
2740 (dump_type): Adjust prototype. Use tree_string_flags.
2741 (dump_aggr_type): Likewise. Use dump_template_parms.
2742 (dump_type_prefix): Adjust prototype. Use tree_string_flags.
2743 Return pad flag.
2744 (dump_type_suffix): Adjust prototype. Use tree_string_flags.
2745 (dump_simple_decl): Likewise.
2746 (dump_decl): Likewise. Use dump_template_decl.
2747 (dump_template_decl): New static function broken out of dump_decl.
2748 (dump_function_decl): Adjust prototype. Use tree_string_flags.
2749 (dump_parameters): Likewise. Prefix space.
2750 (dump_exception_spec): Adjust prototype. Use tree_string_flags.
2751 (dump_function_name): Likewise. Use dump_template_parms.
2752 (dump_template_parms): New static function broken out of
2753 dump_function_name.
2754 (dump_expr_list): Adjust prototype. Use tree_string_flags.
2755 (dump_expr): Likewise.
2756 (fndecl_as_string): Removed
2757 (type_as_string_real): Removed
2758 (dump_binary_op): Adjust prototype. Use tree_string_flags.
2759 (dump_unary_op): Likewise.
2760 (type_as_string): Likewise.
2761 (expr_as_string): Likewise.
2762 (decl_as_string): Likewise.
2763 (context_as_string): New function.
2764 (lang_decl_name): Adjust.
2765 (decl_to_string): New static print callback.
2766 (expr_to_string): Likewise.
2767 (fndecl_to_string): Likewise.
2768 (code_as_string): Renamed to ...
2769 (code_to_string): ... here. Adjust.
2770 (language_as_string): Renamed to ...
2771 (language_to_string): ... here. Adjust.
2772 (parm_as_string): Renamed to ...
2773 (parm_to_string): ... here.
2774 (op_as_string): Renamed to ...
2775 (op_to_string): ... here.
2776 (assop_as_string): Renamed to ...
2777 (assop_to_string): ... here.
2778 (type_to_string): New static print callback.
2779 (args_as_string): Renamed to ...
2780 (args_to_string): ... here. Adjust.
2781 (cv_as_string): Renamed to ...
2782 (cv_to_string): ... here. Adjust.
2783 * pt.c (mangle_class_name_for_template): Use tree_string_flags.
2784 (print_template_context): Likewise.
2785
2786 1999-09-26 Mark Mitchell <mark@codesourcery.com>
2787
2788 * cp-tree.h (expand_throw): Remove prototype.
2789 * except.c (expand_throw): Make it static. Use tree-generation
2790 functions, rather than RTL-generation functions.
2791 (build_throw): Use it.
2792 * expr.c: Include except.h.
2793 (cplus_expand_expr): Don't call expand_throw here.
2794 * Makefile.in (expr.o): Depend on except.h.
2795 * ir.texi: Update documentation for THROW_EXPR.
2796
2797 * decl.c (start_function): Set x_dont_save_pending_sizes rather
2798 than calling get_pending_sizes.
2799 * init.c (build_new): Don't save and restore
2800 immediate_size_expand; instead, assert that it has the expected
2801 value already.
2802
2803 1999-09-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2804
2805 * lex.c (compiler_error): Add missing call to va_end().
2806
2807 1999-09-25 Mark Mitchell <mark@codesourcery.com>
2808
2809 * dump.c (dequeue_and_dump): Handle RESULT_DECL.
2810 * ir.texi: Document RESULT_DECL and DECL_RESULT.
2811
2812 * cp-tree.h (check_return_expr): New function.
2813 * decl.c (finish_constructor_body): New function.
2814 (pushdecl): Put global friend functions in namespace binding
2815 level, not the class binding level.
2816 (finish_destructor_body): Make sure the dtor_label is always
2817 defined. Fix typo in comment.
2818 (finish_function): Move generation of constructor-termination code
2819 to semantic-analysis time. Move generation of implicit `main'
2820 return value to semantic-analysis time.
2821 * semantics.c (finish_return_stmt): Generate goto's to
2822 ctor_label/dtor_label here. Use check_return_expr to do semantic
2823 analysis on the returned expression.
2824 * typeck.c (maybe_warn_about_returning_address_of_local): New
2825 function split out from c_expand_return.
2826 (check_return_expr): Likewise.
2827 (c_expand_return): Just generate the RTL for the return.
2828
2829 1999-09-24 Mark Mitchell <mark@codesourcery.com>
2830
2831 * cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
2832 (cleanup_type): Likewise.
2833 (search_tree): Change prototype.
2834 * decl.c (local_variable_p): Adjust for new interface to
2835 search_tree.
2836 (check_default_argument): Likewise.
2837 * error.c (dump_expr): Handle INIT_EXPR.
2838 * except.c (expand_throw): Don't make cleanup_type a local static.
2839 * expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
2840 * init.c (build_new): Call build_new_1 directly, rather than
2841 building a NEW_EXPR.
2842 (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when
2843 processing file-scope initializers.
2844 * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
2845 * tree.c: Include splay-tree.h
2846 (no_linkage_helper): Adjust for new interface to search_tree.
2847 (search_tree): Pass around pointers to tree nodes, rather than the
2848 nodes themselves. Handle VEC_INIT_EXPR.
2849 (no_linkage_check): Adjust for new interface to search_tree.
2850 (mapcar): Handle VEC_INIT_EXPR.
2851 (target_remap): New variable.
2852 (bot_manip): Use it.
2853 (bot_replace): New function.
2854 (break_out_target_exprs): Use it to remap all variables used in a
2855 default argument expression.
2856 * typeck.c (build_modify_expr): Don't crash when outside a
2857 function and presented with an INIT_EXPR assignment
2858 * Makefile.in (tree.o): Depend on splay-tree.h.
2859
2860 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
2861
2862 * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
2863 DECL_BUILT_IN.
2864 (builtin_function): New arg CLASS. Arg CODE now of type int. All
2865 callers changed.
2866 Set the builtin's DECL_BUILT_IN_CLASS.
2867
2868 1999-09-24 Mark Mitchell <mark@codesourcery.com>
2869
2870 * decl.c (pushdecl): Don't make local declarations of extern
2871 variables give the variable a DECL_CONTEXT for the function.
2872 (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify.
2873 Don't accidentally make RTL for local declarations.
2874 (emit_local_var): Handle declarations with asm-specifiers here.
2875
2876 1999-09-23 Mark Mitchell <mark@codesourcery.com>
2877
2878 * ir.texi: Improve documentation for TARGET_EXPRs. Discuss
2879 STMT_IS_FULL_EXPR_P.
2880
2881 * cp-tree.h (language_function): Add cannot_inline.
2882 * decl.c (start_function): Restore current_function_cannot_inline
2883 from the saved value.
2884 (save_function_data): Save current_function_cannot_inline.
2885 * decl2.c (start_objects): Change prototype. Build the function
2886 in function-at-a-time mode.
2887 (finish_objects): Likewise.
2888 (generate_ctor_or_dtor_function): Adjust accordingly.
2889
2890 * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
2891 * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
2892 Don't call expand_anon_union_decl here
2893 * semantics.c (exapnd_stmt): Call it here, instead.
2894 * typeck.c (mark_addressable): Addressed variables are implicitly
2895 used.
2896
2897 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
2898
2899 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
2900 (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
2901 (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
2902 * cp-tree.h: Add tree checking macros to various tree access
2903 macros.
2904 * ptree.c (print_lang_decl): Test for function or variable
2905 before accessing template info.
2906
2907 1999-09-23 Jason Merrill <jason@yorick.cygnus.com>
2908
2909 * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
2910 * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
2911 * decl2.c (lang_f_options): Add -fshort-wchar.
2912 * cp-tree.h: Declare flag_short_wchar.
2913 * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned
2914 int' for wchar_t.
2915
2916 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
2917
2918 * ir.texi: Fix formatting errors and typos.
2919
2920 1999-09-22 Mark Mitchell <mark@codesourcery.com>
2921
2922 * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
2923
2924 * decl.c (pushdecl): Do create a binding for extern "C" functions,
2925 but not for their DECL_ASSEMBLER_NAMEs.
2926 (lookup_name_current_level): Fix formatting.
2927 (xref_tag): Likewise.
2928 * decl2.c (start_objects): Mark static constructors and
2929 destructors as used.
2930
2931 1999-09-22 Jason Merrill <jason@yorick.cygnus.com>
2932
2933 * decl.c (define_case_label): Don't crash if we're not in a switch.
2934
2935 * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
2936 * lang-options.h: Restore -fthis-is-variable. Remove help strings
2937 for unsupported flags.
2938
2939 1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
2940
2941 * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
2942 Accept and warn about -fthis-is-variable.
2943
2944 1999-09-21 Mark Mitchell <mark@codesourcery.com>
2945
2946 * dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
2947 CLEANUP_STMT, and SCOPE_STMT.
2948
2949 * decl2.c (lang_decode_option): Adjust, in the wake of recent
2950 changes to option processing.
2951
2952 1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
2953
2954 * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
2955 function pointer from pmfs with no object given.
2956 (convert_for_assignment): Do not return error when converting
2957 pmfs.
2958
2959 1999-09-21 Alex Samuel <samuel@codesourcery.com>
2960
2961 * lex.c (internal_filename): New variable.
2962 (INTERNAL_FILENAME): New macro.
2963 (init_parse): Allocate internal_filename and mark as root. Use it
2964 instead of a string constant.
2965
2966 1999-09-21 Nathan Sidwell <nathan@acm.org>
2967
2968 Reimplement dynamic cast and catch matching.
2969 * cp-tree.h (get_dynamic_cast_base_type): Prototype new function
2970 * search.c (dynamic_cast_base_recurse): New function.
2971 (get_dynamic_cast_base_type): New function for dynamic cast.
2972 * rtti.c (build_dynamic_cast_1): Determine source and target
2973 class relationship. Call __dynamic_cast_2.
2974 * tinfo.h (__user_type_info::upcast): New catch dispatcher.
2975 (__user_type_info::dyncast): New dynamic cast dispatcher.
2976 (__user_type_info::sub_kind): New nested enumeration.
2977 (__user_type_info::contained_p): sub_kind predicate.
2978 (__user_type_info::contained_public_p): Likewise.
2979 (__user_type_info::contained_nonpublic_p): Likewise.
2980 (__user_type_info::contained_nonvirtual_p: Likewise.
2981 (__user_type_info::upcast_result): New nested struct.
2982 (__user_type_info::dyncast_result): New nested struct.
2983 (*::do_upcast): New catch function.
2984 (*::do_dyncast): New dynamic cast function.
2985 (__user_type_info::find_public_subobj): New dynamic cast
2986 helper dispatcher.
2987 (*::do_find_public_subobj): New dynamic cast helper function.
2988 * tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
2989 (__user_type_info::dyncast): Define dynamic cast dispatcher.
2990 (*::do_upcast): Define catch function.
2991 (*::do_dyncast): Define dynamic cast function.
2992 (*::do_find_public_subobj): Define dynamic cast helper function.
2993 * tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
2994 (__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
2995 (__dynamic_cast_2): New dynamic cast runtime.
2996
2997 1999-09-20 Mark Mitchell <mark@codesourcery.com>
2998
2999 * cp-tree.h (finish_stmt_expr): Change prototype.
3000 * expr.c (cplus_expand_expr): Adjust call accordingly.
3001 * init.c (finish_init_stmts): Likewise.
3002 * parse.y (primary): Likewise.
3003 * pt.c (tsubst_copy): Likewise.
3004 * semantics.c (finish_stmt_expr): Don't take two parameters.
3005 Don't remove generated BLOCKs from the block-tree.
3006
3007 Remove support for assigning to `this'.
3008 * NEWS: Note that fact.
3009 * class.c (build_vbase_path): Don't check flag_this_is_variable.
3010 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
3011 (language_function): Remove assigns_this, just_assigned_this, and
3012 x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p.
3013 (base_init_expr): Remove.
3014 (current_vcalls_possible_p): New macro.
3015 (vtbls_set_up_p): Likewise.
3016 (emit_base_init): Change prototype.
3017 * decl.c (finish_destructor_body): New function, split out from
3018 finish_function.
3019 (current_function_assigns_this): Remove.
3020 (current_function_just_assigned_this): Likewise.
3021 (start_function): Don't set them.
3022 (finish_function): Don't check them. Don't emit
3023 base-initialization code here. Generate code for destructors when
3024 doing semantic analysis.
3025 (finish_stmt): Don't check current_function_just_assigned_this.
3026 * decl2.c (lang_f_options): Remove this-is-variable.
3027 (lang_decode_option): Likewise.
3028 (grokclassfn): Don't check flag_this_is_variable.
3029 * init.c (emit_base_init): Return the expression generated.
3030 (construct_virtual_bases): Don't push/pop obstacks. Fix
3031 typo.
3032 (build_new_1): Don't check flag_this_is_variable.
3033 (get_temp_regvar): Don't set DECL_REGISTER.
3034 (build_vec_init): Don't call use_variable.
3035 * lang-options.h: Remove "-fthis-is-variable" and
3036 "-fno-this-is-variable".
3037 * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
3038 * search.c (expand_upcast_fixups): Use finish_expr_stmt, not
3039 expand_expr_stmt.
3040 * semantics.c (finish_expr_stmt_real): Rename to ...
3041 (finish_expr_stmt): This. Remove assigned_this parameter.
3042 (begin_if_stmt): Call do_pushlevel before starting the statement.
3043 (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
3044 blocks.
3045 (setup_vtbl_ptr): Emit initialization code for bases and members
3046 at semantic-analysis time. Emit code to initialize vtables in
3047 destructors here.
3048 (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
3049 Don't handle CTOR_INITIALIZER any more.
3050 * typeck.c (build_modify_expr): Don't check for assignments to
3051 this.
3052 (c_expand_return): Don't suggest assigning to `this'.
3053
3054 * Makefile.in (decl.o): Depend on RTL_H.
3055 (decl2.o): Likewise.
3056 (class.o): Likewise.
3057 (call.o): Likewise.
3058 (method.o): Likewise.
3059 (search.o): Likewise.
3060 (tree.o): Likewise.
3061 (pt.o): Likewise.
3062
3063 * decl.c (duplicate_decls): When a builtin function is redeclared
3064 as static, make sure it is mangled correctly.
3065
3066 * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add
3067 detail about the statement-tree.
3068
3069 1999-09-20 Nathan Sidwell <nathan@acm.org>
3070
3071 * parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
3072
3073 1999-09-20 Nick Clifton <nickc@cygnus.com>
3074
3075 * decl2.c (lang_decode_option): Extend comment.
3076
3077 Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk>
3078
3079 * typeck.c: Include "tm_p.h".
3080
3081 1999-09-19 Mark Mitchell <mark@codesourcery.com>
3082
3083 * ir.texi: New file.
3084
3085 1999-09-19 Paul Burchard <burchard@pobox.com>
3086
3087 * semantics.c (expand_stmt): Initialize return value.
3088
3089 1999-09-18 Paul Burchard <burchard@pobox.com>
3090
3091 * gxxint.texi: G++ now implements namespaces.
3092
3093 1999-09-18 Mark Mitchell <mark@codesourcery.com>
3094
3095 * decl.c (pop_label): Don't warn about unused labels more than
3096 once.
3097 * semantics.c (finish_goto_stmt): Always marked used labels as
3098 used.
3099
3100 * decl.c (layout_var_decl): Change prototype. Call layout_decl
3101 even when the declaration is external.
3102 (cp_finish_decl): Adjust call to layout_var_decl.
3103 * pt.c (tsubst_expr): Make sure to initialize stmt before using it.
3104
3105 1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
3106
3107 * typeck.c (get_member_function_from_ptrfunc): Always consider
3108 virtuality inside member pointer.
3109
3110 1999-09-17 Mark Mitchell <mark@codesourcery.com>
3111
3112 Turn on function-at-a-time processing.
3113 * cp-tree.h (doing_semantic_analysis_p): New macro.
3114 (SF_DEFAULT): Define to zero, not SF_EXPAND.
3115 (start_handler_parms): Change prototype.
3116 (expand_start_catch_block): Likewise.
3117 (expand_end_catch_block): Likewise.
3118 (expand_start_eh_spec): Likewise.
3119 (expand_end_eh_spec): Declare.
3120 (finish_handler_parms): Change prototype.
3121 (begin_catch_block): Declare.
3122 (finish_handler): Change prototype.
3123 (do_pushlevel): Declare.
3124 (do_poplevel): Likewise.
3125 * decl.c (pushlevel): Don't create
3126 binding levels when not doing semantic analysis.
3127 (poplevel): Don't pop them.
3128 (pushdecl): Assert that we are never called when not doing
3129 semantic analysis.
3130 (pushdecl_top_level): Use push_to_top_level.
3131 (make_label_decl): Don't fiddle with obstacks. Make RTL For the
3132 label when expanding.
3133 (cp_finish_decl): Only inject for-scope variables when doing
3134 semantic analysis. Add comments.
3135 (start_handler_parms): Return the handler parm.
3136 (start_function): Reorganize. Don't clear DECL_INITIAL if it is
3137 already set. Reinitialize from saved function data if available.
3138 Don't pushlevel when not doing semantic analysis.
3139 (store_parm_decls): Only generate RTL when expanding. Only
3140 pushdecl when doing semantic analysis. Set
3141 current_eh_spec_try_block if appropriate.
3142 (finish_function): Simplify. Use do_pushlevel and do_poplevel.
3143 Combine common code. Don't poplevel when not doing semantic
3144 analysis.
3145 (push_cp_function_context): Don't expand functions without an
3146 explicit call to expand_body.
3147 (mark_lang_function): Make eh_spec_try_block and
3148 x_scope_stmt_stack.
3149 * except.c (expand_end_eh_spec): Don't
3150 declare.
3151 (process_start_catch_block): Likewise.
3152 (push_eh_cleanup): Use finish_decl_cleanup.
3153 (initialize_handler_parm): New function.
3154 (expand_start_catch_block): Use it.
3155 (expand_end_catch_block): Use tree-generation functions, not
3156 RTL-generation functions.
3157 (expand_start_eh_spec): Likewise.
3158 (expand_end_eh_spec): Likewise.
3159 (expand_exception_blocks): Simplify.
3160 (start_anon_func): Use do_pushlevel.
3161 (end_anon_func): Use do_poplvel. Call expand_body for the
3162 function.
3163 * expr.c (do_case): Don't call define_case_label.
3164 * init.c (create_temporary_var): Set DECL_CONTEXT for local
3165 variables.
3166 * method.c (emit_thunk): Call expand_body for the
3167 thunk.
3168 (sythesize_method): Likewise.
3169 * parse.y (handler_args): Give it ttype.
3170 (eat_saved_input): Call expand_body.
3171 (base_init): Use do_pushlevel.
3172 (pending_inline): Call expand_body.
3173 (handler): Adjust calls to finish_handler_parms and
3174 finish_handler.
3175 (handler_args): Don't call expand_start_catch_block. Return the
3176 catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling.
3177 * parse.c: Regenerated.
3178 * rtti.c (synthesize_tinfo_fn): Call finish_function.
3179 * semantics.c (do_pushlevel): Give it external linkage. Build
3180 SCOPE_STMTs.
3181 (do_poplevel): Likewise.
3182 (finish_case_label): Call define_case_label when doing semantic
3183 analysis.
3184 (finish_goto_stmt): Create RTL for labels.
3185 (finish_function_try_block): Set in_function_try_handler
3186 unconditionally.
3187 (finish_function_handler_sequence): Unset it.
3188 (finish_handler_parms): Use expand_start_catch_block even when
3189 building a statement-tree.
3190 (begin_catch_block): New function.
3191 (finish_handler): Move a little RTL-generation logic here.
3192 (finish_decl_cleanup): Allow cleanups for empty declarations.
3193 (finish_named_return_value): Don't pushdecl when not doing
3194 semantic analysis.
3195 (expand_stmt): Don't do semantic analysis for variable
3196 declarations. Handle START_CATCH_STMT. Call expand_label
3197 directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust
3198 HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
3199 (expand_body): Let expand_stmt handle CTOR_INITIALIZER,
3200 RETURN_INIT and function try blocks.
3201
3202 * cp-tree.h (language_function): Add x_eh_spec_try_block. Add
3203 x_scope_stmt_stack. Add x_in_charge_parm.
3204 (current_eh_spec_try_block): New macro.
3205 (current_scope_stmt_stack): Likewise.
3206 (current_in_charge_parm): Likewise.
3207 * decl.c (start_function): Initialize current_in_charge_parm.
3208 (finish_function): Use current_in_charge_parm rather than looking
3209 up __in_chrg.
3210 * search.c (expand_indirect_vtbls_init): Likewise.
3211
3212 * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
3213 (TRY_BLOCK): Likewise.
3214 (HANDLER): Likewise.
3215 (START_CATCH_STMT): New tree node.
3216 (SCOPE_STMT): Likewise.
3217 * cp-tree.h (SCOPE_BEGIN_P): New macro.
3218 (SCOPE_NULLIFIED_P): Likewise.
3219 (struct lang_decl_flags): Add pending_inline_p. Adjust dummy.
3220 (struct lang_decl): Add saved_language_function.
3221 (DECL_PENDING_INLINE_INFO): Adjust documentation.
3222 (DECL_PENDING_INLINE_P): New macro.
3223 (TYPE_TI_ARGS): Fix typo in comment.
3224 (DECL_SAVED_TREE): Add to documentation.
3225 (DECL_SAVED_FUNCTION_DATA): New macro.
3226 (START_CATCH_TYPE): Likewise.
3227 (SCOPE_END_P): New macro.
3228 (declare_parm_level): Don't declare.
3229 * decl.c (mark_lang_function): New function, split out from
3230 mark_cp_function_context.
3231 (save_function_data): New function.
3232 (declare_parm_level): Remove.
3233 (finish_function): Use save_function_data to squirrel away
3234 important stuff for later use.
3235 (mark_cp_function_context): Use mark_function_data.
3236 (lang_mark_tree): Likewise.
3237 * lex.c (begin_definition_of_inclass_inline): Set
3238 DECL_PENDING_INLINE_P.
3239 (store_pending_inline): Clear it.
3240 * pt.c (tsubst_decl): Likewise.
3241
3242 1999-09-17 Nathan Sidwell <nathan@acm.org>
3243
3244 * call.c (perform_implicit_conversion): Deal with error_mark_node.
3245
3246 1999-09-17 Mark Mitchell <mark@codesourcery.com>
3247
3248 * decl.c (warn_extern_redeclared_static): Don't get confused by
3249 static member functions.
3250 (duplicate_decls): Merge DECL_THIS_STATIC.
3251
3252 * decl.c (expand_static_init): Make sure assignments to local
3253 statics actually occur.
3254
3255 1999-09-17 Mark Mitchell <mark@codesourcery.com>
3256
3257 * cp-tree.h (poplevel_class): Declare.
3258 * class.c (popclass): Use poplevel_class, not poplevel.
3259 * decl.c (poplevel_class): Don't make it static. Don't return a
3260 value.
3261 (poplevel): Don't call poplevel_class; abort in a class
3262 binding level is seen.
3263 * semantics.c (finish_translation_unit): Use pop_everything.
3264 * parse.y (member_init): Allow errors.
3265 (pending_inline): Call finish_function.
3266 * parse.c: Regenerated.
3267 * Makefile.in (CONFLICTS): Adjust.
3268
3269 1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
3270
3271 * error.c: Reduce code duplication.
3272 (dump_template_value): New function.
3273 (dump_type_real): Use it.
3274 (dump_decl): Likewise.
3275 (dump_function_name): Likewise.
3276 (dump_function_decl): Don't be too talkative about function return
3277 type variety.
3278
3279 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3280
3281 * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
3282
3283 * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
3284
3285 1999-09-16 Jason Merrill <jason@yorick.cygnus.com>
3286
3287 * decl2.c (finish_file): Also call check_global_declarations for
3288 the pending_statics list.
3289
3290 1999-09-15 Jason Merrill <jason@yorick.cygnus.com>
3291
3292 * lex.c (cp_pragma_implementation): Allow #pragma implementation
3293 in header files.
3294
3295 1999-09-15 Richard Henderson <rth@cygnus.com>
3296
3297 * lex.c (mark_impl_file_chain): Follow the next chain.
3298
3299 1999-09-15 Mark Mitchell <mark@codesourcery.com>
3300
3301 * decl.c (warn_extern_redeclared_static): Simplify. Catch
3302 problems with extern "C" functions redeclared as static.
3303 (duplicate_decls): When a builtin is redeclared static, make the
3304 new function have internal linkage.
3305
3306 1999-09-15 Mark Mitchell <mark@codesourcery.com>
3307
3308 * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
3309 * pt.c (tsubst_copy): Likewise.
3310 * tree.c (search_tree): Likewise.
3311 (mapcar): Likewise.
3312
3313 1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3314
3315 * typeck2.c (ack): Don't declare progname.
3316
3317 1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
3318
3319 * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
3320 filenames with ggc_alloc_string.
3321
3322 1999-09-14 Mark Mitchell <mark@codesourcery.com>
3323
3324 * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
3325 TARGET_EXPR.
3326 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
3327 the TARGET_EXPR.
3328 * cvt.c (build_up_reference): Likewise.
3329 * tree.c (build_cplus_new): Likewise.
3330 (get_target_expr): Likewise.
3331
3332 Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org>
3333
3334 * Makefile.in: Prepend $(SHELL) to move-if-change calls.
3335
3336 1999-09-13 Mark Mitchell <mark@codesourcery.com>
3337
3338 * cp-tree.h (build_target_expr): New function.
3339 * call.c (build_conditional_expr): Use build_target_expr.
3340 (convert_like): Likewise.
3341 (build_over_call): Likewise.
3342 * cvt.c (build_up_reference): Likewise.
3343 * decl.c (build_cleanup_on_safe_obstack): Fold into ...
3344 (destroy_local_var): Here.
3345 (build_target_expr): New function.
3346 * tree.c (build_cplus_new): Use it.
3347 (get_target_expr): Likewise.
3348
3349 1999-09-13 Nathan Sidwell <nathan@acm.org>
3350
3351 * typeck.c (expr_sizeof): Don't decay arrays and functions.
3352 Remove misleading comment.
3353 (build_compound_expr): Don't decay arrays.
3354
3355 1999-09-13 Jason Merrill <jason@yorick.cygnus.com>
3356
3357 * call.c (build_conditional_expr): Always use a TARGET_EXPR for
3358 class rvalues again.
3359
3360 Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3361
3362 * Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
3363
3364 * g++spec.c: Include gcc.h.
3365 (lang_specific_driver): Constify a char*. Call xcalloc, not
3366 xmalloc/bzero. All calls to the function pointer parameter now
3367 explicitly call `fatal'.
3368
3369 1999-09-12 Mark Mitchell <mark@codesourcery.com>
3370
3371 * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
3372 * cvt.c (ocp_convert): Complete the from and destination types.
3373 Adjust warning about functions always being `true' in conditionals.
3374 * decl.c (duplicate_decls): Don't play funny games with abort.
3375 * error.c (dump_expr): Handle OVERLOADs.
3376 * spew.c (probe_obstack): Remove.
3377 * typeck.c (condition_conversion): Use perform_implicit_conversion.
3378
3379 1999-09-12 Bernd Schmidt <bernds@cygnus.co.uk>
3380
3381 * cp-tree.h (auto_function, define_function): Adjust prototypes.
3382 * decl.c (define_function): Lose FUNCTION_CODE arg. All callers
3383 changed.
3384 (auto_function): Likewise, for CODE arg.
3385 Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
3386 (builtin_function): ... here.
3387
3388 1999-09-11 Mark Mitchell <mark@codesourcery.com>
3389
3390 * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
3391 (init_decl_processing): Don't set TREE_PERMANENT for the
3392 error_mark_node.
3393 (start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
3394 (grokdeclarator): Likewise.
3395 (grokparms): Don't check TREE_PERMANENT when building up lists.
3396 * decl2.c (grokfield): Don't assert TREE_PERMANENT.
3397 (mark_inline_for_output): Likewise.
3398 * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
3399 * init.c (build_offset_ref): Don't check TREE_PERMANENT.
3400 * lex.c (check_newline): Don't check ggc_p; it is always one.
3401 * pt.c (process_template_parm): Don't check TREE_PERMANENT.
3402 * spew.c (yylex): Don't copy_node or probe_obstacks for
3403 non-permanent CONSTANTs and STRINGs.
3404 * tree.c (build_cplus_array_type_1): Don't fuss with
3405 TREE_PERMANENT on ARRAY_TYPEs.
3406
3407 * cp-tree.def (CLEANUP_STMT): New node.
3408 * cp-tree.h (language_function): Add name_declared.
3409 (current_function_name_declared): New macro.
3410 (CLEANUP_DECL): New macro.
3411 (CLEANUP_EXPR): Likewise.
3412 (emit_local_var): Likewise.
3413 (finish_decl_cleanup): New function.
3414 * cvt.c (build_up_reference): Simplify.
3415 (ocp_convert): Remove dead code.
3416 * decl.c (start_decl): Remove call to add_decl_stmt.
3417 (grok_reference_init): Adjust, to handle bindings temporaries to
3418 references. Remove dead code.
3419 (initialize_local_var): Don't generate RTL for
3420 declarations here, or build cleanups here. Don't fuss with
3421 obstacks. Replace expand_start_target_temps calls with explicit
3422 setting of stms_are_full_exprs_p.
3423 (destroy_local_var): New function.
3424 (emit_local_var): Likewise.
3425 (cp_finish_decl): Use them, as appropriate.
3426 (start_function): Announce template functions.
3427 (store_parm_decls): Don't call declare_function_name here.
3428 (finish_stmt): Don't start emit base-initialization code when just
3429 building the statement-tree.
3430 * init.c (create_temporary_var): Move add_decl_stmt call ...
3431 (get_temp_regvar): Here.
3432 * pt.c (tsubst_expr): Make DECL_INITIAL look like what
3433 cp_finish_decl would expect. Don't call add_decl_stmt.
3434 * semantics.c (begin_compound_stmt): Call declare_function_name,
3435 if appropriate.
3436 (finish_decl_cleanup): New function.
3437 (expand_stmt): Use emit_local_var to output variables.
3438 (expand_body): Set current_funtion_name_declared.
3439
3440 1999-09-10 Mark Mitchell <mark@codesourcery.com>
3441
3442 * cp-tree.h (finish_cleanup_try_block): New function.
3443 * semantics.c (finish_cleanup_try_block): Add comment.
3444
3445 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
3446
3447 * cp-tree.h: Delete declarations for all tree nodes now moved to
3448 global_trees.
3449 * decl.c: Delete their definitions.
3450 (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
3451 FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
3452 provide defaults.
3453 (init_decl_processing): Call build_common_tree_nodes and
3454 build_common_tree_nodes_2 instead of building their nodes here.
3455 Don't add gc roots for them.
3456
3457 1999-09-10 Mark Mitchell <mark@codesourcery.com>
3458
3459 * cp-tree.h (language_function): Rename expanding_p to
3460 x_expanding_p. Rename named_label_uses to x_named_label_uses.
3461 (expanding_p): Adjust accordingly.
3462 (TREE_VIA_PRIVATE): Fix typo in comment.
3463 (DECL_REFERENCE_SLOT): Remove.
3464 (SET_DECL_REFERENCE_SLOT): Likewise.
3465 * decl.c (named_label_uses): Adjust. Remove chicken comment.
3466 (push_overloaded_decl): Don't truncate the chain of bindings when
3467 adding an overloaded function.
3468 (grok_reference_init): Don't use DECL_REFERENCE_SLOT.
3469 (initialize_local_var): Fix typo in comment.
3470 (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
3471 * decl2.c (start_objects): Make the fact that we are expanding
3472 the generated function right away explicit.
3473 (start_static_storage_duration_function): Likewise.
3474 (finish_file): Fix typo in comment.
3475 * init.c (build_vec_init): Correct bugs in handling cleanups.
3476 * semantics.c (maybe_convert_cond): New function.
3477 (FINISH_COND): Always store the condition, even if there's
3478 a declaration.
3479 (finish_if_stmt_cond): Use maybe_convert_cond.
3480 (finish_while_stmt_cond): Likewise.
3481 (finish_do_stmt): Likewise.
3482 (finish_for_cond): Likewise.
3483 (expand_cond): Adjust.
3484
3485 * cp-tree.h (FN_TRY_BLOCK_P): New macro.
3486 * init.c (perform_member_init): Remove obstack machinations.
3487 (expand_cleanup_for_base): Likewise.
3488 (finish_init_stmts): Mark the statement-expression as used.
3489 * method.c (emit_thunk): Use tree-generating functions, not
3490 RTL.
3491 (do_build_copy_constructor): Likewise.
3492 (do_build_assign_ref): Likewise.
3493 (synthesize_method): Likewise. Keep track of line numbers.
3494 * pt.c (tsubst_expr): Handle various kinds of try blocks.
3495 * semantics.c (expand_stmts): Remove.
3496 (begin_function_try_block): Set FN_TRY_BLOCK_P.
3497 (finish_function_try_block): Be careful rechaining
3498 function try blocks.
3499 (expand_stmt): Loop through all the statements at a given level.
3500 (exapnd_body): Be careful with line-numbers here too. Prepare for
3501 being called directly from the parser.
3502
3503 * cp-tree.h (finish_function): Adjust prototype.
3504 * decl.c (finish_function): Return the function compiled.
3505 * pt.c (instantiate_decl): Don't play games with obstacks.
3506 * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
3507 (search_tree): Likewise.
3508 * typeck.c: Fix typo in comment.
3509 * typeck2.c (store_init_value): Add comment.
3510
3511 * cp-tree.h (CPTI_ATEXIT): New macro.
3512 (atexit_node): Likewise.
3513 * decl.c (destroy_local_static): New function, broken out from ...
3514 (expand_static_init): Here.
3515
3516 * rtti.c (get_tinfo_var): These should always be global
3517 (expand_si_desc): Use tree, not RTL, functions to generate code.
3518 (expand_class_desc): Likewise.
3519 (expand_ptr_desc): Likewise.
3520 (expand_attr_desc): Likewise.
3521 (expand_generic_desc): Likewise.
3522 (synthesize_tinfo_fn): Likewise.
3523
3524 1999-09-09 Mark Mitchell <mark@codesourcery.com>
3525
3526 * semantics.c (RECHAIN_STMTS): Remove `last' parameter.
3527 (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
3528 RECHAIN_STMTS.
3529 (RECHAIN_STMST_FROM_CHAIN): Likewise.
3530
3531 * parse.y (simple_stmt): Fix typo in last change.
3532
3533 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
3534 (STMT_IS_FULL_EXPR_P): Likewise.
3535 (STMT_LINENO_FOR_FN_P): Likewise.
3536 (prep_stmt): New function.
3537 (building_stmt_tree): Tweak for safety.
3538 * pt.c (tsubst_expr): Use prep_stmt throughout.
3539 (add_tree): Move it to semantics.c
3540 * semantics.c (add_tree): Move it here.
3541 (finish_expr_stmt_real): New function.
3542 (finish_expr_stmt): Use it.
3543 (finish_if_stmt_cond): Use FINISH_COND.
3544 (finish_while_stmt_cond): Likewise.
3545 (finish_for_cond): Likewise.
3546 (finish_stmt_tree): Tweak line-number handling.
3547 (prep_stmt): New function.
3548 (expand_stmt): Use it.
3549
3550 * cp-tree.h (begin_switch_stmt): Adjust prototype.
3551 (finish_switch_cond): Likewise.
3552 * parse.y (simple_stmt): Adjust accordingly.
3553 * parse.c: Regenerated.
3554 * pt.c (tsubst_expr): Adjust accordingly.
3555 * semantics.c (expand_cond): New function.
3556 (FINISH_COND): New macro.
3557 (begin_switch_stmt): Build the SWITCH_STMT here.
3558 (finish_switch_stmt_cond): Not here.
3559 (expand_stmt): Adjust calls to begin_switch_stmt and
3560 finish_switch_cond. Use expand_cond throughout.
3561
3562 * dump.c (dequeue_and_dump): Dump types for constants.
3563 Describe DECL_ARG_TYPE more intuitively.
3564 Handle ARRAY_REF.
3565
3566 * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
3567 (lang_cleanup_tree): Remove.
3568 * lex.c (make_lang_type): Use ggc_alloc to allocate
3569 TYPE_LANG_SPECIFIC.
3570
3571 Reorganize per-function data.
3572 * cp-tree.h (saved_scope): Add function_decl, bindings.
3573 (language_function): Rename binding_level to bindings.
3574 (cp_function_chain): Use the current_function, not the
3575 outer_function_chain.
3576 (current_class_ptr): Make it work, even when there's no
3577 current function.
3578 (current_class_ref): Likewise.
3579 (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
3580 macros.
3581 (clear_temp_name): Remove.
3582 * decl.c (check_function_type): New function, broken out from
3583 start_function.
3584 (current_binding_level): Adjust definition.
3585 (pushlevel): Simplify.
3586 (poplevel): Don't use named_label_uses when we're outside
3587 a function scope.
3588 (mark_saved_scope): Mark function_decl and bindings.
3589 (maybe_push_to_top_level): Don't unconditionally push a new
3590 function context. Save bindings and the current_function_decl.
3591 Don't clear named_labels.
3592 (pop_from_top_level): Pop function context if appropriate.
3593 (init_decl_processing): Set init_lang_status and free_lang_status,
3594 rather than save_lang_status and restore_lang_status.
3595 (start_function): Take SF_* flags. Don't clear per-function data.
3596 Reorder and simplify to use new per-function data code. Add
3597 asserts.
3598 (store_parm_decls): Don't call init_function_start here.
3599 (finish_function): Adjust for new handling of per-function data.
3600 (push_cp_function_context): Simplify.
3601 (mark_cp_function_context): Change binding_level to bindings.
3602 * decl2.c (clear_temp_name): Remove.
3603 (start_objects): Use SF flags to start_function.
3604 (start_static_storage_duration_function): Likewise.
3605 * except.c (start_anon_func): Remove redundant calls to
3606 push_function_context_to. Use SF flags to start function.
3607 (end_anon_func): Remove redundant call to pop_function_context
3608 from.
3609 * lex.c (reinit_parse_for_function): Don't initialize per-function
3610 data.
3611 * method.c (emit_thunk): Clear current_function after calling
3612 assemble_end_function. Use SF flags for start_function.
3613 (synthesize_method): Use SF flags for start_function.
3614 * parse.c: Regenerated.
3615 * parse.y (fn.defpen): Likewise.
3616 (pending_inline): Clear current_function, even if something goes
3617 wrong.
3618 * pt.c (instantiate_decl): Use SF flags to start_function.
3619 Don't save and restore expanding_p.
3620 (add_tree): Handle the case where we are outside any function.
3621 (end_tree): Likewise.
3622 * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
3623 * semantics.c (begin_function_definition): Likewise.
3624 (expand_body): Likewise.
3625
3626 1999-09-09 Nathan Sidwell <nathan@acm.org>
3627
3628 * cp-tree.h (convert_to_void): Prototype new function.
3629 (require_complete_type_in_void): Remove prototype.
3630 * cvt.c (convert_to_void): New function.
3631 (ocp_convert): Use convert_to_void.
3632 * decl.c (cplus_expand_expr_stmt): Likewise, for complete
3633 expressions.
3634 * typeck.c (require_complete_type_in_void): Remove function.
3635 (build_compound_expr): Use convert_to_void.
3636 (build_static_cast): Likewise.
3637 (build_c_cast): Likewise.
3638 * semantics.c (finish_expr_stmt): Do not decay full expressions.
3639
3640 * typeck.c (build_x_compound_expr): Add FIXME.
3641
3642 1999-09-08 Mark Mitchell <mark@codesourcery.com>
3643
3644 * cp-tree.h (scratch_tree_cons): Remove.
3645 * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
3646 and perm_tree_cons with plain tree_cons.
3647 * class.c: Likewise.
3648 * decl.c: Likewise.
3649 * decl2.c: Likewise.
3650 * except.c: Likewise.
3651 * expr.c: Likewise.
3652 * init.c: Likewise.
3653 * lex.c: Likewise.
3654 * method.c: Likewise.
3655 * parse.y: Likewise.
3656 * pt.c: Likewise.
3657 * repo.c: Likewise.
3658 * rtti.c: Likewise.
3659 * search.c: Likewise.
3660 * typeck.c: Likewise.
3661 * parse.c: Regenerated.
3662 * tree.c (build_srcloc): Simplify.
3663
3664 1999-09-08 Mark Mitchell <mark@codesourcery.com>
3665
3666 * cp-tree.h (lang_decl_flags): Remove permanent_attr.
3667 Remove next.
3668 (LANG_DECL_PERMANENT): Remove.
3669 * decl.c (duplicate_decls): Don't mess about with obstacks trying
3670 to free memory.
3671 (lang_mark_tree): Mark DECL_LANG_SPECIFIC.
3672 * lex.c (free_lang_decl_chain): Remove.
3673 (build_lang_decl): Don't use obstacks.
3674 (retrofit_lang_decl): Likewise.
3675 (copy_lang_decl): Likewise.
3676
3677 * cp-tree.h (saved_scope): Remove old_binding_level and
3678 function_decl. Tidy up.
3679 * decl.c (mark_saved_scope): Don't set them.
3680 (maybe_push_to_top_level): Clear memory.
3681
3682 * decl.c (layout_var_decl): Change prototype. Don't complete
3683 types for external objects.
3684 (check_initializer): Likewise. Tidy.
3685 (initialize_local_var): Complete types here.
3686 (cp_finish_decl): Not here. Reorganize a little.
3687 (grokvardecl): Don't complete types here.
3688
3689 * decl.c (start_function): Clear last_dtor_insn and
3690 last_parm_cleanup_insn.
3691 (push_cp_function_context): Just copy over a little of
3692 the old context, not all of it.
3693
3694 * cp-tree.h (copy_to_permanent): Remove.
3695 (permanent_p): Likewise.
3696 * decl.c (building_typename_type): Don't use copy_to_permanent.
3697 (start_decl): Likewise.
3698 (grok_reference_init): Likewise.
3699 (cp_finish_decl): Likewise.
3700 * init.c (build_new_1): Don't use mapcar.
3701 (build_vec_delete_1): Don't use copy_to_permanent.
3702 (build_vec_init): Likewise.
3703 * parse.y (primary): Likewise.
3704 * parse.c: Regenerated.
3705 * pt.c (push_template_decl_real): Don't use copy_to_permanent.
3706 (lookup_template_class): Likewise.
3707 (tsubst_friend_function): Likewise.
3708 (instantiate_class_template): Likewise.
3709 (tsubst_decl): Likewise.
3710 (tsubst): Likewise.
3711 (instantiate_template): Likewise.
3712 (unify): Likewise.
3713 * rtti.c (get_tinfo_fn): Likewise.
3714 (build_dynamic_cast): Likewise.
3715 * semantics.c (finish_if_stmt_cond): Likewise.
3716 (finish_while_stmt_cond): Likewise.
3717 (finish_do_stmt): Likewise.
3718 (finish_for_cond): Likewise.
3719 (finish_for_expr): Likewise.
3720 (finish_cleanup): Likewise.
3721 (add_decl_stmt): Likewise.
3722 (finish_named_return_value): Likewise.
3723 (finish_qualified_call_expr): Likewise.
3724 * tree.c (perm_manip): Remove.
3725 (build_exception_variant): Don't use copy_to_permanent.
3726 (permanent_p): Remove.
3727 (copy_to_permament): Remove.
3728 (build_min_nt): Don't use copy_to_permanent.
3729 (build_min): Likewise.
3730 (min_tree_cons): Likewise.
3731 * typeckc.c (build_static_cast): Likewise.
3732 (build_reinterpret_cast): Likewise.
3733 (build_const_cast): Likewise.
3734
3735 1999-09-07 Mark Mitchell <mark@codesourcery.com>
3736
3737 * decl.c (ggc_p): Set it to 1.
3738 (mark_saved_scope): Add prototype.
3739
3740 1999-09-07 Richard Henderson <rth@cygnus.com>
3741
3742 * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
3743 * typeck.c (self_promoting_args_p): Delete.
3744
3745 1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
3746
3747 * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
3748 (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
3749
3750 1999-09-07 Mark Mitchell <mark@codesourcery.com>
3751
3752 * Makefile.in (tree.o): Depend on ggc.h.
3753 * class.c (make_method_vec): Remove.
3754 (free_method_vec): Likewise.
3755 (free_method_vecs): Remove.
3756 (add_method): Don't use them.
3757 * cp-tree.def (PTRMEM_CST): Make it longer.
3758 (TEMPLATE_PARM_INDEX): Make it shorter.
3759 * cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
3760 (template_parm_index): Remove RTL field.
3761 (ptrmem_cst): Add RTL field.
3762 (finish_function): Removed parameter.
3763 (process_next_inline): Change prototype.
3764 (init_cplus_unsave): Rename to init_tree.
3765 (binding_init): Remove.
3766 * decl.c (free_binding_nodes): Remove.
3767 (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P.
3768 (pop_binding): Don't use free_binding_nodes.
3769 (free_binding_vecs): Remove.
3770 (store_bindings): Don't use them.
3771 (pop_from_top_level): Likewise.
3772 (lookup_namespace_name): Simplify.
3773 (build_typename_type): Don't use obstack_free.
3774 (unqualified_namespace_lookup): Simplify.
3775 (lookup_name_real): Simplify.
3776 (start_function): Remove comment about leaks.
3777 (finish_function): Removed nested parameter. Call
3778 expand_end_bindings even when building_stmt_tree.
3779 Call ggc_push_context and ggc_pop_context around
3780 rest_of_compilation, if necessary.
3781 (mark_cp_function_context): Handle a NULL language-context.
3782 (lang_mark_false_label_stack): Fix typo.
3783 (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
3784 TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on
3785 pointer to method types.
3786 (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
3787 * decl2.c (finish_objects): Adjust call to finish_function.
3788 (finish_static_store_duration_function): Likewise.
3789 (do_nonmember_using_decl): Remove call to binding_init.
3790 * except.c (end_anon_func): Adjust call to finish_function.
3791 * lex.c (mark_impl_file_chain): New function.
3792 (init_parse): Call init_tree, not init_cplus_unsave.
3793 Add GC roots.
3794 (cp_pramga_interface): Use xmalloc, not permalloc.
3795 (cp_pragma_implementation): Likewise.
3796 (begin_definition_of_inclass_inline): Simplify.
3797 (process_next_inline): Adjust prototype.
3798 (do_scoped_id): Don't call binding_init.
3799 (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
3800 * method.c (emit_thunk): Adjust call to finish_function.
3801 (synthesize_method): Likewise.
3802 * parse.y (%union): Add a new `pi' variant.
3803 (PRE_PARSED_FUNCTION_DECL): Use it.
3804 (fn.defpen): Likewise.
3805 (fndef): Adjust call to finish_function.
3806 * pt.c (instantiate_decl): Likewise.
3807 * rtti.c (syntheisze_tinfo_fn): Likewise.
3808 * semantics.c (expand_body): Likewise.
3809 * tree.c: Include ggc.h.
3810 (mark_list_hash): New function.
3811 (binding_init): Remove.
3812 (init_cplus_unsave): Rename to ...
3813 (init_tree): This. Add GC roots.
3814
3815 1999-09-05 Mark Mitchell <mark@codesourcery.com>
3816
3817 Get ready for garbage collection.
3818 * Makefile.in (CXX_TREE_H): Add varray.h
3819 (lex.o): Depend on ggc.h.
3820 (decl.o): Likewise.
3821 (decl2.o): Likewise.
3822 (method.o): Likewise.
3823 (search.o): Likewise.
3824 (pt.o): Likewise.
3825 (repo.o): Likewise.
3826 * class.c: Include ggc.h.
3827 (current_class_name): Remove.
3828 (current_class_type): Likewise.
3829 (current_access_specifier): Likewise.
3830 (previous_class_type): Likewise.
3831 (previous_class_values): Likewise.
3832 (class_cache_firstobj): Likewise.
3833 (current_lang_base): Likewise.
3834 (current_lang_stack): Likewise.
3835 (current_lang_stacksize): Likewise.
3836 (lang_name_c): Likewise.
3837 (lang_name_cplusplus): Likewise.
3838 (lang_name_java): Likewise.
3839 (current_lang_name): Likewise.
3840 (base_layout_decl): Likewise.
3841 (access_default_node): Likewise.
3842 (access_public_node): Likewise.
3843 (access_protected_node): Likewise.
3844 (access_private_node): Likewise.
3845 (access_default_virtual_node): Likewise.
3846 (access_public_virtual_node): Likewise.
3847 (access_protected_virtual_node): Likewise.
3848 (access_private_virtual_node): Likewise.
3849 (signed_zero_node): Likewise.
3850 (init_class_processing): Don't build base_layout_decl.
3851 (push_lang_context): Adjust now that current_lang_base is a varray.
3852 (pop_lang_context): Likewise.
3853 * cp-tree.h: Include varray.h.
3854 (cp_global_trees): Add access_default, access_public,
3855 access_protected, access_private, access_default_virtual,
3856 access_public_virtual, access_protected_virtual,
3857 access_private_virtual, ctor_identifier, delta2_identifier,
3858 delta_identifier, dtor_identifier, in_charge_identifier,
3859 index_identifier, nelts_identifier, this_identifier,
3860 pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
3861 lang_name_c, lang_name_cplusplus, lang_name_java,
3862 empty_except_spec, null, jclass, minus_one, terminate.
3863 (saved_scope): Move here from decl.c. Define globals in terms of
3864 saved_scope: current_namespace, current_class_name,
3865 current_class_type, current_access_specifier, current_lang_stack,
3866 current_lang_base, current_lang_name, current_function_parms,
3867 current_template_parms, processing_template_decl,
3868 processing_specialization, processing_explicit_instantiation,
3869 previous_class_type, previous_class_values, class_cache_firstobj.
3870 (scope_chain): New variable.
3871 (init_pt): New function.
3872 * decl.c (current_namespace): Remove.
3873 (this_identifier, in_charge_identifier, ctor_identifier): Likewise.
3874 (dtor_identifier, pfn_identifier, index_identifier): Likewise.
3875 (delta_identifier, delta2_identifier): Likewise.
3876 (pfn_or_delta2_identifier, tag_identifier): Likewise
3877 (vt_off_identifier, empty_except_spec, null_node): Likewise.
3878 (current_function_parms, current_lang_base): Remove.
3879 (current_lang_stack, previous_class_values): Remove.
3880 (class_binding_level): Macroize.
3881 (saved_scope): Remove.
3882 (current_saved_scope): Rename to scope_chain.
3883 (mark_saved_scope): Adjust for new scope structure.
3884 (maybe_push_to_top_level): Likewise.
3885 (pop_from_top_level): Likewise.
3886 (duplicate_decls): Adjust now that current_lang_base is a varray.
3887 (build_typename_type): Call ggc_add_tree_hash_table_root.
3888 (init_decl_processing): Call init_pt. Call push_to_top_level to
3889 set up globals. Add GC roots.
3890 (xref_basetypes): Adjust now that current_lang_base is a varray.
3891 * decl.h (this_identifier): Remove.
3892 (in_charge_identifier): Likewise.
3893 * decl2.c: Don't include varray.h.
3894 (current_namespace): Remove.
3895 (init_decl2): Add GC roots.
3896 * except.c (Terminate): Remove.
3897 (init_exception_processing): Use terminate_node instead.
3898 (build_terminate_handler): Likewise.
3899 * init.c (nc_nelts_field_id): Remove.
3900 (minus_one): Likewise.
3901 (init_init_processing): Use minus_one_node and nelts_identifier
3902 instead. Add GC roots.
3903 (jclass_node): Remove.
3904 (build_new_1): Use nelts_identifier.
3905 (build_vec_init): Likewise.
3906 (build_vec_delete): Likewise.
3907 * lex.c: Include ggc.h.
3908 (defarg_fn): Move declaration early.
3909 (defarg_parms): Likewise.
3910 (init_parse): Add GC roots.
3911 (handle_cp_pragma): Remove redundant declaration of
3912 pending_vtables.
3913 * method.c: Include ggc.h.
3914 (btypelist): Make it a varray. All uses changed.
3915 (ktypelist): Likewise.
3916 (init_method): Add GC roots.
3917 * pt.c: Don't include varray.h. Include ggc.h.
3918 (current_template_parms): Remove.
3919 (processing_template_decl): Likewise.
3920 (processing_specialization): Likewise.
3921 (processing_explicit_instantiation): Likewise.
3922 (init_pt): New function.
3923 * repo.c: Include ggc.h.
3924 (init_repo): Add GC roots.
3925 * search.c: Don't include varray.h.
3926 (_vptr_name): Remove.
3927 (lookup_field_1): Use vtpr_identifier instead.
3928 (expand_indirect_vtbls_init): Remove redundant declaration of
3929 in_charge_identifier.
3930 (init_search_processing): Use vptr_identifier.
3931
3932 1999-09-05 Richard Henderson <rth@cygnus.com>
3933 Bernd Schmidt <bernds@cygnus.co.uk>
3934 Mark Mitchell <mark@codesourcery.com>
3935
3936 * Makefile.in (parse.o): Depend on ggc.h.
3937 (decl2.o): Depend on ggc.h.
3938 (init.o): Depend on ggc.h.
3939 * cp-tree.h (init_decl2): Declare.
3940 (cp_parse_init): Likewise.
3941 * decl.c (ggc_p): Define to zero.
3942 (mark_saved_scope): New function.
3943 (init_decl_processing): Call cp_parse_init, and cp_decl2.
3944 Register GC roots.
3945 (expand_static_init): Add GC roots.
3946 * decl2.c: Include ggc.h.
3947 (init_decl2): New function.
3948 * init.c: Include ggc.h.
3949 (init_init_processing): Add GC roots.
3950 * parse.y: Include ggc.h.
3951 (cp_parse_init): New function.
3952
3953 1999-09-04 Mark Mitchell <mark@codesourcery.com>
3954
3955 * decl.c (init_decl_processing): Set mark_lang_status.
3956 (lang_mark_false_label_stack): Adjust prototype.
3957 * decl2.c (grok_function_init): Remove extraneous declaration of
3958 abort_fndecl.
3959
3960 * Make-lang.in (cc1plus): Remove dependency on GGC.
3961 * Makefile.in (OBJS): Don't mention ggc-simple.o.
3962 (OBJDEPS): Don't mention ggc-simple.o.
3963
3964 * Make-lang.in (cc1plus): Depend on $(GGC).
3965 * Makefile.in (OBJS): Add ggc-simple.o.
3966 (OBJDEPS): Likewise.
3967 * cp-tree.h (language_function): Rename members to `x_' versions;
3968 we now have x_named_labels, x_ctor_label, x_dtor_label,
3969 x_base_init_list, x_member_init_list, x_base_init_expr,
3970 x_current_class_ptr, x_current_class_ref, x_last_tree,
3971 x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
3972 x_result_rtx.
3973 (dtor_label, ctor_label, current_base_init_list,
3974 current_member_init_list, base_init_expr, current_class_ptr,
3975 current_class_ref, last_tree, last_expr_type): Adjust accordingly.
3976 * decl.c: Include ggc.h.
3977 (last_dtor_insn): Adjust to use x_ names.
3978 (last_parm_cleanup_insn): Likewise.
3979 (original_result_rtx): Likewise.
3980 (named_labels): Likewise.
3981 (mark_binding_level): New function.
3982 (mark_cp_function_context): Likewise.
3983 (mark_false_label_stack): Likewise.
3984 (lang_mark_tree): Likewise.
3985 (lang_cleanup_tree): Likewise.
3986
3987 1999-09-03 Mark Mitchell <mark@codesourcery.com>
3988
3989 * Makefile.in (CXX_TREE_H): Include function.h.
3990 (decl.o): Don't depend on function.h.
3991 (decl2.o): Likewise.
3992 (typeck.o): Likewise.
3993 (init.o): Likewise.
3994 (method.o): Likewise.
3995 * cp-tree.h: Include function.h.
3996 (cp_function): Rename to language_function. Remove next.
3997 (cp_function_chain): Make it a macro, not a variable.
3998 (push_cp_function_context): Don't declare.
3999 (pop_cp_function_context): Likewise.
4000 * decl.c: Don't include function.h.
4001 (push_cp_function_context): Make it static. Make it suitable for
4002 a save_lang_status callback.
4003 (pop_cp_function_context): Likewise.
4004 (maybe_push_to_top_level): Call push_function_context_to, not
4005 push_cp_function_context.
4006 (pop_from_top_level): Call pop_function_context_from, not
4007 pop_cp_function_context.
4008 (init_decl_processing): Set save_lang_status and
4009 restore_lang_status. Call push_function_context_to, not
4010 push_cp_function_context.
4011 (cp_function_chain): Remove.
4012 * decl2.c: Don't include function.h.
4013 * except.c: Don't include function.h.
4014 (start_anon_func): Call push_function_context_to, not
4015 push_cp_function_context.
4016 (end_anon_func): Call pop_function_context_from, not
4017 pop_cp_function_context.
4018 * init.c: Don't include function.h.
4019 * lex.c (begin_definition_of_inclass_inline): Call
4020 push_function_context_to, not push_cp_function_context.
4021 (process_next_inline): Call pop_function_context_from, not
4022 pop_cp_function_context.
4023 * method.c: Don't include function.h.
4024 (synthesize_method): Call push_function_context_to, not
4025 push_cp_function_context. Call pop_function_context_from, not
4026 pop_cp_function_context.
4027 * typeck.c: Don't include function.h.
4028
4029 * decl.c (expand_static_init): Tweak handling of static
4030 initializations for objects without constructors.
4031
4032 1999-09-03 Nathan Sidwell <nathan@acm.org>
4033
4034 * typeck.c (build_indirect_ref): Reject dereference of pointer to
4035 void.
4036
4037 1999-09-02 Mark Mitchell <mark@codesourcery.com>
4038
4039 * cp-tree.h (cp_function): Move here, from decl.c.
4040 (cp_function_chain): Declare.
4041 (dtor_label): New macro, instead of variable.
4042 (ctor_label): Likewise.
4043 (current_base_init_list): Likewise.
4044 (current_member_init_list): Likewise.
4045 (base_init_expr): Likewise.
4046 (current_class_ptr): Likewise.
4047 (current_class_ref): Likewise.
4048 (last_tree): Likewise.
4049 (last_expr_type): Likewise.
4050 (current_function_returns_value): Likewise.
4051 (current_function_returns_null): Likewise.
4052 (current_function_just_assigned_this): Likewise.
4053 (current_function_parms_stored): Likewise.
4054 (temp_name_counter): Likewise.
4055 (static_labelno): Likewise.
4056 (expanding_p): Likewise.
4057 (stmts_are_full_exprs_p): Likewise.
4058 (in_function_try_handler): Likewise.
4059 (lang_type): Remove nested type_flags. All uses changed.
4060 * call.c (ctor_label): Remove.
4061 (dtor_label): Likewise.
4062 * class.c (current_class_ptr): Remove.
4063 (current_class_ref): Likewise.
4064 * decl.c (static_labelno): Remove.
4065 (dtor_label): Likewise.
4066 (last_dtor_insn): New macro, instead of variable.
4067 (last_parm_cleanup_insn): Likewise.
4068 (original_result_rtx): Likewise.
4069 (in_function_try_handler): Remove.
4070 (named_label_uses): New macro, instead of variable.
4071 (named_labels): Likewise.
4072 (current_function_returns_value): Remove.
4073 (current_function_returns_null): Likewise.
4074 (current_function_assigns_this): New macro, instead of variable.
4075 (current_function_just_assigned_this): Likewise.
4076 (current_binding_level): Likewise.
4077 (init_decl_processing): Call push_cp_function_context.
4078 (cp_function): Move to cp-tree.h
4079 (cp_function_chain): Make it global.
4080 (temp_name_counter): Remove.
4081 (push_cp_function_context): Simplify.
4082 (pop_cp_function_context): Likewise.
4083 * decl2.c (temp_name_counter): Remove.
4084 * init_c (current_base_init_list): Likewise.
4085 (current_member_init_list): Likewise.
4086 (base_init_expr): Likewise.
4087 * method.c (static_labelno): Likewise.
4088 * pt.c (last_tree): Likewise.
4089 * semantics.c (expanding_p): Likewise.
4090 (stmts_are_full_exprs_p): Likewise.
4091 (last_expr_type): Likewise.
4092 * typeck.c (dtor_label): Likewise.
4093 (ctor_label): Likewise.
4094
4095 1999-09-01 Alex Samuel <samuel@codesourcery.com>
4096
4097 * decl2.c (arg_assoc_template_arg): New prototype. New function.
4098 (arg_assoc_class): Use arg_assoc_template_arg for template
4099 arguments.
4100 (arg_assoc): Likewise.
4101 * pt.c (mangle_class_name_for_template): Allow member template
4102 template arguments.
4103
4104 1999-09-02 Nathan Sidwell <nathan@acm.org>
4105
4106 * call.c (build_conditional_expr): Warn on enum mismatches.
4107 (convert_arg_to_ellipsis): Move non-pod check to after
4108 conversion.
4109
4110 1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4111
4112 * gxx.gperf (hash, is_reserved_word): Add prototypes.
4113
4114 * init.c (build_vec_init): Initialize variable `try_block'.
4115
4116 * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
4117 Likewise for bzero/memset.
4118 (token_getch, token_put_back): Add static prototypes. Remove
4119 `inline' from the definitions.
4120 (retrofit_lang_decl): Call memset, not bzero, to avoid casts.
4121
4122 1999-09-01 Mark Mitchell <mark@codesourcery.com>
4123
4124 * cp-tree.h (lang_type): Move align into type_flags.
4125 (CLASSTYPE_ALIGN): Adjust accordingly.
4126 * call.c (direct_reference_binding): Remove misleading comment.
4127
4128 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4129
4130 * parse.y (language_string): Constify.
4131
4132 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4133
4134 * repo.c (getpwd): Don't prototype.
4135 * xref.c (getpwd): Likewise
4136
4137 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4138
4139 * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
4140 Remove hacks for stuff which now comes from libiberty.
4141
4142 1999-08-30 Jason Merrill <jason@yorick.cygnus.com>
4143
4144 * cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
4145
4146 1999-08-30 Mark Mitchell <mark@codesourcery.com>
4147
4148 * cp-tree.h (begin_init_stmts): Declare.
4149 (finish_init_stmts): Likewise.
4150 * cvt.c (build_up_reference): Wrap the declaration of a temporary
4151 in a statement-expression so that we will see it when expanding
4152 tree structure later.
4153 * init.c (begin_init_stmts): Don't make it static.
4154 (finish_init_stmts): Likewise.
4155
4156 * cp-tree.h (start_handler_parms): New function.
4157 (expand_start_catch_block): Take only one parameter.
4158 (start_handler_parms): New function.
4159 * decl.c (start_handler_parms): Define it.
4160 * except.c (process_start_catch_block): Take only one parameter.
4161 Don't call grokdeclarator here.
4162 (expand_start_catch_block): Don't call grokdeclarator here,
4163 either.
4164 * parse.y (handler_args): Adjust call to
4165 expand_start_catch_block. Use start_handler_parms.
4166 * pt.c (push_template_decl_real): Make permanent lists have
4167 permanent elements.
4168 (tsubst_expr): Adjust calls to expand_start_catch_block
4169 appropriately.
4170 * semantics.c (expand_stmt): Likewise.
4171
4172 1999-08-29 Alex Samuel <samuel@codesourcery.com>
4173
4174 * pt.c (push_template_decl_real): Use template declaration from
4175 class type if it exists.
4176
4177 1999-08-29 Mark Mitchell <mark@codesourcery.com>
4178
4179 * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
4180 (maybe_inject_for_scope_var): Declare it.
4181 (initialize_local_var): Likewise.
4182 * decl.c (maybe_inject_for_scope_var): Make it global.
4183 (initialize_local_var): Likewise. Move cleanup handling here,
4184 from cp_finish_decl.
4185 (make_rtl_for_nonlocal_decl): Use
4186 push_obstacks_nochange/pop_obstacks, rather than
4187 end_temporary_allocation/resume_temporary_allocation.
4188 (cp_finish_decl): Try to complete the type of a variable when it
4189 is declared. Move cleanup-handling to initialize_local_var.
4190 (expand_static_init): Use tree-building code, rather than
4191 RTL-building code.
4192 * decl2.c (get_temp_name): Assert non-initializedness of
4193 temporaries.
4194 * init.c (create_temporary_var): Move RTL-assigning code to ...
4195 (get_temp_regvar): Here.
4196 * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here.
4197 * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just
4198 call initialize_local_var to generate initialization code.
4199
4200 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4201
4202 * cp-tree.h (fndecl_as_string, type_as_string,
4203 type_as_string_real, args_as_string, decl_as_string,
4204 expr_as_string, code_as_string, language_as_string,
4205 parm_as_string, op_as_string, assop_as_string, cv_as_string,
4206 lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
4207
4208 * errfn.c (cp_printer): Likewise.
4209
4210 * error.c (cp_printer, fndecl_as_string, type_as_string_real,
4211 type_as_string, expr_as_string, decl_as_string, lang_decl_name,
4212 cp_file_of, code_as_string, language_as_string, parm_as_string,
4213 op_as_string, assop_as_string, args_as_string, cv_as_string):
4214 Likewise.
4215
4216 * tree.c (lang_printable_name): Likewise.
4217
4218 1999-08-28 Richard Henderson <rth@cygnus.com>
4219
4220 * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
4221
4222 1999-08-28 Mark Mitchell <mark@codesourcery.com>
4223
4224 * cp-tree.h (strip_array_types): New function.
4225 * decl.c (maybe_deduce_size_from_array_init): New function, split
4226 out from cp_finish_decl.
4227 (layout_var_decl): Likewise.
4228 (maybe_commonize_var): Likewise.
4229 (maybe_inject_for_scope_var): Likewise.
4230 (initialize_local_var): Likewise.
4231 (build_cleanup_on_safe_obstack): Likewise.
4232 (check_initializer): Likewise.
4233 (make_rtl_for_nonlocal_decl): Likewise.
4234 (cp_finish_decl): Use them.
4235 * typeck.c (strip_array_types): New function.
4236
4237 * cp-tree.def (LABEL_STMT): New tree node.
4238 * cp-tree.h (LABEL_STMT_LABEL): New macro.
4239 (shadow_label): Remove.
4240 (declare_local_label): New function.
4241 (finish_label_decl): Likewise.
4242 * decl.c (make_label_decl): New function, split out from
4243 lookup_label.
4244 (shadowed_labels): Remove.
4245 (binding_level): Add shadowed_labels.
4246 (clear_binding_level): Remove.
4247 (push_binding_level): Just bzero the new binding level.
4248 (pushlevel): Fix indentation.
4249 (pop_label): New function.
4250 (pop_labels): Likewise, split out from poplevel.
4251 (poplevel): Pop local labels. Use pop_labels.
4252 (maybe_push_to_top_level): Don't clear shadowed_labels.
4253 (lookup_label): Use make_label_decl.
4254 (shadow_label): Remove.
4255 (declare_local_label): New function.
4256 (define_label): Simplify.
4257 (start_function): Don't clear shadowed_labels.
4258 (cp_function): Remove shadowed_labels.
4259 (push_cp_function_context): Don't save shadowed_labels.
4260 (pop_cp_function_context): Don't restore it.
4261 * dump.c (dequeue_and_dump): Handle LABEL_STMT.
4262 * parse.y (label_decl): Use finish_label_decl.
4263 * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
4264 declarations.
4265 * semantics.c (finish_label_stmt): Add a LABEL_STMT when
4266 building_stmt_tree.
4267 (finish_label_decl): New function.
4268 (expand_stmt): Handle LABEL_STMTs and local label declarations.
4269
4270 1999-08-26 Mark Mitchell <mark@codesourcery.com>
4271
4272 * decl.c (lookup_label): Build labels on the permanent obstack
4273 when building statement trees. Don't build RTL for labels when
4274 building statement trees.
4275 * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
4276 building statement trees.
4277 (finish_label_stmt): Likewise.
4278 (expand_stmt): Adjust accordingly.
4279 * pt.c (tsubst_expr); Likewise.
4280 (do_decl_instantiation): Robustify.
4281
4282 * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
4283 * tree.c (build_cplus_new): Set it.
4284 * expr.c (cplus_expand_expr): Use it.
4285 * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
4286
4287 * decl.c (store_parm_decls): Reset immediate_size_expand.
4288 (finish_function): Likewise.
4289
4290 * tree.c (cplus_unsave_expr_now): Don't return a value.
4291
4292 * semantics.c (do_poplevel): Always initialize the return value.
4293
4294 1999-08-26 Gavin Romig-Koch <gavin@cygnus.com>
4295
4296 * cp-tree.h (cplus_unsave_expr_now) : Correct return type.
4297 * tree.h (cplus_unsave_expr_now) : Same.
4298
4299 1999-08-25 Mark Mitchell <mark@codesourcery.com>
4300
4301 * decl.c (grokdeclarator): Amend comment.
4302 * except.c (expand_start_catch_block): Call push_template_decl for
4303 catch-block parameters.
4304 * method.c (synthesize_method): Build an empty compound statement
4305 for the body of a constructor.
4306
4307 1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
4308
4309 * tree.c (cp_build_qualified_type_real): If we're asking for the
4310 same quals we already have, just return.
4311
4312 1999-08-25 Mark Mitchell <mark@codesourcery.com>
4313
4314 * cp-tree.def (SUBOBJECT): New tree node.
4315 * cp-tree.h (CLEANUP_P): New macro.
4316 (SUBOBJECT_CLEANUP): Likewise.
4317 (keep_next_level): Add parameter.
4318 (get_temp_regvar): Don't declare.
4319 (emit_base_init): Remove parameter.
4320 (expand_aggr_init): Rename to build_aggr_init.
4321 (expand_vec_init): Rename to build_vec_init.
4322 (do_pushlevel): Remove.
4323 (do_poplevel): Likewise.
4324 (finish_cleanup): New function.
4325 (finish_subobject): Likewise.
4326 (stmts_are_full_exprs_p): New variable.
4327 * decl.c (keep_next_level): Add parameter.
4328 (cp_finish_decl): Use build_aggr_init, not
4329 expand_aggr_init. Use finish_expr_stmt to expand the code.
4330 (expand_static_init): Use tree-generating, not RTL-generating,
4331 functions to handle the initialization.
4332 (start_function): Remove dead code. Always have a momentary
4333 obstack inside the function, even before hitting the first curly
4334 brace.
4335 (cplus_expand_expr_stmt): Move calls to
4336 expand_{start,end}_target_temps into semantics.c.
4337 (cp_function): Add stmts_are_full_exprs_p.
4338 (push_cp_function_context): Save it.
4339 (pop_cp_function_context): Restore it.
4340 * decl2.c (get_temp_regvar): Move to init.c.
4341 (do_static_initialization): Use build_{aggr,vec}_init.
4342 (do_static_destruction): Fix typo in comment.
4343 * dump.c (dequeue_and_dump): Handle INIT_EXPR.
4344 * except.c (expand_throw): Use create_temporary_var.
4345 * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
4346 * init.c (expand_vec_init_try_block): Remove.
4347 (expand_vec_init_catch_clause): Likewise.
4348 (get_temp_regvar): New function.
4349 (begin_init_stmts): Likewise.
4350 (finish_init_stmts): Likewise.
4351 (perform_member_init): Use build_{aggr,vec}_init. Build up tree
4352 structure here.
4353 (emit_base_init): Likewise. Remove unused parameter.
4354 (expand_virtual_init): Likewise.
4355 (expand_cleanup_for_base): Use finish_subobject.
4356 (expand_aggr_vbase_init_1): Simplify.
4357 (construct_virtual_bases): Use tree-generating functions to build
4358 up initialization.
4359 (expand_aggr_init): Likewise. Rename to build_aggr_init.
4360 (expand_default_init): Likewise.
4361 (expand_aggr_init_1): Likewise.
4362 (expand_vec_init): Rename to build_vec_init.
4363 * method.c (do_build_copy_constructor): Use tree-generating
4364 functions. Don't call clear_last_expr.
4365 (do_build_assign_ref): Likewise.
4366 (synthesize_method): Call clear_last_expr here.
4367 * parse.y (base_init): Don't call clear_last_expr here.
4368 (nodecls): Likewise.
4369 * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
4370 * semantics.c (do_pushlevel): Move to here.
4371 (do_poplevel): Likewise.
4372 (stmts_are_full_exprs_p): New variable.
4373 (finish_expr_stmt): Handle logic for temoprary cleanup here.
4374 (finish_for_stmt): Use finish_expr_stmt.
4375 (finish_cleanup): New function.
4376 (finish_function_try_block): Fix indentation.
4377 (finish_subobject): New function.
4378 (setup_vtbl_ptr): Call keep_next_level here.
4379 (finish_stmt_expr): Handle a block with no scope inside the
4380 statement-expression.
4381 (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle
4382 SUBOBJECT.
4383 * tree.c (search_tree): Handle INIT_EXPR.
4384 (mapcar): Likewise.
4385 * typeck.c (build_modify_expr): Don't build an RTL_EXPR.
4386 * typeck2.c (store_init_value): Change expand_aggr_init to
4387 build_aggr_init in comment.
4388
4389 1999-08-25 Mark Mitchell <mark@codesourcery.com>
4390
4391 * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
4392
4393 1999-08-25 Nathan Sidwell <nathan@acm.org>
4394
4395 * decl2.c (handle_class_head): Be graceful about additional
4396 scope qualifiers. Adjust comments to reflect reality.
4397
4398 1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
4399
4400 * call.c (build_conditional_expr): Fix typo.
4401 * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
4402 lvalue before trying to mess with the sides.
4403
4404 * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
4405
4406 Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
4407
4408 * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
4409
4410 1999-08-23 Jason Merrill <jason@yorick.cygnus.com>
4411
4412 * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
4413 Return arbitrary pointer or NULL.
4414 (check_eh_spec): Call __throw_type_match_rtti_2.
4415 * tinfo.h (*::dcast): Return int. Add valp parm.
4416 * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers.
4417 * tinfo2.cc (__throw_type_match_rtti_2): Likewise.
4418 (__throw_type_match_rtti): Now just a wrapper.
4419
4420 * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
4421 (init_exception_processing): Don't initialize them.
4422
4423 1999-08-23 Paul Burchard <burchard@pobox.com>
4424
4425 * decl.c (check_default_argument): Fix typo.
4426
4427 1999-08-22 Mark Mitchell <mark@codesourcery.com>
4428
4429 * cp-tree.def (STMT_EXPR): Fix typo in node name.
4430
4431 * dump.c (dump_next_stmt): New function.
4432 (dequeue_and_dump): Use it.
4433
4434 * pt.c (tsubst_copy): Make sure to initialize return value for a
4435 STMT_EXPR, even when processing_template_decl.
4436 * semantics.c (finish_stmt_expr): A statement-expression whose
4437 last statement is not an expression-statement has type `void'.
4438
4439 1999-08-20 Mark Mitchell <mark@codesourcery.com>
4440
4441 * semantics.c (finish_stmt_expr): Fix typo in comment.
4442 * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
4443 (mapcar): Likewise.
4444 * init.c (build_vec_delete_1): Make the children of a permanent
4445 BIND_EXPR permanent.
4446 * pt.c (register_specialization): Don't register a specialization
4447 more than once.
4448
4449 1999-08-18 Andrew Haley <aph@cygnus.com>
4450
4451 * method.c (process_overload_item): Call build_mangled_C9x_name ()
4452 for all integer parameter types larger than long long.
4453
4454 1999-08-19 Mark Mitchell <mark@codesourcery.com>
4455
4456 * pt.c (redeclare_class_template): Merge default template
4457 arguments in both directions.
4458
4459 * typeck.c (common_type): Undo 1999-08-18 change. Remove
4460 compiler_error message.
4461
4462 1999-08-19 Jason Merrill <jason@yorick.cygnus.com>
4463
4464 * cp-tree.h: Declare flag_use_repository.
4465 * pt.c (do_decl_instantiation): Don't complain about duplicate
4466 instantiation with -frepo.
4467 (do_type_instantiation): Likewise.
4468
4469 * pt.c (push_template_decl_real): Complain about everything
4470 that isn't a valid template.
4471
4472 * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
4473 affect inlines.
4474
4475 1999-08-19 Mark Mitchell <mark@codesourcery.com>
4476
4477 * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
4478 * decl2.c (build_expr_from_tree): Handle it.
4479 * error.c (dump_expr): Likewise.
4480 * pt.c (for_each_template_parm): Likewise.
4481 (tsubst_copy): Likewise.
4482 * tree.c (search_tree): Likewise.
4483 * semantics.c (finish_pseudo_destructor_call): Create it.
4484
4485 1999-08-18 Mark Mitchell <mark@codesourcery.com>
4486
4487 * search.c (setup_class_bindings): Robustify.
4488 * typeck.c (common_type): Use same_type_p, not pointer equality,
4489 to compare types.
4490
4491 * cp-tree.h (build_lang_field_decl): Remove.
4492 * class.c (build_vtable): Replace calls to build_lang_field_decl
4493 with build_lang_decl.
4494 (prepare_fresh_vtable): Likewise.
4495 (finish_struct_1): Likewise.
4496 (init_class_processing): Likewise.
4497 * decl.c (push_using_decl): Likewise.
4498 (init_decl_processsing): Likewise.
4499 (grokvardecl): Likewise.
4500 (build_ptrmemfunc_type): Likewise.
4501 (grokdeclarator): Likewise.
4502 (build_enumerator): Likewise.
4503 * decl2.c (grok_x_components): Likewise.
4504 (do_class_using_decl): Likewise.
4505 * except.c (call_eh_info): Likewise.
4506 * init.c (init_init_processing): Likewise.
4507 * rtti.c (expand_class_decl): Likewise.
4508 * tree.c (build_base_fields): Likewise.
4509 (build_vbase_pointer_fields): Likewise.
4510 * lex.c (build_lang_decl): Build declarations on the permanent
4511 obstack if we're building statmeent trees.
4512 (retrofit_lang_decl): Handle both the full lang_decl and also the
4513 smaller lang_decl_flags here.
4514 (build_lang_field_decl): Remove.
4515 * pt.c (push_template_decl_real): Issue errors for variable
4516 declarations that are not static members.
4517
4518 1999-08-18 Richard Henderson <rth@cygnus.com>
4519
4520 * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
4521 (mapcar): Likewise.
4522
4523 1999-08-17 Mark Mitchell <mark@codesourcery.com>
4524
4525 * cp-tree.h (back_end_hook): New variable.
4526 * decl2.c (back_end_hook): Define it.
4527 (finish_file): If it's non-NULL, call it.
4528
4529 * decl.c (add_decl_to_level): New function.
4530 (push_local_binding): Use it.
4531 (find_binding): Fix typo in comment.
4532 (pushdecl): Use add_decl_to_level. Put templates on the
4533 corresponding namespace-scope binding levels.
4534 * dump.c (dequeue_and_dump): Print the specializations of a
4535 template.
4536 * pt.c (push_template_decl_real): Don't push a template multiple
4537 times.
4538
4539 1999-08-17 Mark Mitchell <mark@codesourcery.com>
4540
4541 * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
4542 (CALL_DECLARATOR_QUALS): Likewise.
4543 (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
4544 * decl.c (grokdeclarator): Adjust to use them.
4545 * decl2.c (grokfield): Likewise.
4546 (reparse_absdcl_as_casts): Likewise.
4547 * lex.c (make_call_declarator): Likewise.
4548 (set_quals_and_spec): Likewise.
4549 * pt.c (tsubst): Likewise.
4550 * tree.c (mapcar): Remove special hack to handle third operand of
4551 a CALL_EXPR.
4552
4553 1999-08-16 Mark Mitchell <mark@codesourcery.com>
4554
4555 * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
4556 * class.c (build_vtable): Use build_lang_field_decl to build the
4557 VAR_DECLs for vtables.
4558 (prepare_fresh_vtable): Likewise.
4559 * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
4560 CAN_HAVE_FULL_LANG_DECL_P.
4561 (push_using_decl): Use build_lang_decl to build USING_DECLs.
4562 (grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
4563 * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
4564 (build_lang_field_decl): Likewise.
4565 (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
4566 to copy.
4567
4568 * cp-tree.def (STMT_EXPR): New tree node.
4569 * cp-tree.h (STMT_EXPR_STMT): New macro.
4570 (store_return_init): Change prototype.
4571 (finish_named_return_value): New function.
4572 (expand_stmt): Likewise.
4573 (expand_body): Likewise.
4574 (begin_stmt_tree): Likewise.
4575 (finish_stmt_tree): Likewise.
4576 (expanding_p): New variable.
4577 (last_expr_type): Likewise.
4578 (building_stmt_tree): New macro.
4579 * decl.c (start_function): Use building_stmt_tree, not
4580 processing_template_decl, where appropriate.
4581 (store_parm_decls): Likewise.
4582 (store_return_init): Move most of the body to semantics.c.
4583 (finish_function): Use building_stmt_tree.
4584 (finish_stmt): Clear last_expr_type here.
4585 (cp_function): Add expanding_p, last_tree, last_expr_type.
4586 (push_cp_function_context): Save them.
4587 (pop_cp_function_context): Restore them.
4588 * decl2.c (setup_vtbl_ptr): Move to semantics.c.
4589 * error.c (dump_expr): Handle STMT_EXPR.
4590 * except.c (expand_start_catch_block): Use building_stmt_tree.
4591 Use add_decl_stmt.
4592 * expr.c (cplus_expand_expr): Handle STMT_EXPR.
4593 (do_case): Move add_tree call to semantics.c.
4594 * parse.y (return_init): Use finish_named_return_value.
4595 (for.init.statement): Use finish_expr_stmt.
4596 * parse.c: Regenerated.
4597 * pt.c (do_pushlevel): Move to semantics.c.
4598 (do_poplevel): Likewise.
4599 (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
4600 (tsubst_expr): Don't expand all the way to RTL here. Handle
4601 RETURN_INIT and CTOR_INITIALIZER.
4602 (instantiate_decl): Call expand_body after tsubst'ing into
4603 DECL_SAVED_TREE.
4604 * semantics.c (expand_stmts): New function.
4605 (expanding_p): New variable.
4606 (last_expr_type): Likewise.
4607 (finish_expr_stmt): Use building_stmt_tree.
4608 (begin_if_stmt): Likewise.
4609 (finish_if_stmt_cond): Likewise.
4610 (finish_then_clause): Likewise.
4611 (begin_else_clause): Likewise.
4612 (finish_else_clause): Likewise.
4613 (begin_while_stmt): Likewise.
4614 (finish_while_stmt_cond): Likewise.
4615 (finish_while_stmt): Likewise.
4616 (finish_do_body): Likewise.
4617 (finish_do_stmt): Likewise.
4618 (finish_return_stmt): Likewise.
4619 (begin_for_stmt): Likewise.
4620 (fnish_for_init_stmt): Likewise.
4621 (finish_for_cond): Likewise.
4622 (finish_for_expr): Likewise.
4623 (finish_for_stmt): Likewise.
4624 (finish_break_stmt): Likewise.
4625 (finish_continue_stmt): Likewise.
4626 (finish_switch_cond): Likewise.
4627 (finish_switch_stmt): Likewise.
4628 (finish_case_label): Call add_tree here if necessary.
4629 (finish_goto_statement): Use building_stmt_tree.
4630 (begin_try_block): Likewise.
4631 (begin_function_try_block): Likewise.
4632 (finish_try_block): Likewise.
4633 (finish_function_try_block): Likewise.
4634 (finish_handler_sequence): Likewise.
4635 (finish_function_handler_sequence): Likewise.
4636 (begin_handler): Likewise.
4637 (finish_handler_parms): Likewise.
4638 (finish_handler): Likewise.
4639 (begin_compound_stmt): Likewise.
4640 (finish_compound_stmt): Likewise.
4641 (finish_asm_stmt): Likewise.
4642 (finish_label_stmt): Likewise.
4643 (finish_named_return_value): New function.
4644 (setup_vtbl_ptr): Moved here from decl2.c.
4645 (do_pushlevel): Moved here from pt.c.
4646 (do_poplevel): Likewise.
4647 (begin_stmt_expr): Use building_stmt_tree.
4648 (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR,
4649 when building_stmt_tree.
4650 (begin_stmt_tree): New function.
4651 (finish_stmt_tree): Likewise.
4652 (expand_stmt): Likewise.
4653 (expand_body): Likewise.
4654 * tree.c (build_cplus_method_type): Make sure the argument types
4655 end up on the same obstack as the METHOD_TYPE.
4656 (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
4657 THROW_EXPR, STMT_EXPR.
4658 (mapcar): Break out common cases. Handle COMPOUND_EXPR,
4659 MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than
4660 sorry, if an unsupported node is encountered.
4661 * typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
4662 (c_expand_return): Don't call add_tree here.
4663
4664 1999-08-15 Mark Mitchell <mark@codesourcery.com>
4665
4666 * pt.c (check_default_tmpl_args): Don't check in local scopes.
4667 (tsubst_decl): Make sure the declaration is on a saveable
4668 obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
4669 variable.
4670 (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
4671
4672 1999-08-14 Jason Merrill <jason@yorick.cygnus.com>
4673
4674 Speed up Koenig lookup.
4675 * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm
4676 to return namespaces we've looked at.
4677 * decl2.c (lookup_using_namespace): Likewise.
4678 (add_function): Don't call ovl_member.
4679 (lookup_arg_dependent): Initialize k.namespaces to the list of
4680 namespaces seen in unqualified lookup.
4681 * call.c (equal_functions): Move here from tree.c.
4682 (joust): Use it to handle duplicate candidates.
4683 * tree.c (ovl_member): Use ==.
4684
4685 1999-08-13 Mark Mitchell <mark@codesourcery.com>
4686
4687 * cp-tree.def (DECL_STMT): Make it smaller.
4688 * cp-tree.h (lang_decl_flags): Move saved_tree to ...
4689 (lang_decl): ... here. Add next.
4690 (DECL_SAVED_TREE): Adjust accordingly.
4691 (DECL_IMPLICIT_TYPEDEF_P): New macro.
4692 (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
4693 (DECL_STMT_DECL): Likewise.
4694 (create_implicit_typedef): New function.
4695 (maybe_push_decl): Likewise.
4696 (tsubst_default_argument): New function.
4697 (at_function_scope_p): Likewise.
4698 (add_decl_stmt): Likewise.
4699 (push_permanent_obstack): Likewise.
4700 * call.c (convert_default_arg): Use tsubst_default_argument.
4701 * class.c (add_method): Use push_permanent_obstack.
4702 (build_self_reference): Create a TEMPLATE_DECL for the
4703 self-reference, if necessary.
4704 * decl.c (pseudo_global_level_p): Only look at the current binding
4705 level.
4706 (push_binding): Use push_permanent_obstack.
4707 (create_implicit_typedef): New function.
4708 (pushtag): Use it.
4709 (duplicate_decls): Use push_permanent_obstack.
4710 (maybe_push_decl): New function.
4711 (start_decl): Use it. Remove dead code. Use add_decl_stmt.
4712 (start_decl_1): Remove dead code.
4713 (cp_finish_decl): Remove DECL_STMT handling here. Don't use
4714 pseudo_global_level_p.
4715 (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
4716 template.
4717 (grokdeclarator): Likewise, for TYPE_DECLs. Don't use
4718 pseudo_global_level_p.
4719 * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
4720 a template.
4721 (get_sentry): Use push_permanent_obstack.
4722 * dump.c (dequeue_and_dump): Enable DECL_STMT.
4723 * except.c (call_eh_info): Use push_permanent_obstack.
4724 (build_eh_type_ref): Likewise.
4725 (do_pop_exception): Likewise.
4726 (expand_eh_spec): Likewise.
4727 (alloc_eh_object): Likewise.
4728 (expand_throw): Likewise.
4729 * init.c (build_java_class_ref): Likewise.
4730 * lex.c (get_time_identifier): Likewise.
4731 (free_lang_decl_chain): Correct type.
4732 (retrofit_lang_decl): Adjust accordingly.
4733 (build_lang_field_decl): Likewise.
4734 * lex.h (free_lang_decl_chain): Likewise.
4735 * parse.y (lang_extdef): Don't use pseudo_global_level_p.
4736 * parse.c: Regenerated.
4737 * pt.c (tsubst_default_arguments): New function.
4738 (retrieve_local_specialization): Likewise.
4739 (register_local_specialization): Likewise.
4740 (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use
4741 pseudo_global_level_p to determine whether or not a template is
4742 primary.
4743 (lookup_template_class): Likewise. Use create_implicit_typedef.
4744 (instantiate_class_template): Call tsubst_default_arguments for
4745 member functions, if appropriate.
4746 (tsubst_default_argument): New function.
4747 (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs.
4748 * search.c (at_function_scope_p): New function.
4749 * semantics.c (finish_asm_stmt): Use push_permanent_obstack.
4750 (finish_label_stmt): Likewise.
4751 (add_decl_stmt): New function.
4752 (begin_class_definition): Likewise.
4753 (finish_typeof): Likewise.
4754 * tree.c (copy_template_template_parm): Likewise.
4755 (copy_to_permanent): Likewise.
4756 (push_permanent_obstack): Define.
4757 (mark_addressable): Use it.
4758 * typeck.c (mark_addressable): Likewise.
4759
4760 1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
4761
4762 * cp-tree.h (init_cplus_unsave): New.
4763 (cplus_unsave_expr_now): New.
4764 * lex.c (init_parse): Call init_cplus_unsave.
4765 * tree.c (init_cplus_unsave): New.
4766 (cplus_unsave_expr_now): New.
4767
4768 1999-08-13 Mark Mitchell <mark@codesourcery.com>
4769
4770 * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and
4771 decl_constant_value to simplify array bounds.
4772
4773 1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
4774
4775 * lang-options.h: Add -fms-extensions.
4776 * cp-tree.h: Declare flag_ms_extensions.
4777 * decl2.c: Define it.
4778 * class.c (instantiate_type): Don't complain about taking the address
4779 of a bound member function if -fms-extensions.
4780 * typeck.c (build_unary_op): Likewise.
4781 * decl.c (grokdeclarator): Or about implicit int.
4782 * init.c (resolve_offset_ref): Or about implicit '&'.
4783
4784 1999-08-11 Mark Mitchell <mark@codesourcery.com>
4785
4786 * cp-tree.h (minimal_parse_mode): Remove.
4787 (finish_label_stmt): New function.
4788 * decl.c (saved_scope): Remove minimal parse mode.
4789 (maybe_push_to_top_level): Don't save it.
4790 (pop_from_top_level): Don't restore it.
4791 (define_label): Split out template-handling code to semantics.c.
4792 (start_decl): Don't use minimal_parse_mode.
4793 (cp_finish_decl): Likewise.
4794 (start_function): Don't increment it.
4795 (store_return_init): Don't use it.
4796 (finish_function): Don't decrement it.
4797 * parse.y (label_colon): Use finish_label_stmt throughout.
4798 * parse.c: Regenerated.
4799 * pt.c (minimal_parse_mode): Don't define it.
4800 (tsubst_expr): Use finish_label_stmt.
4801 * semantics.c (finish_label_stmt): New function.
4802
4803 * dump.c (queue): Be careful when computing bitmasks.
4804 (dequeue_and_dump): Describe binfos as binfos, not as
4805 vectors.
4806
4807 * parse.y (pedantic): Give it itype. Adjust usage accordingly
4808 throughout.
4809 * parse.c: Regenerated.
4810
4811 * Make-lang.in (CXX_SRCS): Remove sig.c.
4812 * Makefile.in (CXX_OBJS): Remove sig.o.
4813 (sig.o): Remove.
4814 * cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
4815 (CPTI_SIGNATURE_TYPE): Likewise.
4816 (CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
4817 (opaque_type_node): Likewise.
4818 (signature_type_node): Likewise.
4819 (sigtable_entry_type): Likewise.
4820 (flag_handle_signatures): Likewise.
4821 (lang_type): Remove is_signature, is_signature_pointer,
4822 is_signature_reference, has_opaque_typedecls,
4823 sigtables_has_been_generated. Adjust dummy. Remove signature,
4824 signature_pointer_to, signature_reference_to.
4825 (IS_SIGNATURE): Remove.
4826 (SET_SIGNATURE): Remove.
4827 (CLEAR_SIGNATURE): Remove.
4828 (IS_SIGNATURE_POINTER): Remove.
4829 (IS_SIGNATURE_REFERENCE): Remove.
4830 (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
4831 (SIGTABLE_HAS_BEEN_GENERATED): Remove.
4832 (CLASSTYPE_SIGNATURE): Remove.
4833 (SIGNATURE_TYPE): Remove.
4834 (SIGNATURE_METHOD_VEC): Remove.
4835 (SIGNATURE_POINTER_TO): Remove.
4836 (SIGNATURE_REFERENCE_TO): Remove.
4837 (lang_decl_flags): Remove is_default_implementation. Rename
4838 memfunc_pointer_to to saved_tree.
4839 (IS_DEFAULT_IMPLEMENTATION): Remove.
4840 (DECL_MEMFUNC_POINTER_TO): Remove.
4841 (DECL_MEMFUNC_POINTING_TO): Remove.
4842 (DECL_SAVED_TREE): Adjust definition.
4843 (tag_types): Remove signature_type_node.
4844 (SIGNATURE_FIELD_NAME): Remove.
4845 (SIGNATURE_FIELD_NAME_FORMAT): Likewise.
4846 (SIGNATURE_OPTR_NAME): Likewise.
4847 (SIGNATURE_SPTR_NAME): Likewise.
4848 (SIGNATURE_POINTER_NAME): Likewise.
4849 (SIGNATURE_POINTER_NAME_FORMAT): Likewise.
4850 (SIGNATURE_REFERENCE_NAME): Likewise.
4851 (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
4852 (SIGTABLE_PTR_TYPE): Likewise.
4853 (SIGTABLE_NAME_FORMAT): Likewise.
4854 (SIGTABLE_NAME_FORMAT_LONG): Likewise.
4855 (SIGTABLE_TAG_NAME): Likewise.
4856 (SIGTABLE_VB_OFF_NAME): Likewise.
4857 (SIGTABLE_VT_OFF_NAME): Likewise.
4858 (finish_base_specifiers): Change prototype.
4859 (build_signature_pointer_type): Remove.
4860 (build_signature_reference_type): Remove.
4861 (build_signature_pointer_constructor): Remove.
4862 (build_signature_method_call): Remove.
4863 (build_optr_ref): Likewise.
4864 (append_signature_fields): Likewise.
4865 (signature_error): Likewise.
4866 * call.c (build_this): Remove signature support.
4867 (build_over_call): Likewise.
4868 (build_new_method_call): Likewise.
4869 * class.c (add_implicitly_declared_members): Likewise.
4870 (finish_struct_1): Likewise.
4871 (finish_struct): Likewise.
4872 * cvt.c (cp_convert_to_pointer): Likewise.
4873 (convert_to_pointer_force): Likewise.
4874 (ocp_convert): Likewise.
4875 * decl.c (sigtable_decl_p): Remove.
4876 (init_decl_processing): Remove support for signatures.
4877 (cp_finish_decl): Likewise.
4878 (grokdeclarator): Likewise.
4879 (grokparms): Likewise.
4880 (xref_tag): Likewise.
4881 (start_function): Likewise.
4882 (start_method): Likewise.
4883 * decl2.c (finish_sigtable_vardecl): Remove.
4884 (flag_handle_signatures): Remove.
4885 (lang_f_options): Remove handle-signatures.
4886 (grokfield): Remove support for signatures.
4887 (grokbitfield): Likewise.
4888 (finish_file): Likewise.
4889 (reparse_absdcl_as_casts): Likewise.
4890 * error.c (dump_type_real): Likewise.
4891 (dump_function_decl): Likewise.
4892 * friend.c (make_friend_class): Likewise.
4893 * gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
4894 * hash.h: Regenerated.
4895 * init.c (build_new_1): Remove support for signatures.
4896 * lang-options.h: Remove -fhandle-signatures,
4897 -fno-handle-signatures.
4898 * lex.c (init_parse): Remove support for signatures.
4899 (yyprint): Likewise.
4900 * lex.h (rid): Remove RID_SIGNATURE.
4901 * method.c (build_decl_overload_real): Remove support for
4902 signatures.
4903 (hack_identifier): Likewise.
4904 * parse.y (base_class): Likewise.
4905 (base_class.1): Likewise.
4906 (access_specifier): Likewise.
4907 * search.c (lookup_member): Likewise.
4908 * semantics.c (finish_qualified_object_call_expr): Likewise.
4909 (finish_template_type_parm): Likewise.
4910 (begin_class_definition): Likewise.
4911 (finish_base_specifier): Likewise.
4912 * sig.c: Remove.
4913 * tree.c (build_cplus_method_type): Remove support for signatures.
4914 * typeck.c (require_complete_type): Likewise.
4915 (c_sizeof): Likewise.
4916 (c_alignof): Likewise.
4917 (build_object_ref): Likewise.
4918 (build_component_ref): Likewise.
4919 (build_indirect_ref): Likewise.
4920 (build_c_cast): Likewise.
4921 (build_modify_expr): Likewise.
4922 (convert_for_initialization): Likewise.
4923 * typeck2.c (signature_error): Remove.
4924 (store_init_value): Remove support for signatures.
4925 (digest_init): Likewise.
4926 (build_x_arrow): Likewise.
4927 (build_functional_cast): Likewise.
4928 * xref.c (GNU_xref_decl): Likewise.
4929
4930 1999-08-10 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
4931
4932 * lex.c (do_identifier): Remove unnecessary lookup of class field.
4933
4934 1999-08-09 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
4935
4936 * decl2.c (set_decl_namespace): Do not complain about non-matching
4937 decls if processing a template.
4938
4939 1999-08-09 Mark Mitchell <mark@codesourcery.com>
4940
4941 * decl.c (build_ptrmemfunc_type): Handle qualified
4942 pointer-to-member types here.
4943 * tree.c (cp_build_qualified_type_real): Simplify handling here.
4944
4945 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4946
4947 * lex.c (lang_identify): Likewise.
4948
4949 1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
4950
4951 * Makefile.in: Update dependencies.
4952 * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
4953 NULL_RTX.
4954 * decl.c: Include "function.h"
4955 (cleanup_label, return_label): Delete declarations.
4956 (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX.
4957 (finish_function): Rename last_parm_insn variable to
4958 fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX.
4959 * decl2.c: Include "function.h".
4960 (rtl_expr_chain): Delete declaration.
4961 * method.c: Include "function.h"
4962 * tree.c (build_vbase_pointer_fields): Don't initialize
4963 DECL_SAVED_INSNS with NULL_RTX.
4964 * typeck.c: Include "function.h"
4965
4966 1999-08-09 Jason Merrill <jason@yorick.cygnus.com>
4967
4968 * semantics.c (begin_function_try_block, finish_function_try_block,
4969 finish_function_handler_sequence): New fns.
4970 * parse.y (function_try_block): Use them.
4971 * pt.c (instantiate_decl): Likewise.
4972
4973 * cp-tree.h: Declare in_function_try_handler.
4974 * decl.c: Define it.
4975 (start_function): Clear it.
4976 (struct cp_function, push_cp_function_context): Save it.
4977 (pop_cp_function_context): Restore it.
4978 * parse.y (function_try_block): Set and clear it.
4979 * except.c (expand_end_catch_block): Rethrow if we reach the end
4980 of a function-try-block handler in a ctor or dtor.
4981 * typeck.c (c_expand_return): Complain about returning from a
4982 function-try-block handler of a ctor.
4983
4984 * parse.y (function_try_block): Call end_protect_partials
4985 before expand_start_all_catch.
4986
4987 1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
4988
4989 * decl.c (struct binding_level): Add eh_region field.
4990 (push_binding_level): Set it.
4991 (define_label): Complain about jumping into an EH block.
4992
4993 * ptree.c (print_lang_type): Print the real type of a PMF.
4994 Print what exceptions a fn type throws.
4995
4996 1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4997
4998 * class.c (count_fields, add_fields_to_vec): Add static prototype.
4999
5000 * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
5001 get_id_2, composite_pointer_type, dump_node_to_file): Constify a
5002 char*.
5003
5004 * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
5005 Constify a char*.
5006
5007 * decl2.c (finish_static_data_member_decl, grokfield): Constify a
5008 char*.
5009
5010 * dump.c (queue_and_dump_index, dump_int, dump_string,
5011 dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
5012 a char*.
5013 (dump_stmt): Add static prototype.
5014
5015 * errfn.c (cp_thing): Constify a char*.
5016
5017 * error.c (dump_unary_op, dump_binary_op, aggr_variety,
5018 dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
5019 dump_expr): Constify a char*.
5020
5021 * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
5022 read_line_number): Add static prototype.
5023 (opname_tab, assignop_tab, operator_name_string): Constify a char*.
5024 (real_yylex): Move label `letter' into the scope where it is used.
5025
5026 * method.c (build_mangled_template_parm_index, build_overload_int,
5027 build_decl_overload_real, get_id_2): Constify a char*.
5028
5029 * search.c (check_final_overrider): Make static.
5030
5031 * typeck.c (composite_pointer_type): Constify a char*.
5032
5033 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
5034
5035 * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
5036 we're looking at a class.
5037
5038 * decl.c (lookup_name_real): Set the complain flag if we're
5039 looking for a namespace member.
5040
5041 * lex.c (real_yylex): We can have a number with no digits.
5042
5043 * cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
5044
5045 * search.c (binfo_from_vbase): New fn.
5046 * cp-tree.h: Declare it.
5047 * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
5048 from pointer to member of virtual base.
5049 * typeck.c (get_delta_difference): Likewise.
5050
5051 1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
5052
5053 * pt.c (tsubst): Use build_index_type to build in-template array
5054 index type. Fixes g++.oliva/dwarf1.C.
5055 * decl.c (grokdeclarator): Likewise, just for consistency, as it
5056 doesn't seem to trigger the bug without it.
5057
5058 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
5059
5060 * typeck2.c (add_exception_specifier): Use complete_type.
5061
5062 1999-08-06 Mark Mitchell <mark@codesourcery.com>
5063
5064 * error.c (dump_expr): Handle EXACT_DIV_EXPR.
5065 (dump_binary_op): Bulletproof.
5066 * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
5067 * tree.c (search_tree): Don't enumerate all the nodes of classes
5068 `1', `2', and `<'; handle them generically. Don't be sorry about
5069 "unrecognized tree codes"; just abort.
5070 (no_linkage_check): Don't do linkage checks for templates.
5071
5072 * tree.c (cp_build_qualified_type_real): Handle
5073 pointer-to-member-function types correctly.
5074
5075 1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
5076
5077 * decl.c (pushdecl): Only give an error for shadowing a parm
5078 from *this* function.
5079
5080 Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
5081
5082 * typeck2.c: Update URLs and mail addresses.
5083
5084 1999-08-04 Nathan Sidwell <nathan@acm.org>
5085
5086 * cp-tree.h (empty_except_spec): New global var.
5087 (compexcepttypes): Remove prototype.
5088 (comp_except_specs): Prototype new global function.
5089 (add_exception_specifier): Prototype new global function.
5090 * decl.c (empty_except_spec): Define new global var.
5091 (duplicate_decls): Use comp_except_specs, reword error message.
5092 (init_decl_processing): Initialize empty_except_spec.
5093 Adjust build_exception_variant calls.
5094 * parse.y (exception_specification_opt): Use empty_except_spec.
5095 (ansi_raise_identifier): Call check_for_new_type.
5096 (ansi_raise_identifiers): Use add_exception_specifier.
5097 * pt.c (tsubst): Use add_exception_specifier to build exception
5098 specifier.
5099 * search.c (check_final_overrider): New static function, broken
5100 out of get_matching_virtual. Check throw specifiers, reword
5101 diagnostics.
5102 (get_matching_virtual): Use check_final_overrider.
5103 * tree.c (build_exception_variant): Use comp_except_specs.
5104 * typeck.c (compexcepttypes): Remove.
5105 (comp_except_types): New static function, helper for
5106 comp_except_specs. Compare two types as exception specifiers.
5107 (comp_except_specs): New global function, compare two exception
5108 specifiers.
5109 (comptypes): Adjust for comp_except_specs.
5110 * typeck2.c (add_exception_specifier): New global function.
5111
5112 * class.c (check_for_override): Reword error message.
5113
5114 1999-08-03 Nathan Sidwell <nathan@acm.org>
5115
5116 * call.c (convert_arg_to_ellipsis): Use pod_type_p.
5117 * cp-tree.h (struct lang_type): Added non_pod_class flag.
5118 (CLASSTYPE_NON_POD_P): New macro to access it.
5119 * class.c (finish_struct_1): Determine non-PODness.
5120 Check for arrays of pointers (-Weffc++).
5121 Remove array inspection duplicated code.
5122 * tree.c (pod_type_p): Detect non-pod non-aggregate types.
5123 Use CLASSTYPE_NON_POD_P.
5124
5125 1999-08-03 Nathan Sidwell <nathan@acm.org>
5126
5127 * class.c (duplicate_tag_error): Preserve template information.
5128
5129 1999-08-03 Nathan Sidwell <nathan@acm.org>
5130
5131 * decl.c (start_enum): Show location of previous definition.
5132 * parse.y (enumlist_opt): New reduction.
5133 (structsp): Simplify enum rules to use enumlist_opt.
5134
5135 1999-08-03 Jason Merrill <jason@yorick.cygnus.com>
5136
5137 * lex.c (yyprint): Handle PFUNCNAME.
5138
5139 * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
5140 build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
5141
5142 1999-08-03 Mumit Khan <khan@xraylith.wisc.edu>
5143
5144 * decl.c (start_decl): Set attributes before duplicate_decls call.
5145
5146 1999-08-02 Mark Mitchell <mark@codesourcery.com>
5147
5148 * Make-lang.in (CXX_SRCS): Add dump.c.
5149 * Makefile.in (CXX_OBJS): Add dump.o.
5150 (dump.o): New target.
5151 * cp-tree.h (DECL_CONV_FN_P): Document.
5152 (DECL_OVERLOADED_OPERATOR_P): New function.
5153 (TYPE_PTRMEM_CLASS_TYPE): New macro.
5154 (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
5155 (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
5156 (ASM_VOLATILE_P): New macro.
5157 (STMT_LINENO): Likewise.
5158 (cp_namespace_decls): New function.
5159 (dump_node_to_file): New function.
5160 * decl.c (cp_namespace_decls): New function.
5161 (walk_namespaces_r): Use it.
5162 (wrapup_globals_for_namespace): Likewise.
5163 * decl2.c (flag_dump_translation_unit): New variable.
5164 (lang_decode_option): Handle -fdump-translation-unit.
5165 (finish_file): If flag_dump_translation_unit is set, dump the
5166 translation unit.
5167 * dump.c: New file.
5168 * lang-options.h: Add -fdump-translation-unit.
5169 * pt.c (tsubst_template_parms): Robustify.
5170 (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
5171 (tsubst_expr): Use STMT_LINENO.
5172 * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
5173 for invalid cv-qualifiers even while building templates.
5174
5175 1999-08-02 Richard Henderson <rth@cygnus.com>
5176
5177 * call.c: Include defaults.h instead of expr.h.
5178 * decl.c: Likewise.
5179 * pt.c: Likewise.
5180 * typeck.c: Include defaults.h.
5181
5182 1999-08-02 Mark Mitchell <mark@codesourcery.com>
5183
5184 * lex.c (errorcount, sorrycount): Don't declare.
5185 * repo.c (errorcount, sorrycount): Likewise.
5186 * typeck2.c (errorcount, sorrycount): Likewise.
5187
5188 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
5189
5190 * call.c (convert_default_arg, build_over_call): Change all uses of
5191 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
5192 Ensure expr.h is included.
5193 * decl.c (grokparams): Ditto.
5194 * pt.c (tsubst_decl): Ditto.
5195 * typeck.c (convert_arguments): Ditto.
5196
5197 1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
5198
5199 * class.c (mark_overriders): Fix order of args to overrides.
5200 (warn_hidden): Likewise. Fix for having virtual and non-virtual
5201 functions with the same name.
5202
5203 1999-08-02 Richard Henderson <rth@cygnus.com>
5204
5205 * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
5206
5207 1999-08-01 Mark Mitchell <mark@codesourcery.com>
5208
5209 * call.c (build_conditional_expr): Fix typo in comment.
5210
5211 1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
5212
5213 * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
5214 case_stack; use in_control_zone_p.
5215 * typeck.c (c_expand_return): Likewise.
5216
5217 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
5218
5219 * except.c (catch_clauses): Delete declaration.
5220
5221 1999-07-30 Mark Mitchell <mark@codesourcery.com>
5222
5223 * call.c (build_conditional_expr): Call convert_from_reference to
5224 avoid reference/non-reference type confusion. Fix typo.
5225
5226 1999-07-30 Richard Henderson <rth@cygnus.com>
5227
5228 * typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
5229 * cp-tree.h (initializer_constant_valid_p): Remove.
5230
5231 1999-07-28 Mark Mitchell <mark@codesourcery.com>
5232
5233 * call.c (conditional_conversion): Don't build BASE_CONVs for
5234 conversions between things that have the same type.
5235 (build_conditional_expr): Tweak.
5236 (convert_like): Some BASE_CONVs really do require the generation
5237 of code.
5238
5239 * init.c (perform_member_init): Don't go through build_modify_expr
5240 for simple initializations.
5241
5242 1999-07-27 Jason Merrill <jason@yorick.cygnus.com>
5243
5244 * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
5245 * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
5246 virtual functions and MI. Simplify.
5247
5248 * method.c: Remove prototype for largest_union_member.
5249 * pt.c (determine_specialization): Fix uninitialized warning.
5250 * lex.c (real_yylex): Likewise.
5251
5252 1999-07-27 Mark Mitchell <mark@codesourcery.com>
5253
5254 * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
5255 here too.
5256
5257 * cp-tree.h (BINFO_VIRTUALS): Document new format.
5258 * class.c (modify_one_vtable): Change prototype accordingly.
5259 (modify_all_vtables): Likewise.
5260 (modify_all_direct_vtables): Likewise.
5261 (modify_all_indirect_vtables): Likewise.
5262 (build_vtable_entry_for_fn): New function.
5263 (set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
5264 (modify_vtable_entry): Likewise.
5265 (add_virtual_function): Likewise.
5266 (build_vtbl_initializer): New function.
5267 (finish_vtbls): Simplify for new BINFO_VIRTUALS format.
5268 (fixup_vtable_deltas1): Likewise.
5269 (fixup_vtable_deltas): Likewise.
5270 (override_one_vtable): Likewise.
5271 (finish_struct_1): Likewise.
5272
5273 * error.c (dump_expr): Likewise.
5274 * search.c (get_abstract_virtuals_1): Likewise.
5275 (get_abstract_virtuals): Likewise.
5276 (expand_upcast_fixups): Likewise.
5277 * tree.c (debug_binfo): Likewise.
5278 * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
5279 __pure_virtual here.
5280
5281 1999-07-26 Mark Mitchell <mark@codesourcery.com>
5282
5283 * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
5284 as per 1999-07-26 change.
5285
5286 * typeck.c (c_sizeof): Don't allow non-static data members.
5287 (expr_sizeof): Likewise.
5288
5289 1999-07-26 Jason Merrill <jason@yorick.cygnus.com>
5290
5291 * input.c (feed_input): Only touch lineno and input_filename
5292 if !USE_CPPLIB. Save the old values before setting the new ones.
5293
5294 * input.c (feed_input): Add file, line parms.
5295 * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
5296 (real_yylex): Check linemode before input_redirected().
5297
5298 * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
5299 from op new to warning.
5300
5301 1999-07-26 Mark Mitchell <mark@codesourcery.com>
5302
5303 * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
5304 * call.c: All uses changed.
5305 * typeck.c: Likewise.
5306
5307 1999-07-26 Nathan Sidwell <nathan@acm.org>
5308
5309 * exception.cc (__cplus_type_matcher): Match __eh_matcher
5310 prototype.
5311
5312 1999-07-26 Mark Mitchell <mark@codesourcery.com>
5313
5314 * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
5315 (ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
5316 (strip_top_quals): Declare.
5317 (ncp_convert): Likewise.
5318 (type_after_usual_arithmetic_converions): Likewise.
5319 (composite_pointer_type): Likewise.
5320 * call.c (strip_top_quals): Don't make it static.
5321 (promoted_arithmetic_type_p): New function.
5322 (conditional_conversion): Likewise.
5323 (null_ptr_cst_p): Allow `false' as a NULL pointer constant.
5324 (standard_conversion): Use same_type_p. Don't build BASE_CONVs
5325 for converting a type to itself.
5326 (reference_binding): Honor LOOKUP_NO_TEMP_BIND.
5327 (implicit_conversion): Make sure the from and to types are
5328 complete.
5329 (add_builtin_candidate): Correct handling of ?: operator.
5330 (add_builtin_candidates): Improve documentation.
5331 (build_conditional_expr): New function.
5332 (can_convert): Implement in terms of can_convert_arg.
5333 (ncp_convert): New function.
5334 * typeck.c (type_after_usual_arithmetic_conversions): New
5335 function, split out from common_type.
5336 (composite_pointer_type): New function, split out from
5337 build_conditional_expr.
5338 (common_type): Use type_after_usual_arithmetic_conversions.
5339 Remove redundant attribute merging.
5340 (comptypes): Tidy. Handle COMPLEX_TYPE.
5341 (build_binary_op_nodefault): Use null_ptr_cst_p.
5342 (build_conditional_expr): Remove.
5343 (convert_for_assignment): Use new conversion functions.
5344
5345 * cp-tree.h (abstract_virtuals_error): Change declaration.
5346 * typeck2.c (abstract_virtuals_error): Check to see if an error
5347 ocurred, and return a boolean value accordingly.
5348 (build_functional_cast): Adjust accordingly.
5349 * class.c (finish_struct_1): Likewise.
5350 * cvt.c (ocp_convert): Likewise.
5351 * decl.c (cp_finish_decl): Likewise.
5352 (grokparams): Likewise.
5353 (grok_op_properties): Likewise.
5354 (start_function): Likewise.
5355 * init.c (build_new_1): Likewise.
5356
5357 * pt.c (unify): Don't get confused by pointers-to-member functions.
5358
5359 * search.c (build_cplus_new): Robustify.
5360
5361 1999-07-24 Richard Henderson <rth@cygnus.com>
5362
5363 * gxx.gperf (__builtin_va_arg): New.
5364 * parse.y (VA_ARG): New token.
5365 (unary_expr): Recognize it.
5366
5367 Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com)
5368
5369 * g++FAQ.texi: Deleted per Joe Buck's request.
5370 * Makefile.in: Corresponding changes.
5371
5372 1999-07-23 Jason Merrill <jason@yorick.cygnus.com>
5373
5374 * lex.c: Sync with C frontend.
5375 (whitespace_cr): New fn.
5376 (skip_white_space): Use it.
5377 (init_parse): Reorder.
5378 (yyprint): Support CONSTANT.
5379 (pragma_getc, pragma_ungetc): Bring back.
5380 (read_line_number): Change in_system_header directly.
5381 (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
5382 (parse_float): Update to C version.
5383 (yylex): Handle '$' under the letter case.
5384 Remove looking_for_typename handling.
5385 Support hex floating point constants.
5386 Follow C's lead for choosing type of integer constants.
5387 Rearrange stuff to match C frontend.
5388 (yyungetc, reinit_parse_for_block, yylex): Support indent_level.
5389 * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
5390
5391 1999-07-23 Mark Mitchell <mark@codesourcery.com>
5392
5393 * call.c (reference_binding): Tweak.
5394 (mayble_handle_implicit_object): Use direct_reference_binding to
5395 create the right implicit conversion sequence.
5396
5397 1999-07-22 Mark Mitchell <mark@codesourcery.com>
5398
5399 * pt.c (convert_nontype_argument): Don't call decl_constant_value
5400 if we're converting to a reference type.
5401
5402 * call.c (NEED_TEMPORARY_P): New macro.
5403 (standard_conversion): Set it, for derived-to-base conversions.
5404 (reference_related_p): New function.
5405 (reference_compatible_p): Likewise.
5406 (convert_class_to_reference): Likewise.
5407 (direct_reference_binding): Likewise.
5408 (reference_binding): Rework for standards-compliance.
5409 (convert_like): Adjust accordingly.
5410 (maybe_handle_ref_bind): Simplify; the right conversion sequences
5411 are now built up in reference_binding.
5412 (initialize_reference): New function.
5413 * cp-tree.h (ICS_USER_FLAG): Document.
5414 (ICS_THIS_FLAG): Likewise.
5415 (ICS_BAD_FLAG): Likewise.
5416 (NEED_TEMPORARY_P): Likewise.
5417 (cp_lvalue_kind): New type.
5418 (real_lvalue_p): Return it.
5419 * error.c (dump_expr): Provide more accurate representation for
5420 AGGR_INIT_EXPRs.
5421 * init.c (expand_default_init): Do not try to perform implicit
5422 conversions for a brace-enclosed initializer.
5423 * search.c (lookup_conversions): Document.
5424 * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate
5425 appropriately.
5426 (real_lvalue_p): Adjust accordingly.
5427 (lvalue_p): Likewise.
5428 (build_cplus_new): Don't allow the creation of an abstract class.
5429 * typeck.c (convert_for_initialization): Use initialize_reference.
5430
5431 1999-07-21 Gavin Romig-Koch <gavin@cygnus.com>
5432
5433 * lex.c (real_yylex) : Correct the test for overflow when lexing
5434 integer literals.
5435
5436 1999-07-20 Jason Merrill <jason@yorick.cygnus.com>
5437
5438 * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL,
5439 not DECL_BUILT_IN, to determine if a function is internally declared.
5440 (duplicate_decls): Likewise. Improve handling of builtins.
5441 (push_overloaded_decl): Remove special handling of builtins.
5442
5443 * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P.
5444
5445 * decl.c (grokdeclarator): Pull out decl_constant_value in
5446 templates, too.
5447
5448 * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm.
5449 * cp-tree.h, pt.c, semantics.c: Adjust.
5450 * method.c (largest_union_member): Remove.
5451
5452 * lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
5453
5454 * lex.c (token_getch, token_put_back): New fns.
5455 (real_yylex): Use them.
5456
5457 * lex.c (lang_init): Generalize.
5458 (lang_init_options): Tell cpplib this is C++.
5459 (nextchar): Remove. Replace uses with put_back.
5460 (skip_white_space): Handle linemode here. Optimize for cpplib.
5461 (extend_token_buffer_to): New fn.
5462 (extend_token_buffer): Use it.
5463 (read_line_number, check_newline): Just deal with tokens.
5464 (real_yylex): More cpplib optimizations. Simplify. Don't produce
5465 EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here.
5466 * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING.
5467 * parse.y (PAREN_STAR_PAREN): Remove.
5468 * input.c: Don't use the putback machinery with cpplib.
5469 (sub_getch): Fold back into getch.
5470 (getch): Don't handle linemode here.
5471 (feed_input): Unget any text in the token buffer.
5472
5473 * lex.c (set_typedecl_interface_info, set_vardecl_interface_info,
5474 nextyychar, nextyylval): Remove.
5475
5476 1999-07-20 Michael Tiemann <tiemann@holodeck.cygnus.com>
5477 Jason Merrill <jason@yorick.cygnus.com>
5478
5479 * lex.c (indent_level): New variable.
5480 (init_parse): Set cpp_token to CPP_DIRECTIVE.
5481 (consume_string): Make this smart about USE_CPPLIB.
5482 (yyungetc): Use put_back function.
5483 (pragma_getc, pragma_ungetc): Functions deleted.
5484 (check_newline): Rewrite to be intelligent about USE_CPPLIB.
5485 Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and
5486 pragma_ungetc.
5487 (real_yylex): Rewrite to be intelligent about USE_CPPLIB.
5488 Also, clean up cases where we redundantly set token_buffer[0].
5489 (read_line_number): New fn.
5490 * input.c (feed_input): Use integrated cpplib if USE_CPPLIB.
5491 (end_input): Call cpp_pop_buffer if USE_CPPLIB.
5492 (sub_getch): Conditionalize out code that's not appropriate if
5493 USE_CPPLIB.
5494 (put_back): Rewrite in case USE_CPPLIB is defined.
5495 (input_redirected): Ditto.
5496
5497 Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
5498
5499 * cp-tree.h: Delete lots of declarations of tree nodes; replaced by
5500 c_global_trees and accessor macros defined in c-common.h.
5501 (cp_tree_index): New enumeration.
5502 (cp_global_trees): Declare new array. Add accessor macros for it, and
5503 delete declarations of tree nodes replaced by it.
5504 (builtin_function): Delete macro, add declaration for new function.
5505 Include c-common.h.
5506 * decl.c: Delete definitions for tree nodes that were replaced by
5507 cp_global_trees and c_global_trees.
5508 (init_decl_processing): Call c_common_nodes_and_builtins; delete code
5509 to generate the common builtins here.
5510 (builtin_function): New function.
5511 * decl2.c (abort_fndecl): Delete declaration.
5512 * except.c (expand_builtin_return_address): Delete declaration.
5513 (builtin_return_address_fndecl): Delete variable.
5514 (const_ptr_type_node): Delete declaration.
5515 * lex.c (cons_up_default_function): Delete declaration of
5516 void_list_node.
5517 * parse.y (void_list_node): Delete declaration.
5518 * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
5519 Delete variables.
5520 (const_string_type_node): Delete declaration.
5521 * search.c (abort_fndecl): Delete declaration.
5522 * Makefile.in: Update dependencies.
5523
5524 1999-07-19 Mark Mitchell <mark@codesourcery.com>
5525
5526 * pt.c (check_default_tmpl_args): Move test for missing default
5527 arguments here, from ...
5528 (end_template_parm_list): Here.
5529
5530 1999-07-18 Mark Mitchell <mark@codesourcery.com>
5531
5532 * decl.c (lookup_nested_type): Remove.
5533 (pushtag): Don't call it.
5534
5535 Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com)
5536
5537 * Makefile.in (INTERFACE): Bump to 2.
5538
5539 1999-07-17 Alexandre Oliva <oliva@dcc.unicamp.br>
5540
5541 * typeck2.c (my_friendly_abort): Updated URL with bug reporting
5542 instructions to gcc.gnu.org. Removed e-mail address.
5543
5544 1999-07-17 Mark Mitchell <mark@codesourcery.com>
5545
5546 * pt.c (determine_specialization): Tighten error-checking.
5547 (end_template_parm_list): Likewise.
5548
5549 1999-07-14 Mark Mitchell <mark@codesourcery.com>
5550
5551 * pt.c (check_default_tmpl_args): Handle friends defined in the
5552 class just like member functions defined in the class.
5553
5554 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
5555 Jason Merrill <jason@yorick.cygnus.com>
5556
5557 * cp-tree.h (struct lang_decl): Added field for storing sorted
5558 FIELD_DECLs (used in TYPE_DECLs).
5559 (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
5560 (DECL_SORTED_FIELDS): New macro.
5561 * class.c (method_name_cmp): New function.
5562 (finish_struct_methods): Modified to support sorting and searching
5563 methods.
5564 (finish_struct_anon): Changed code in inner loop to use ELT rather
5565 than UELT (which required an extra indirection for every reference).
5566 (field_decl_cmp): New function to support sorting FIELD_DECLs.
5567 (finish_struct_1): Sort fields.
5568 * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
5569 (lookup_fnfields_1): Search sorted methods in METHOD_VEC.
5570 Also, switch to using array indexing rather than a changing pointer.
5571 * ptree.c (print_lang_decl): Handle TYPE_DECLs that have
5572 DECL_SORTED_FIELDS.
5573
5574 1999-07-09 Jason Merrill <jason@yorick.cygnus.com>
5575
5576 * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
5577 casts in system headers or extern "C" blocks.
5578
5579 * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
5580 errors to pedwarn.
5581
5582 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
5583
5584 * decl2.c (write_virtuals): Deleted declaration.
5585 * cp-tree.h (write_virtuals): Deleted extern declaration.
5586 * class.c (finish_struct_1): Removed #if 0'd code that mentions
5587 write_virtuals.
5588 * semantics.c (begin_class_definition): Rewrite code to not depend
5589 on write_virtuals.
5590
5591 * lex.c (cp_pragma_interface): New function.
5592 (cp_pragma_implementation): Likewise.
5593 (handle_cp_pragma): Call them.
5594
5595 * typeck.c (comptypes): Simplify C code in look_hard.
5596
5597 * xref.c (PALLOC): Use xcalloc, not calloc.
5598 (SALLOC): Use xmalloc, not malloc.
5599
5600 * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
5601
5602 * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
5603 is NO_DEBUG.
5604
5605 * decl.c (duplicate_decls): If a redeclaration doesn't match the
5606 initial declaration, then don't save the inline info and by all
5607 means don't mark the function as a builtin function.
5608
5609 * decl.c (lookup_name_real): Set NONCLASS to 1 if
5610 CURRENT_CLASS_TYPE is 0.
5611
5612 * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
5613 NULL_TREE.
5614
5615 * ptree.c (print_lang_type): Added vtable-needs-writing.
5616
5617 Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
5618
5619 * decl2.c (mark_vtable_entries): Fix check for rtti offset.
5620
5621 1999-07-06 Gavin Romig-Koch <gavin@cygnus.com>
5622
5623 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
5624 Merged into c-common.
5625
5626 1999-07-05 Dave Brolley <brolley@cygnus.com>
5627
5628 * lex.c (errorcount): Declare it.
5629 (finish_parse): Update errorcount for when using CPPLIB.
5630
5631 1999-07-05 Mark Mitchell <mark@codesourcery.com>
5632
5633 * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
5634 parameters.
5635 (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
5636 * decl.c (push_class_binding): Use it.
5637 (lookup_name_real): Likewise.
5638
5639 1999-07-02 Gavin Romig-Koch <gavin@cygnus.com>
5640
5641 * cp-tree.h (widest_integer_literal_type_node,
5642 widest_unsigned_literal_type) : New.
5643 * decl.c (widest_integer_literal_type_node,
5644 widest_unsigned_literal_type) : New.
5645 (init_decl_processing): Handle/use the two new types.
5646 * lex.c (real_yylex): Same.
5647 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
5648 Same.
5649
5650 1999-07-01 Mark Mitchell <mark@codesourcery.com>
5651
5652 * decl.c (grokdeclarator): Don't give names "for linkage purposes"
5653 to anonymous cv-qualified types.
5654
5655 1999-07-01 Gavin Romig-Koch <gavin@cygnus.com>
5656
5657 * lex.c (real_yylex) : Change integer literal overflow handling to
5658 be like c-lex.c.
5659
5660 * lex.c (real_yylex): Improve 'integer constant out of range' messages.
5661
5662 1999-06-28 Richard Henderson <rth@cygnus.com>
5663
5664 * decl.c (cp_finish_decl): Fix typo in cp_warning_at call.
5665
5666 1999-06-28 Jason Merrill <jason@yorick.cygnus.com>
5667
5668 * error.c (dump_type_real): Handle TREE_LIST again.
5669
5670 * typeck.c (comp_target_parms): Don't complain about
5671 converting from () to (...) if !flag_strict_prototype.
5672
5673 * decl.c (grokdeclarator): Update the names of all variants when
5674 de-anonymizing.
5675
5676 1999-06-21 Mark Mitchell <mark@codesourcery.com>
5677
5678 * init.c (expand_aggr_vbase_init): Rename to
5679 construct_virtual_bases. Conditionalize construction here,
5680 rather than ...
5681 (emit_base_init): Here.
5682
5683 1999-06-19 Mark Mitchell <mark@codesourcery.com>
5684
5685 * semantics.c (finish_asm_stmt): Apply decay conversions to
5686 input operands.
5687
5688 * decl.c (expand_static_init): When building an anonymous function
5689 for use with atexit, compute its body before and after entering
5690 the function.
5691
5692 * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
5693 EXIT_EXPR.
5694
5695 1999-06-18 Mark Mitchell <mark@codesourcery.com>
5696
5697 * init.c (expand_aggr_vbase_init): Add flag parameter.
5698 (build_partial_cleanup_for): Remove, inlining into ..
5699 (expand_cleanup_for_base): ... here. Take flag parameter.
5700 (emit_base_init): Pass the in_chrg parameter to
5701 emit_aggr_vbase_init.
5702 (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.
5703
5704 1999-06-16 Mark Mitchell <mark@codesourcery.com>
5705
5706 * decl2.c (import_export_decl): Use same_type_p, rather than
5707 relying on pointer-equality for types.
5708
5709 * method.c (do_build_copy_constructor): Simplify.
5710
5711 * call.c (build_method_call): Remove bogus code for two-argument
5712 delete.
5713 * init.c (build_new_1): Expand on comment, and remove dead code.
5714
5715 * init.c (expand_cleanup_for_base): New function, split out
5716 from ...
5717 (emit_base_init): Here.
5718 (expand_aggr_vbase_init): Use it.
5719
5720 1999-06-15 Mark Mitchell <mark@codesourcery.com>
5721
5722 * cp-tree.h (class_cache_firstobj): Declare.
5723 (maybe_push_cache_obstack): Rename to push_cache_obstack.
5724 * class.c (permanent_obstack): Remove declaration.
5725 (class_cache_firstobj): Make it global.
5726 (add_method): Don't use permanent_obstack directly.
5727 (pushclass): Only free the class_cache_obstack if we know how far
5728 back to free it.
5729 (maybe_push_cache_obstack): Rename to push_cache_obstack.
5730 * decl.c: Remove dead comment.
5731 (saved_scope): Add class_cache_firstobj.
5732 (push_to_top_level): Save it.
5733 (pop_from_top_level): Restore it.
5734 (push_class_level_binding): Use push_cache_obstack, not
5735 maybe_push_cache_obstack.
5736 * search.c (push_class_decls): Likewise.
5737
5738 1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
5739
5740 * pt.c (tsubst_friend_function): Push into namespace of friend
5741 function before pushdecl'ing it.
5742
5743 1999-06-14 Nathan Sidwell <nathan@acm.org>
5744
5745 * call.c (build_new_op): Remove REF_BIND from all operands.
5746
5747 1999-06-13 Alexandre Oliva <oliva@dcc.unicamp.br>
5748
5749 * init.c (build_new_1): Look up operator delete even if there was
5750 no explicit new placement.
5751
5752 1999-06-08 Nathan Sidwell <nathan@acm.org>
5753
5754 * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
5755 of ...
5756 (build_throw): ... here. Call it.
5757 (process_start_catch_block): Call it.
5758
5759 1999-06-07 Mark Mitchell <mark@codesourcery.com>
5760
5761 * search.c (convert_pointer_to_single_level): Reimplement without
5762 using get_binfo.
5763
5764 1999-06-06 Mark Mitchell <mark@codesourcery.com>
5765
5766 * method.c (is_back_referenceable_type): Back-reference bools when
5767 not squangling.
5768
5769 1999-06-07 Dave Brolley <brolley@cygnus.com>
5770
5771 * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
5772 * input.c (putback_buffer): New structure type.
5773 (putback): Replaces putback_char member.
5774 (putback): Replaces putback_char static variable.
5775 (feed_input): Use putback.
5776 (end_input): Use putback.
5777 (sub_getch): Use putback.
5778 (put_back): Use putback.
5779
5780 1999-06-05 Mark Mitchell <mark@codesourcery.com>
5781
5782 * decl.c (grokdeclarator): Fix typo in last change.
5783
5784 1999-06-04 Jason Merrill <jason@yorick.cygnus.com>
5785
5786 * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
5787 (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
5788
5789 1999-06-04 Nathan Sidwell <nathan@acm.org>
5790
5791 * except.c (build_throw): Check throw expression validity.
5792
5793 1999-06-03 Mark Mitchell <mark@codesourcery.com>
5794
5795 * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
5796 just because flag_signed_bitfields is false.
5797
5798 1999-06-03 Nathan Sidwell <nathan@acm.org>
5799
5800 * semantics.c (begin_class_definition): Update the struct's
5801 location here ...
5802 * class.c (finish_struct): ... rather than here.
5803
5804 * decl.c (make_typename_type): Don't rely on uninitialized
5805 variable.
5806
5807 1999-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5808
5809 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
5810
5811 1999-05-31 Mark Mitchell <mark@codesourcery.com>
5812
5813 * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
5814 and friends rather than messing with current_obstack directly.
5815 (cp_build_qualified_type_real): Rework ARRAY_TYPE
5816 allocation to match practice throughout the rest of the
5817 compiler.
5818
5819 1999-05-30 Mark Mitchell <mark@codesourcery.com>
5820
5821 * lex.c (make_lang_type): Create TYPE_BINFO for
5822 TEMPLATE_TYPE_PARMs just like for non-template types.
5823
5824 * decl.c (start_decl): Move checks on initialization to ...
5825 (cp_finish_decl): Here. Tidy formatting slightly.
5826
5827 1999-05-28 Mark Mitchell <mark@codesourcery.com>
5828
5829 * decl.c (add_binding): Don't complain about a redeclaration of a
5830 semantically identical typedef in a local scope.
5831
5832 1999-05-28 Nathan Sidwell <nathan@acm.org>
5833
5834 * decl.c (complete_array_type): Allocate off same obstack. Fix
5835 DO_DEFAULT comment to match reality.
5836
5837 * friend.c (make_friend_class): Fix diagnostic typo.
5838
5839 1999-05-28 Mark Mitchell <mark@codesourcery.com>
5840
5841 * decl.c (lookup_namespace_name): Handle getting a
5842 TEMPLATE_ID_EXPR.
5843 (expand_static_init): Don't call pushdecl for implicitly declared
5844 `atexit' used to register destructors.
5845
5846 1999-05-25 Mark Mitchell <mark@codesourcery.com>
5847
5848 * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
5849 intialize a vtable.
5850
5851 * cp-tree.h (NAMESPACE_LEVEL): Reformat.
5852 (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes
5853 by combining TEMPLATE_INFO and LEVEL into a single union.
5854 (DECL_TEMPLATE_INFO): Reformat.
5855 (DECL_SAVED_TREE): Document.
5856 (DECL_TEMPLATE_INJECT): Remove.
5857 * class.c (finish_struct): Remove code to deal with
5858 DECL_TEMPLATE_INJECT.
5859
5860 * decl.c (maybe_process_template_type_declaration): Handle all new
5861 types in templates uniformly.
5862 * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
5863 DECL_CONTEXT.
5864 * pt.c (lookup_template_class): Inject template instantiations of
5865 forward-declarations.
5866 (instantiate_class_template): Remove code processing
5867 DECL_TEMPLATE_INJECT.
5868
5869 * pt.c (lookup_template_class): Tweak lookup to find member
5870 templates.
5871
5872 * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
5873 ASM_CV_QUAL.
5874 * semantics.c (finish_asm_stmt): Make strings permanent if they're
5875 used in a template.
5876
5877 1999-05-25 Jason Merrill <jason@yorick.cygnus.com>
5878
5879 * typeck.c (casts_away_constness, casts_away_constness_r): Strip both
5880 parts of pointer to data member types.
5881
5882 1999-05-24 Mark Mitchell <mark@codesourcery.com>
5883
5884 * decl2.c (mark_vtable_entries): Don't make a copy of a function,
5885 and then make it look like `abort'. Just use `abort' instead.
5886
5887 * typeck.c (build_static_cast): Don't allow static_casts that cast
5888 away constness.
5889 (casts_away_constness_r): New function.
5890 (casts_away_constness): Likewise.
5891
5892 * decl.c (lookup_tag): Remove code no longer needed after
5893 name-lookup improvements.
5894 * decl2.c (handle_class_head): Make error-recovery more robust.
5895 * friend.c (make_friend_class): Reject templated typename types.
5896 * lex.c (is_global): A template parameter isn't global.
5897 * parse.y (class_head): Robustify.
5898 * parse.c: Regenerated.
5899
5900 1999-05-22 Mark Mitchell <mark@codesourcery.com>
5901
5902 * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
5903 INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs.
5904
5905 * cp-tree.h (push_nested_namespace): Declare.
5906 (pop_nested_namespace): Likewise.
5907 * decl.c (push_nested_namespace): New function.
5908 (pop_nested_namespace): Likewise.
5909 * pt.c (instantiate_class_template): Use them.
5910
5911 * tree.c (mapcar): Handle NON_LVALUE_EXPR.
5912
5913 * cp-tree.h (cplus_expand_constant): Declare.
5914 * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
5915 converted from one pointer-to-object type to another.
5916 * expr.c (cplus_expand_constant): Don't make it static.
5917 * typeck.c (build_component_ref): Don't crash when presented with
5918 a component which is a TEMPLATE_DECL.
5919 (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a
5920 cast from a pointer-to-member constant to its own type does not
5921 result in a valid non-type template argument.
5922
5923 1999-05-21 Mark Mitchell <mark@codesourcery.com>
5924 Nathan Sidwell <nathan@acm.org>
5925
5926 * Make-lang.in (cc1plus): Make it depend on gxx.gperf.
5927 * cp-tree.h: Fix typo in documentation on pointers-to-members.
5928 (cp_build_qualified_type): Make it a macro.
5929 (cp_build_qualified_type_real): Declare.
5930 * decl.c (grokdeclarator): Remove misleading comment. Avoid
5931 problem with template parameters and restrict-qualification.
5932 * gxx.gperf: Replace NORID with RID_UNUSED throughout.
5933 * hash.h: Regenerated.
5934 * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
5935 the enumeration.
5936 (NORID): Remove definition.
5937 * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
5938 (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs.
5939 (fn_type_unification): Check that the function type resulting from
5940 the deduction is legal.
5941 (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
5942 (unify): Use cp_build_qualified_type_real.
5943 * tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
5944 (cp_build_qualified_type): Rename to ...
5945 (cp_build_qualified_type_real): Add additional COMPLAIN parameter
5946 and modify appropriately.
5947
5948 * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
5949 reveal optimization opportunities.
5950
5951 * pt.c (tsubst): Don't issue error messages when we're not
5952 complaining, even if we see a qualified function type.
5953 (check_cv_quals_for_unify): Don't allow a qualified function
5954 type.
5955
5956 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
5957
5958 * class.c (instantiate_type): Downgrade errors for object-dependent
5959 memfn refs to pedwarn.
5960
5961 1999-05-20 Mark Mitchell <mark@codesourcery.com>
5962
5963 * decl.c (grokdeclarator): Don't treat [] as indicating a
5964 zero-sized array in a typedef.
5965
5966 * call.c (build_object_call): Don't look at DECL_NAME for a type.
5967 (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
5968 (typeck.c): Or TYPE_MAIN_VARIANT for a type.
5969
5970 * pt.c (for_each_template_parm): Rework to match documentation.
5971 Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
5972
5973 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
5974
5975 * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
5976
5977 * class.c (finish_base_struct): Allow non-COM bases for COM classes
5978 except at the leftmost position.
5979 (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
5980 Pass the binfo's class, not the most derived, to skip_rtti_stuff.
5981 * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
5982
5983 * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
5984 (build_cplus_new): Make sure that what we return is of the right type.
5985
5986 1999-05-20 Mark Mitchell <mark@codesourcery.com>
5987
5988 * cp-tree.h (make_ptrmem_cst): New function.
5989 * expr.c (cplus_expand_constant): Split out from ...
5990 (cplus_expand_expr): Here. Use cplus_expand_constant.
5991 (init_cplus_expand): Set lang_expand_constant.
5992 * pt.c (convert_nontype_argument): Use make_ptrmem_cst.
5993
5994 * tree.c (make_ptrmem_cst): Define.
5995 * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
5996 * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.
5997
5998 1999-05-19 Mark Mitchell <mark@codesourcery.com>
5999
6000 * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
6001
6002 * decl2.c (start_static_storage_duration_function): Fix comment.
6003 (finish_file): Create static storage duration functions lazily.
6004
6005 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
6006
6007 Implement anonymous structs.
6008 * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
6009 * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
6010 * class.c (finish_struct_1): Remove redundant check for anon struct.
6011 * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
6012 (check_tag_decl): Check for anonymous struct here.
6013 * decl2.c (build_anon_union_vars): Catch anon struct at file scope.
6014 * init.c (sort_member_init, emit_base_init): Handle getting fields
6015 as well as names in current_member_init_list.
6016 (perform_member_init): Handle getting an anon aggr.
6017 * method.c (do_build_assign_ref): Don't descend into anon aggrs.
6018 (do_build_copy_constructor): Likewise.
6019
6020 1999-05-19 Mark Mitchell <mark@codesourcery.com>
6021
6022 * tree.c (cp_build_qualified_type): Don't allow qualified function
6023 types.
6024
6025 Wed May 19 02:50:53 1999 Arvind Sankar <arvinds@mit.edu>
6026
6027 * gxxint.texi: Fix typo.
6028
6029 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
6030
6031 * call.c (find_scoped_type, resolve_scope_to_name): Lose.
6032 * class.c (finish_struct_1): Use CLASS_TYPE_P.
6033 * ptree.c (print_lang_type): Likewise.
6034 * typeck.c (build_modify_expr, c_expand_asm_operands): Use
6035 IS_AGGR_TYPE_CODE.
6036 * typeck2.c (digest_init): Likewise.
6037
6038 1999-05-18 Jason Merrill <jason@yorick.cygnus.com>
6039
6040 * call.c (joust): Compare the types of the conv ops, not the
6041 target types of the conversions.
6042
6043 Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
6044
6045 * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
6046 was not given.
6047
6048 1999-05-17 Mark Mitchell <mark@codesourcery.com>
6049
6050 * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation.
6051 * decl.c (grokfndecl): Don't allow inline declarations of friend
6052 template specializations, or friend template specializations with
6053 default arguments.
6054 * pt.c (tsubst): Handle substitution into array types that does
6055 not yield a fixed upper bound, even when not processing a
6056 template.
6057 (tsubst_copy): Deal with the fact that the second operand to a
6058 TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC.
6059 * search.c (marked_pushdecls_p): Don't descend into
6060 TEMPLATE_TYPE_PARMs and the like.
6061 (unmarked_pushdecls_p): Likewise.
6062
6063 * call.c (build_over_call): Don't throw away
6064 initializations/copies of empty classes; use MODIFY_EXPR and
6065 INIT_EXPR as for non-empty classes.
6066 * class.c (finish_struct_1): Put the padding byte for an empty
6067 class on the TYPE_NONCOPIED_PARTS list for the class.
6068
6069 1999-05-16 Mark Mitchell <mark@codesourcery.com>
6070
6071 * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
6072 indicate a reference to a field that is a qualified name.
6073
6074 1999-05-16 Jason Merrill <jason@yorick.cygnus.com>
6075
6076 * decl2.c (finish_objects): Don't use .?tors.* if we don't have
6077 ASM_OUTPUT_CONSTRUCTOR.
6078
6079 * friend.c (do_friend): Add attrlist arg. Remove support for
6080 getting a non-decl as 'decl'.
6081 * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or
6082 rtl.
6083 (grokdeclarator): Adjust.
6084 * cp-tree.h: Adjust.
6085
6086 1999-05-16 Mark Mitchell <mark@codesourcery.com>
6087
6088 * cp-tree.h (permanent_p): New function.
6089 * init.c (build_new_1): Use mapcar, not copy_node, to copy a
6090 possibly complex tree node.
6091 * tree.c (mapcar): Adjust comments, and follow coding standards in
6092 conditional.
6093 (permanent_p): New function.
6094
6095 1999-05-13 Per Bothner <bothner@cygnus.com>
6096
6097 * class.c (push_lang_context): Turn off DECL_IGNORED_P for
6098 primitive Java types, if we actually see `extern "Java"'.
6099
6100 1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
6101
6102 * lang-specs.h: Pass -$ to the preprocessor.
6103
6104 1999-05-10 Jason Merrill <jason@yorick.cygnus.com>
6105
6106 * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too.
6107 Don't bother wrapping an OFFSET_TYPE around unknown_type_node.
6108 (resolve_offset_ref): Don't handle a raw baselink.
6109 * cvt.c (build_expr_type_conversion): Likewise.
6110 * typeck.c (decay_conversion, build_c_cast, convert_for_assignment,
6111 convert_for_initialization): Likewise.
6112 * class.c (instantiate_type): Handle seeing a baselink under an
6113 OFFSET_REF.
6114 * error.c (dump_expr): Likewise.
6115 * pt.c (for_each_template_parm): Likewise.
6116 (resolve_overloaded_unification): Likewise.
6117 * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise.
6118 * typeck.c (expr_sizeof): Also complain about other permutations
6119 of overloaded functions.
6120
6121 1999-05-07 Jason Merrill <jason@yorick.cygnus.com>
6122
6123 * init.c (resolve_offset_ref): Don't return a raw method.
6124 Use BASELINK_P.
6125 * typeck.c (decay_conversion): Don't handle a raw method.
6126 Resolve all OFFSET_REFs.
6127 (get_member_function_from_ptrfunc): 0 is a valid vtable index.
6128 (build_binary_op_nodefault): Handle resolving overloaded fns. Use
6129 same_type_p for pmf bits. Don't use build_binary_op to compare
6130 raw pointers to methods.
6131 (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE,
6132 to decide when to call resolve_offset_ref.
6133 (build_c_cast, convert_for_initialization): Likewise.
6134 * cvt.c (build_expr_type_conversion): Likewise.
6135
6136 1999-05-06 Nathan Sidwell <nathan@acm.org>
6137
6138 * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class.
6139
6140 1999-05-05 Mark Mitchell <mark@codesourcery.com>
6141
6142 * decl2.c (start_objects): Don't let static constructors and
6143 destructors get inlined.
6144
6145 * parse.y (nested_name_specifier): Make sure ordinary types are
6146 complete, just like template types.
6147 * parse.c: Regenerated.
6148
6149 * pt.c (check_explicit_specialization): Improve error messages.
6150
6151 1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
6152
6153 * typeck.c (string_conv_p): Use same_type_p to check whether we
6154 try to convert between char and wchar_t.
6155
6156 1999-05-03 Mark Mitchell <mark@codesourcery.com>
6157
6158 * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous
6159 lookup to error_mark_node here.
6160 (lookup_member): Revise documentation. Add comments. Don't set
6161 the TREE_TYPE to error_mark_node here, and don't build up an extra
6162 TREE_LIST for ambiguous lookups.
6163 (setup_class_bindings): Adjust accordingly.
6164 (push_class_decls): Revise out-of-date comments.
6165
6166 * typeck.c (build_const_cast): Tighten checks for legality.
6167
6168 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
6169
6170 * init.c (build_member_call): Lookup names coming from
6171 namespace-scoped LOOKUP_EXPR.
6172
6173 1999-05-03 Jim Blandy <jimb@zwingli.cygnus.com>
6174
6175 * gxxint.texi: Add documentation for 'I'.
6176
6177 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
6178
6179 * tinfo.cc (operator==): Qualify type_info with std::.
6180
6181 1999-05-02 Mark Mitchell <mark@codesourcery.com>
6182
6183 * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy.
6184 (DECL_COMDAT): Remove definition.
6185
6186 1999-05-01 Mark Mitchell <mark@codesourcery.com>
6187
6188 * decl.c (wrapup_globals_for_namespace): Fix thinko in previous
6189 change.
6190
6191 1999-04-30 Mark Mitchell <mark@codesourcery.com>
6192
6193 * class.c (build_vtable): Use build_lang_decl when building
6194 vtables, not just build_decl.
6195 (prepare_fresh_vtable): Likewise.
6196 * decl.c (wrapup_globals_for_namespace): Mark vtables as
6197 DECL_EXTERNAL when calling wrapup_global_declarations.
6198 * decl2.c (priority_info_s): Add initializations_p and
6199 destructions_p members.
6200 (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED,
6201 when deciding what vtables to write out.
6202 (ssdf_decls): New variable.
6203 (ssdf_decls_used): Likewise.
6204 (start_static_storage_duration_function): Deal with being called
6205 multiple times. Avoid inlining this function.
6206 (generate_inits_for_priority): Deal with reuse of priority map.
6207 (get_priority_info): Clear initializations_p and destructions_p.
6208 (do_static_initialization): Tweak comment.
6209 (do_static_destruction): Likewise. Fix condition on sentries for
6210 destruction.
6211 (generate_ctor_or_dtor_function): Call all of the static storage
6212 duration functions.
6213 (generate_ctor_or_dtor_function_for_priority): Check
6214 initializations_p and destructions_p to see what priorities need
6215 initialization functions.
6216 (finish_file): Rework to generate multiple static storage duration
6217 functions, rather than just one.
6218
6219 * typeck.c (build_const_cast): Tweak last change to handle
6220 templates correctly.
6221
6222 * typeck.c (build_const_cast): Disallow use of const_cast to
6223 anything but a pointer or reference type.
6224
6225 1999-04-30 Nathan Sidwell <nathan@acm.org>
6226
6227 * decl.c (cp_finish_decl): Don't permit arrays of abstract or
6228 signature type.
6229
6230 1999-04-29 Mark Mitchell <mark@codesourcery.com>
6231
6232 * decl2.c (do_static_destruction): Remove obsolete FIXME comment.
6233 (finish_file): Indent comments properly.
6234
6235 1999-04-29 Richard Henderson <rth@cygnus.com>
6236
6237 * decl2.c (do_static_initialization): Call do_pending_stack_adjust.
6238 (do_static_destruction): Likewise.
6239
6240 1999-04-29 Nathan Sidwell <nathan@acm.org>
6241
6242 * cp-tree.h (TYPE_NOTHROW_P): New macro.
6243 * decl2.c (delete_sanity): Warn on deleting void *.
6244 * init.c (build_new_1): Use TYPE_NOTHROW_P.
6245 * typeck.c (c_expand_return): cp_pedwarn on returning NULL from
6246 throwing operator new.
6247
6248 1999-04-28 Nathan Sidwell <nathan@acm.org>
6249
6250 * cp-tree.h (build_component_addr): Remove prototype.
6251 * typeck.c (build_component_addr): Make static. Remove MSG
6252 argument.
6253 (build_component_addr): Remove MSG parameter, clean up
6254 comment.
6255 (build_x_function_call): Use cp_error.
6256 (build_unary_op): Adjust call of build_component_addr.
6257
6258 1999-04-28 Mark Mitchell <mark@codesourcery.com>
6259
6260 * pt.c (tsubst_friend_class): Check for NULL.
6261
6262 Wed Apr 28 11:42:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
6263
6264 * search.c (binfo_for_vtable): Initialize bfvi.var.
6265
6266 1999-04-27 Nathan Sidwell <nathan@acm.org>
6267
6268 * rtti.c (build_x_typeid): Check rtti is enabled.
6269
6270 1999-04-26 Mark Mitchell <mark@codesourcery.com>
6271
6272 * search.c (is_subobject_of_p): Make sure we're looking at the
6273 right baseclasses.
6274
6275 1999-04-26 Marc Espie <espie@cvs.openbsd.org>
6276
6277 * Make-lang.in (cplib2.ready): Don't depend on phony targets.
6278
6279 1999-04-23 Mark Mitchell <mark@codesourcery.com>
6280
6281 * decl2.c (finish_file): Tweak handling of extern inlines so that
6282 they are not unnecessarily put out.
6283
6284 * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
6285 such as base classes.
6286
6287 1999-04-22 Brendan Kehoe <brendan@cygnus.com>
6288
6289 * tree.c (build_exception_variant): Fix typo: use the chain of U,
6290 not trying V, while cycling through U.
6291
6292 1999-04-22 Mark Mitchell <mark@codesourcery.com>
6293
6294 * cp-tree.h (lang_decl_flags): Remove returns_first_arg and
6295 preserves_first_arg. Enlarge dummy accordingly.
6296 (DECL_TINFO_FN_P): New macro.
6297 (SET_DECL_TINFO_FN_P): Likeiwse.
6298 (DECL_RETURNS_FIRST_ARG): Remove.
6299 (DECL_PRESERVES_THIS): Likewise.
6300 (DECL_INIT_PRIORITY): New macro.
6301 (finish_struct_1): Change prototype.
6302 (cat_namespace_levels): Remove prototype.
6303 (vtable_decl_p): New prototype.
6304 (vtype_decl_p): Likewise.
6305 (sigtable_decl_p): Likewise.
6306 (walk_globals_pred): New typedef.
6307 (walk_globals_fn): Likewise.
6308 (walk_globals): New prototype.
6309 (walk_namespaces_fn): New typedef.
6310 (walk_namespaces): New prototype.
6311 (wrapup_globals_for_namespace): Likewise.
6312 (walk_vtables): Remove prototype.
6313 (walk_sigtables): Likewise.
6314 (instantiate_pending_templates): New prototype.
6315 * class.c (finish_struct_1): Don't return a value.
6316 * decl.h (pending_statics): Remove declaration.
6317 * decl.c (walk_namespaces_r): New function.
6318 (walk_globals_r): Likewise.
6319 (vtable_decl_p): Likewise.
6320 (vtype_decl_p): Likewise.
6321 (sigtable_decl_p): Likewise.
6322 (walk_namespaces): Likewise.
6323 (walk_globals_data): New type.
6324 (walk_globals): New function.
6325 (wrapup_globals_for_namespace): Likewise.
6326 (expand_static_init): Remove assertion. Remove redundancy in
6327 conditional. Don't put static data members in static_aggregates
6328 Tidy.
6329 (finish_function): Remove redundancy in conditional. Don't set
6330 DECL_RETURNS_FIRST_ARG.
6331 (cat_namespace_levels): Remove.
6332 * decl2.c: Include splay-tree.h and varray.h.
6333 (priority_info_s): New structure.
6334 (finish_vtable_vardecl): Change prototype. Adjust for new calling
6335 conventions.
6336 (prune_vtable_vardecl): Likewise.
6337 (finish_sigtable_vardecl): Likewise.
6338 (setup_initp): Remove.
6339 (do_dtors): Remove.
6340 (do_ctors): Remove.
6341 (start_static_storage_duration_function): New function.
6342 (generate_inits_for_priority): Likewise.
6343 (finish_static_storage_duration_function): Likewise.
6344 (get_priority_info): Likewise.
6345 (do_static_initialization): Likewise.
6346 (do_static_destruction): Likewise.
6347 (do_static_initialization_and_destruction): Likewise.
6348 (generate_ctor_or_dtor_function): Likewise.
6349 (generate_ctor_and_dtor_functions_for_priority): Likewise.
6350 (pending_statics): Make it a varray.
6351 (pending_statics_used): New variable.
6352 (saved_inlines): Make it a varray.
6353 (saved_inlines_used): New variable.
6354 (finish_static_data_member): Change method of updating
6355 pending_statics.
6356 (mark_inline_for_output): Remove #if 0'd code. Change method of
6357 updating saved_inlines.
6358 (walk_vtables): Remove.
6359 (walk_sigtables): Likewise.
6360 (import_export_decl): Use DECL_TINFO_FN_P.
6361 (pending_templates): Remove declaration.
6362 (maybe_templates): Likewise.
6363 (static_aggregates_initp): Likewise.
6364 (setup_initp): Likewise.
6365 (finish_objects): Simplify.
6366 (INITIALIZE_P_IDENTIFIER): New macro.
6367 (PRIORITY_IDENTIFIER): New macro.
6368 (SSDF_IDENTIFIER): New macro.
6369 (initialize_p_decl): New variable.
6370 (priority_decl): Likewise.
6371 (ssdf_decl): Likewise.
6372 (priority_info_map): Likewise.
6373 (finish_file): Recode output of static intializers and other
6374 file-scope finalization tasks.
6375 * error.c (OB_END_TEMPLATE_ID): New macro.
6376 (dump_type_real): Use it.
6377 (dump_decl): Likewise.
6378 (dump_function_name): Likewise.
6379 * lex.c (set_typedecl_interface_info): Adjust for new walk_globals
6380 interface.
6381 (check_newline): Use walk_globals, not walk_vtables.
6382 * pt.c (pending_tempalte_expansions): Remove.
6383 (set_vardecl_interface_info): Likewise.
6384 (pending_templates): Make static.
6385 (maybe_templates): Likewise.
6386 (instantiate_class_template): Adjust call to finish_struct_1.
6387 (instantiate_pending_templates): New function.
6388 * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P.
6389 * tree.c (static_aggregates_initp): Remove.
6390 (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY
6391 instead.
6392 * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h.
6393
6394 * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes
6395 with the RTL code RETURN.
6396 * hash.h: Regenerated.
6397 * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD.
6398 * parse.y: Replace RETURN with RETURN_KEYWORD throughout.
6399 * parse.c: Regenerated.
6400 * pt.c: Include varray.h. Include rtl.h since varray.h requires
6401 it.
6402 (inline_parm_levels): New variable.
6403 (inline_parm_levels_used): Likewise.
6404 (maybe_begin_member_template_processing): Update them.
6405 (maybe_end_member_template_processing): Use them, rather than
6406 guessing how many levels to pop.
6407
6408 * decl.c (make_typename_type): Tighten error-checking.
6409
6410 1999-04-20 Mark Mitchell <mark@codesourcery.com>
6411
6412 * cp-tree.h (build_binary_op): Remove unneeded parameter.
6413 * class.c (build_vrable_entry_ref): Adjust call to
6414 build_binary_op.
6415 * decl.c (expand_static_init): Likewise.
6416 (grokdeclarator): Likewise.
6417 (finish_function): Likewise.
6418 * decl2.c (delete_sanity): Likewise.
6419 (do_dtors): Likewise.
6420 (do_ctors): Likewise.
6421 * error.c (dump_type_suffix): Likewise.
6422 * expr.c (cplus_expand_expr): Likewise.
6423 * init.c (resolve_offset_ref): Likewise.
6424 (build_new): Likewise.
6425 (build_new_1): Likewise.
6426 (build_vec_delete_1): Likewise.
6427 (expand_vec_init_catch_clause): Likewise.
6428 (build_delete): Likewise.
6429 * pt.c (tsubst): Likewise.
6430 * rtti.c (synthesize_tinfo_fn): Likewise.
6431 * search.c (expand_upcast_fixups): Likewise.
6432 (expand_direct_vtbls_init): Likewise.
6433 * typeck.c (get_member_function_from_ptrfunc): Likewise.
6434 (build_binary_op_nodefault): Likewise.
6435 (point_int_sum): Likewise.
6436 (pointer_diff): Likewise.
6437 (build_unary_op): Likewise.
6438 (build_modify_expr): Likewise.
6439 (get_delta_difference): Likewise.
6440 (build_ptrmemfunc): Likewise.
6441 (expand_ptrmemfunc_cst): Likewise.
6442
6443 1999-04-20 Jason Merrill <jason@yorick.cygnus.com>
6444
6445 * decl.c (grokfndecl): Always call cplus_decl_attributes.
6446 * decl2.c (grokfield): Pass attrlist to grokdeclarator.
6447
6448 1999-04-19 Mark Mitchell <mark@codesourcery.com>
6449
6450 * cp-tree.h (finish_static_data_member_decl): New function.
6451 * decl2.c (finish_static_data_member_decl): Split out from ...
6452 (grokfield): Here.
6453 * pt.c (instantiate_class_template): Use it here instead of
6454 trying to fake it.
6455 (tsubst_decl): Don't set DECL_ASSEMBLER_NAME;
6456 finish_static_data_member_decl will do that. Explicit set
6457 DECL_EXTERNAL to match non-template processing.
6458
6459 1999-04-18 Mark Mitchell <mark@codesourcery.com>
6460
6461 * cp-tree.h (finish_class_definition): Add parameter.
6462 * parse.y (structsp): Use it. Don't call pop_scope here.
6463 * parse.c: Regenerated.
6464 * semantics.c (finish_class_definition): Pop it here.
6465
6466 1999-04-17 Mark Mitchell <mark@codesourcery.com>
6467
6468 * decl.c (xref_tag): Revise handling of nested template
6469 declarations.
6470 * pt.c (check_explicit_specialization): Tweak handling of friend
6471 templates in template classes.
6472 (tsubst_friend_class): Handle friend declarations for nested
6473 member template classes.
6474
6475 1999-04-16 Mark Mitchell <mark@codesourcery.com>
6476
6477 * class.c (finish_struct): Remove unused variable.
6478 (pushclass): Likewise.
6479 (invalidate_class_lookup_cache): Likewise.
6480 * cp-tree.def (TYPENAME_TYPE): Improve documentation.
6481 * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME
6482 doesn't get obliterated.
6483 (make_typename_type): Handle template classes correctly.
6484
6485 * cp-tree.h (TREE_NONLOCAL_FLAG): Remove.
6486 (storetags): Declare.
6487 * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG.
6488 (pushclass): Likewise. Use storetags to install tag declarations,
6489 not pushtag.
6490 (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG.
6491 * decl.c (storetags): Make it global.
6492 (push_class_binding): Set INHERITED_VALUE_BINDING_P for an
6493 implicit typename declaration.
6494 (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG.
6495 * method.c (hack_identifier): Likewise.
6496 * search.c (lookup_member): Likewise.
6497
6498 * decl.c (warn_about_implicit_typename_lookup): New function.
6499 (lookup_name_real): Use it. Rework handling of implicit typename
6500 extension.
6501
6502 1999-04-15 Mark Mitchell <mark@codesourcery.com>
6503
6504 * cp-tree.h (lookup_nested_field): Remove.
6505 * class.c (push_nested_class): Handle UNION_TYPEs.
6506 (pop_nested_class): Likewise.
6507 * decl.c (lookup_name_real): Don't call lookup_nested_field.
6508 (start_decl): Use push_nested_class, not just pushclass.
6509 (cp_finish_decl): Use pop_nested_class, not just popclass.
6510 * search.c (lookup_nested_field): Remove.
6511
6512 * cp-tree.h (lang_type): Add documentation.
6513 * decl2.c (handle_class_head): Create template declarations here,
6514 as appropriate.
6515 * parse.y (class_head): Return whether or not we entered a new
6516 scope, as well as the type named.
6517 (named_class_head): Likewise.
6518 (named_complex_class_head_sans_basetype): Likewise.
6519 (structsp): Adjust accordingly. Pop scope when required.
6520 * parse.c: Regenerated.
6521 * pt.c (check_default_tmpl_args): Robustify.
6522 (redeclare_class_template): Likewise.
6523 (instantiate_class_template): An instantiation of an
6524 anonymous union is itself an anonymous union.
6525 * semantics.c (begin_class_definition): Don't create template
6526 declarations here.
6527
6528 1999-04-15 Jason Merrill <jason@yorick.cygnus.com>
6529
6530 * parse.y (after_type_declarator_intern): New nonterminal.
6531 (after_type_declarator): Use it.
6532 (direct_after_type_declarator): Likewise. Move above
6533 nonnested_type to fix reduce/reduce conflict resolution.
6534 (declmods): Reducing from just 'attributes' has EMPTY precedence.
6535 * Makefile.in (CONFLICTS): Update.
6536
6537 * decl.c (define_label): Downgrade error for jumping over a
6538 non-POD decl to pedwarn.
6539
6540 1999-04-14 Mark Mitchell <mark@codesourcery.com>
6541
6542 * cp-tree.h (popclass): Change declaration.
6543 (pop_nested_class): Likewise.
6544 (poplevel_class): Remove declaration.
6545 * call.c (convert_default_argument): Pass no arguments to
6546 popclass.
6547 * class.c (finish_struct_1): Likewise.
6548 (finish_struct): Likewise.
6549 (popclass): Remove argument. Simplify code accordingly.
6550 (pop_nested_class): Likewise.
6551 * decl.c (poplevel_class): Declare it here, and make it static.
6552 (poplevel): Handle class scopes.
6553 (poplevel_class): Don't take an rgument. Simplify.
6554 (pop_everything): Pass no arguments to pop_nested_class.
6555 (cp_finish_decl): Pass no arguments to popclass.
6556 (grokdeclarator): Pass no arguments to pop_nested_class.
6557 (finish_function): Likewise.
6558 * decl2.c (grokfield): Likewise.
6559 (pop_scope): Pass no arguments to popclass.
6560 * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
6561 * pt.c (instantiate_class_template): Move call to pushclass, and
6562 document. Pass no arguments to popclass.
6563 (regenerate_decl_from_template): Likewise.
6564
6565 1999-04-14 Jason Merrill <jason@yorick.cygnus.com>
6566
6567 * typeck.c (build_unary_op): Handle taking the address of a unique
6568 bound non-static member function.
6569
6570 1999-04-13 Martin von Loewis <loewis@informatik.hu-berlin.de>
6571
6572 * lang-options.h (-Wdeprecated): New flag.
6573 * decl2.c (warn_deprecated): New flag.
6574 (lang_decode_option): Deprecated this-is-variable,
6575 external-templates, alt-external-templates.
6576 Support -Wdeprecated.
6577 * errfn.c (cp_deprecated): New function.
6578
6579 1999-04-13 Jason Merrill <jason@yorick.cygnus.com>
6580
6581 * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
6582 of the decls themselves.
6583
6584 * pt.c (tsubst_function_type): Copy attributes over.
6585
6586 * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority
6587 and com_interface.
6588 * cp-tree.h: Add prototype.
6589 * decl.c (init_decl_processing): Set valid_lang_attribute.
6590
6591 1999-04-13 Mark Mitchell <mark@codesourcery.com>
6592
6593 * class.c (finish_struct_1): Look at the const-ness of the field's
6594 type, not the TREE_READONLY-ness of the declaration.
6595 * method.c (synthesize_method): Likewise.
6596 * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
6597 creating new declarations.
6598
6599 1999-04-13 Mike Stump <mrs@wrs.com>
6600
6601 * decl2.c (import_export_decl): Because vtables always reference
6602 virtual functions, even if they are inlined, don't allow
6603 -fno-implement-inlines to not emit them, instead, emit them with
6604 the vtable.
6605 * decl.c (start_function): Likewise.
6606
6607 1999-04-12 Jason Merrill <jason@yorick.cygnus.com>
6608
6609 * cp-tree.h (struct lang_type): Add com_interface.
6610 (CLASSTYPE_COM_INTERFACE): New macro.
6611 * class.c (set_rtti_entry): COM interface classes have no RTTI
6612 entries in their vtables; adjust.
6613 (add_virtual_function, finish_base_struct, skip_rtti_stuff,
6614 modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
6615 finish_struct_1): Likewise.
6616 * decl2.c (mark_vtable_entries): Likewise.
6617 * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
6618 * search.c (get_abstract_virtuals_1, get_abstract_virtuals,
6619 expand_upcast_fixups): Likewise.
6620 * tree.c (debug_binfo): Likewise.
6621
6622 * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
6623 * typeck.c (comptypes): If we get it, ignore attributes.
6624 * class.c (instantiate_type): Use BASELINK_P. Change complain
6625 parameter to flags; 2 means ignore attributes.
6626 * call.c (build_op_delete_call): Pass it.
6627
6628 * decl.c (xref_tag): Only complain once about using a typedef-name
6629 with 'struct'. Downgrade to pedwarn.
6630
6631 * decl.c (grokdeclarator): Allow [] syntax for zero-length array.
6632
6633 * parse.y (absdcl_intern): New nonterminal.
6634 (absdcl, direct_abstract_declarator): Use it.
6635
6636 * pt.c (lookup_template_class): Look through implict typename.
6637
6638 1999-04-11 Mark Mitchell <mark@codesourcery.com>
6639
6640 * friend.c (add_friend): Deal gracefully with error_mark_node.
6641 * method.c (build_overload_value): Handle pointers-to-members as
6642 template parameters.
6643
6644 * decl.c (push_binding): Fix typo in comment.
6645
6646 1999-04-10 Mark Mitchell <mark@codesourcery.com>
6647
6648 * error.c (dump_type_real): If a typename is a template-id, put
6649 out the template arguments.
6650 (dump_expr): Handle TEMPLATE_ID_EXPR.
6651 * pt.c (lookup_template_class): Now that full arguments are
6652 available everywhere, remove code that tried to guess them.
6653
6654 1999-04-09 Mark Mitchell <mark@codesourcery.com>
6655
6656 * decl.c (make_typename_type): Complain if we don't find a type
6657 when trying to make a typename type for a non-template type.
6658
6659 1999-04-09 Jason Merrill <jason@yorick.cygnus.com>
6660
6661 * decl.c (start_decl): Pass attributes to grokdeclarator.
6662 (grokdeclarator): Handle attributes on constructor-syntax
6663 initializers.
6664
6665 1999-04-08 Mark Mitchell <mark@codesourcery.com>
6666
6667 * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands
6668 don't have types.
6669
6670 * search.c (template_self_reference_p): Tweak.
6671
6672 1999-04-07 Mark Mitchell <mark@codesourcery.com>
6673
6674 * init.c (build_offset_ref): Don't build yet another weird data
6675 structure to describe overloaded functions.
6676
6677 1999-04-06 Mark Mitchell <mark@codesourcery.com>
6678
6679 * cp-tree.h (BASELINK_P): New macro.
6680 (SET_BASELINK_P): Likewise.
6681 * init.c (build_member_call): Remove needless assignment in if
6682 statement.
6683 * search.c (lookup_field_r): Fix handling when we are looking
6684 specifically for a type; these are not hidden by functions and
6685 variables.
6686 (lookup_member): Use SET_BASELINK_P.
6687 * tree.c (is_overloaded_fn): Use BASELINK_P.
6688 (really_overloaed_fn): Likewise.
6689 (get_first_fn): Likewise.
6690
6691 1999-04-05 Mark Mitchell <mark@codesourcery.com>
6692
6693 * decl.c (lookup_name_current_level): Tweak, and improve
6694 documentation.
6695
6696 * class.c (maybe_fixup_vptrs): Remove declaration.
6697 (build_class_init_list): Likewise.
6698 * decl.c (pushdecl_class_level): Call check_template_shadow here
6699 ...
6700 (push_class_level_binding): ... not here.
6701 * search.c (dfs_push_type_decls): Only avoid
6702 template-self-reference TYPE_DECLs if they are from base classes.
6703
6704 1999-04-04 Mark Mitchell <mark@codesourcery.com>
6705
6706 * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL
6707 nodes. Tidy.
6708
6709 1999-04-03 Jason Merrill <jason@yorick.cygnus.com>
6710
6711 * class.c (maybe_fixup_vptrs, build_class_init_list): Lose.
6712 (finish_struct_1): Don't call build_class_init_list.
6713
6714 1999-04-02 Mark Mitchell <mark@codesourcery.com>
6715
6716 * tinfo.h (__class_type_info): Fix illegal declaration.
6717
6718 * cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
6719 * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
6720 (IDENTIFIER_CLASS_VALUE): Improve documentation.
6721 (is_properly_derived_from): Declare.
6722 (invalidate_class_lookup_cache): Likewise.
6723 (maybe_maybe_note_name_used_in_class): Likewise.
6724 (note_name_declared_in_class): Likewise.
6725 (push_using_decl): Remove duplicate declaration.
6726 (id_in_current_class): Remove declaration.
6727 (push_class_binding): Change prototype.
6728 (clear_identitifer_class_values): Declare.
6729 * call.c (is_properly_derived_from): Make it global.
6730 (build_new_function_call): Be careful about updating candidates.
6731 (build_new_method_call): Handle COMPONENT_REFs. Don't crash when
6732 asked to make illegal calls.
6733 * class.c: Include splay-tree.h.
6734 (class_stack_node): Add names_used slot.
6735 (check_member_decl_is_same_in_complete_scope): Remove.
6736 (add_method): Fix comment. Push the declaration into class
6737 scope.
6738 (finish_struct_1): When popping the class, pop the bindings too.
6739 Remove check for data member/function member conflict.
6740 (finish_struct): Remove calls to
6741 check_member_decl_is_same_in_complete_scope. Change calls to
6742 popclass.
6743 (pushclass): Clear names_used in the class stack entry.
6744 Use invalidate_class_lookup_cache to remove cached entries, rather
6745 than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE
6746 before entering a new class. Remove dead code. Don't mess with
6747 current_function_decl when pushing declarations.
6748 (invalidate_class_lookup_cache): New function, split out from ...
6749 (popclass): Here. Clean up names_used on our way out.
6750 (instantiate_type): Adjust.
6751 (build_self_reference): Don't push the declaration here.
6752 (maybe_note_name_used_in_class): New function.
6753 (note_name_declared_in_class): Likewise.
6754 * decl.c (add_binding): Change prototype.
6755 (find_class_binding_level): New function.
6756 (innermost_nonclass_level): Likewise.
6757 (current_binding_level): Update documentation.
6758 (inner_binding_level): Remove. Replace with current_binding_level
6759 throughout.
6760 (push_binding_level): Remove special handling of
6761 class_binding_level.
6762 (pop_binding_level): Likewise. Use find_class_binding_level.
6763 (suspend_binding_level): Likewise.
6764 (global_bindings_p): Use innermost_nonclass_level.
6765 (toplevel_bindings_p): Likewise.
6766 (namespace_bindings_p): Likewise.
6767 (pseudo_global_level_p): Likewise.
6768 (push_binding): Clear INHERITED_VALUE_BINDING_P.
6769 (add_binding): Check for illegal multiple declarations. Return a
6770 value indicating whether or not the new binding was legal.
6771 (push_local_binding): Skip over class binding levels. Check
6772 return value from add_binding.
6773 (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call
6774 note_name_declared_in_class.
6775 (pushlevel_class): Remove "fake out the rest of the compiler"
6776 code.
6777 (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
6778 (clear_identifier_class_values): New function.
6779 (pop_from_top_level): Use it.
6780 (pop_everything): Tweak.
6781 (maybe_process_template_type_declaration): Don't push the
6782 declaration for the template here.
6783 (pushtag): Don't push tag declarations into class scope here.
6784 (pushdecl): Apply DeMorgan's law for readability.
6785 (pushdecl_class_level): Remove special-case code for
6786 TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions.
6787 (push_class_level_bindng): Deal with inherited bindings.
6788 (lookup_name_real): Remove special-case code for
6789 TYPE_BEING_DEFINED, and some implicit typename magic.
6790 (grokdeclarator): Handle COMPONENT_REF for a template function.
6791 (build_enumerator): Don't call pushdecl_class_level here.
6792 (id_in_current_class): Remove.
6793 * decl2.c (grokfield): Don't call pushdecl_class_level or
6794 check_template_shadow.
6795 * errfn.c (cp_file_of): Don't declare.
6796 (cp_line_of): Likewise.
6797 * error.c (dump_decl): Handle an OVERLOAD.
6798 (cp_file_of): Likewise.
6799 (cp_line_of): Likewise.
6800 * init.c (build_member_call): Handle a COMPONENT_REF.
6801 * lex.c (do_identifier): Call maybe_note_name_used_in_class, not
6802 pushdecl_class_level.
6803 * method.c (hack_identifier): Build COMPONENT_REFs for references
6804 to member templates as well as member functions. Remove dead
6805 code.
6806 * parse.y (left_curly): Remove.
6807 (nonnested_type): Call maybe_note_name_used_in_class, not
6808 pushdecl_class_level.
6809 * parse.c: Regenerated.
6810 (nested_name_specifier_1): Likewise.
6811 * pt.c (check_explicit_specialization): Adjust, for robustness.
6812 (check_template_shadow): Handle OVERLOADs.
6813 (build_template_decl): Set DECL_CONSTRUCTOR_P on the
6814 TEMPLATE_DECL, if appropriate.
6815 * search.c (envelope_add_decl): Remove.
6816 (dfs_pushdecls): Likewise.
6817 (dfs_compress_decls): Likewise.
6818 (dfs_push_decls): New function.
6819 (dfs_push_type_decls): Likewise.
6820 (setup_class_bindings): Likewise.
6821 (template_self_reference_p): Likewise.
6822 (lookup_field_r): Use it.
6823 (looup_member): Remove old comment. Deal with ambiguity.
6824 (push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
6825 and remove envelope processing.
6826 * semantics.c (begin_class_definition): Let pushclass push
6827 declarations for base classes.
6828 (finish_member_declaration): Push declarations into class scope.
6829 * typeck.c (build_component_ref): Just put an OVERLOAD into the
6830 COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
6831 (build_x_function_call): Deal with OVERLOAD. Handle template-ids.
6832 * Makefile.in (class.o): Depend on splay-tree.h.
6833
6834 Wed Mar 31 11:30:43 1999 Nathan Sidwell <nathan@acm.org>
6835
6836 * cvt.c (convert_pointer_to_real): Use same_type_p.
6837 * typeck.c (comp_target_types): Use same_type_p.
6838
6839 1999-03-31 Jason Merrill <jason@yorick.cygnus.com>
6840
6841 * semantics.c (begin_inline_definitions,
6842 finish_inline_definitions): Rename from finish_default_args and
6843 begin_inline_definitions, respectively, to something that isn't a
6844 total lie. :)
6845 * parse.y (structsp): Adjust.
6846
6847 * tree.c (hash_tree_cons): Remove obsolete via_* parms.
6848 (list_hash_lookup): Likewise.
6849 (hash_tree_chain): Adjust.
6850 * pt.c (tsubst): Adjust.
6851 (tsubst_arg_types): Use plain hash_tree_cons.
6852 * cp-tree.h (hash_tree_cons_simple): Lose.
6853 * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons.
6854
6855 Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6856
6857 * Makefile.in (hash.h): Generate using gperf language 'C', not
6858 'KR-C', so gperf uses the `const' keyword on strings.
6859
6860 * gxx.gperf (resword): Const-ify a char*.
6861
6862 1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
6863
6864 * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
6865 CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
6866 CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
6867 CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
6868 CLASSTYPE_BINFO_AS_LIST): Remove cruft.
6869 * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
6870 tree.c: Adjust.
6871
6872 1999-03-29 Jason Merrill <jason@yorick.cygnus.com>
6873
6874 * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
6875
6876 1999-03-28 Jason Merrill <jason@yorick.cygnus.com>
6877
6878 * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops.
6879
6880 1999-03-27 Mark Mitchell <mark@codesourcery.com>
6881
6882 * cp-tree.h (add_friend): Declare.
6883 (add_friends): Likewise.
6884 * friend.c (add_friend): Make it global. Don't add to
6885 DECL_BEFRIENDING_CLASSES if the befriending class is a template.
6886 (add_friends): Make it global.
6887 (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
6888 befriending class is a template.
6889 * parse.y (component_decl_1): Fix typo in comment.
6890 * parse.c: Regenerated.
6891 * pt.c (instantiate_class_template): Use add_friend and
6892 add_friends rather that duplicating some of their functionality
6893 here.
6894
6895 1999-03-27 Jason Merrill <jason@yorick.cygnus.com>
6896
6897 * call.c (build_field_call): Unify 'this' and non-'this' cases.
6898
6899 * typeck.c (build_indirect_ref): Check for 'this' sooner.
6900
6901 Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6902
6903 * call.c (op_error): Const-ify a char*.
6904 (add_candidate, source_type, add_warning): Add static prototype.
6905 (print_z_candidates): Const-ify a char*.
6906
6907 * class.c (resolve_address_of_overloaded_function,
6908 fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
6909 (get_vtable_name, finish_struct_1): Const-ify a char*.
6910
6911 * cvt.c (convert_to_reference): Likewise.
6912
6913 * decl.c (redeclaration_error_message, record_builtin_type,
6914 record_unknown_type, member_function_or_else, bad_specifiers):
6915 Likewise.
6916 (find_binding, select_decl, unqualified_namespace_lookup,
6917 lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
6918 Add static prototype.
6919 (warn_extern_redeclared_static, duplicate_decls, pushdecl,
6920 implicitly_declare, record_builtin_java_type, define_function,
6921 grok_op_properties, tag_name): Const-ify a char*.
6922
6923 * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
6924 (define_function, finish_builtin_type): Const-ify a char*.
6925 (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
6926 cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
6927 (file_name_nondirectory): Const-ify a char*.
6928 (init_filename_times): Don't prototype.
6929 (compiler_error): Prototype.
6930 (yyerror, init_repo): Const-ify a char*.
6931 (build_srcloc): Don't prototype.
6932 (build_x_indirect_ref, build_indirect_ref, build_component_addr):
6933 Const-ify a char*.
6934 (warn_for_assignment): Don't prototype.
6935 (convert_for_initialization, readonly_error, check_for_new_type,
6936 GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
6937 Const-ify a char*.
6938
6939 * decl2.c (acceptable_java_type, output_vtable_inherit,
6940 setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
6941 merge_functions, decl_namespace, validate_nonmember_using_decl,
6942 do_nonmember_using_decl): Add static prototype.
6943 (lang_f_options): Const-ify a char*.
6944 (finish_builtin_type): Likewise.
6945 (add_function, arg_assoc_namespace, arg_assoc_class): Add static
6946 prototype.
6947
6948 * errfn.c: Include cp-tree.h.
6949 (cp_thing): Add static prototype.
6950 (compiler_error): Don't protoptype.
6951 (cp_compiler_error): Cast `compiler_error' to `errorfn' before
6952 passing it to `cp_thing'.
6953
6954 * error.c (interesting_scope_p): Add static prototype.
6955
6956 * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
6957 a char*.
6958
6959 * init.c (compiler_error): Don't prototype.
6960 (member_init_ok_or_else): Const-ify a char*.
6961 (build_java_class_ref): Add static prototype.
6962
6963 * lex.c (compiler_error): Don't prototype.
6964 (get_time_identifier, interface_strcmp, extend_token_buffer,
6965 handle_cp_pragma): Const-ify a char*.
6966 (is_global, init_filename_times): Add static prototype.
6967 (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
6968 (compiler_error): Change from fixed args to variable args.
6969 (yyerror): Const-ify a char*.
6970
6971 * parse.y (cond_stmt_keyword): Const-ify a char*.
6972 (parse_decl): Add static prototype.
6973
6974 * pt.c (template_args_equal, print_template_context): Likewise.
6975 (print_candidates, check_default_tmpl_args): Const-ify a char*.
6976 (instantiate_class_template): Likewise.
6977
6978 * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
6979
6980 * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
6981 expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
6982
6983 * search.c (lookup_field_info, lookup_member): Likewise.
6984 (lookup_member): Cast the first argument of `bzero' to a PTR.
6985
6986 * sig.c (compiler_error): Don't prototype.
6987 (build_signature_pointer_or_reference_nam): Const-ify a char*.
6988 (get_sigtable_name, build_member_function_pointer): Likewise.
6989
6990 * tree.c (compiler_error): Don't prototype.
6991 (no_linkage_helper, build_srcloc): Add static prototype.
6992 (build_vbase_pointer_fields): Const-ify a char*.
6993 (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
6994
6995 * typeck.c (compiler_error): Don't prototype.
6996 (convert_for_assignment): Const-ify a char*.
6997 (comp_cv_target_types): Add static prototype.
6998 (build_x_indirect_ref, build_indirect_ref, convert_arguments,
6999 build_component_addr, build_unary_op, convert_for_initialization):
7000 Const-ify a char*.
7001
7002 * typeck2.c (ack): Add static prototype and change from fixed args
7003 to variable args.
7004 (readonly_error, check_for_new_type): Const-ify a char*.
7005
7006 * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
7007 fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
7008 (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'.
7009 (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
7010 gen_assign, GNU_xref_member): Const-ify a char*.
7011
7012 1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
7013
7014 * gxxint.texi: Remove old discussion on copying virtual bases.
7015
7016 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
7017
7018 * Make-lang.in: Remove all references to g++.o/g++.c.
7019 Link g++ from gcc.o.
7020
7021 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
7022
7023 * decl2.c (comdat_linkage): Treat vtables like functions.
7024
7025 1999-03-25 Mark Mitchell <mark@codesourcery.com>
7026
7027 * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES.
7028
7029 1999-03-25 Nathan Sidwell <nathan@acm.org>
7030
7031 * decl.c (init_decl_processing): Add `signed' type as a synonym
7032 for `int'.
7033
7034 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
7035
7036 * typeck.c (common_type): Handle cv-qual unification for pointers
7037 to members.
7038
7039 * decl.c (unqualified_namespace_lookup): Return error_mark_node
7040 on error.
7041 (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
7042 * lex.c (do_identifier): If we got error_mark_node, call
7043 lookup_name again.
7044
7045 1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
7046
7047 * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
7048 classes.
7049
7050 1999-03-24 Jason Merrill <jason@yorick.cygnus.com>
7051
7052 * decl.c (lookup_name_real): Do nested field lookup regardless of
7053 TYPE_BEING_DEFINED.
7054
7055 1999-03-24 Mark Mitchell <mark@codesourcery.com>
7056
7057 * cp-tree.h (lang_type): Remove has_assignment and
7058 has_real_assignment. Add befriending_classes.
7059 (TYPE_HAS_ASSIGNMENT): Remove.
7060 (TYPE_HAS_REAL_ASSIGNMENT): Likewise.
7061 (CLASSTYPE_BEFRIENDING_CLASSES): New macro.
7062 (lang_decl): Document.
7063 (DECL_BEFRIENDING_CLASSES): New macro.
7064 (FRIEND_NAME): Move declaration to more obvious location.
7065 (FRIEND_DECLS): Likewise.
7066 * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
7067 * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
7068 (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
7069 (grok_op_properties): Likewise.
7070 * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
7071 (add_friend): Likewise. Don't do weird things with assignment
7072 operators. Update DECL_BEFRIENDING_CLASSES.
7073 (add_friends): Don't do weird things with assignment operators.
7074 (make_friend_class): Likewise. Update
7075 CLASSTYPE_BEFRIENDING_CLASSES.
7076 * pt.c (instantiate_class_template): Don't set
7077 TYPE_HAS_ASSIGNMENT.
7078 (tsubst_copy): Substitute the TREE_TYPE for more unary
7079 expressions.
7080 * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
7081 * search.c (protected_accessible_p): New function.
7082 (friend_accessible_p): Likewise.
7083 (accessible_p): Use them.
7084
7085 1999-03-23 Mark Mitchell <mark@codesourcery.com>
7086
7087 * pt.c (convert_nontype_argument): Don't create things that aren't
7088 PTRMEM_CSTs when applying a qualification conversion to a
7089 PTRMEM_CST.
7090
7091 1999-03-23 Mark Mitchell <mark@codesourcery.com>
7092
7093 * Makefile.in (OBJS): Don't mention hash.o.
7094 (OBJDEPS): Likewise.
7095
7096 1999-03-23 Jason Merrill <jason@yorick.cygnus.com>
7097
7098 * decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
7099 * decl.c (expand_static_init): Make sure we don't add any after
7100 then.
7101
7102 * decl.c (cp_finish_decl): Move intelligence about handling
7103 DECL_COMDAT for variables from here...
7104 * decl2.c (comdat_linkage): ...to here.
7105 (maybe_make_one_only): Tweak.
7106 (import_export_decl): Call comdat_linkage for variables, too.
7107 (finish_file): Handle template statics properly.
7108
7109 1999-03-22 Mark Mitchell <mark@codesourcery.com>
7110
7111 * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
7112 Document internals of pointer-to-member-functions.
7113 (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
7114 (PFN_FROM_PTRMEMFUNC): Likewise.
7115 (build_type_conversion): Remove unused parameter.
7116 (build_ptrmemfunc1): Declare.
7117 (expand_ptrmemfunc_cst): New function.
7118 (delta2_from_ptrmemfunc): Likewise.
7119 (pfn_from_ptrmemfunc): Likewise.
7120 * cvt.c (cp_convert_to_pointer): Remove unused parameter to
7121 build_type_conversion. Use TYPE_PTRMEM_P for readability.
7122 (convert_to_reference): Remove unused parameter to
7123 build_type_conversion.
7124 (ocp_convert): Likewise.
7125 (build_user_type_conversion): Likewise.
7126 * error.c (dump_expr): Handle NULL pointer-to-member functions.
7127 * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
7128 * method.c (build_overload_value): Don't go splitting CONSTRUCTORs
7129 open when handling pointer-to-member functions.
7130 * pt.c (convert_nontype_argument): Clean up error messages. Be
7131 more stringent with pointers-to-members.
7132 * typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
7133 (build_unary_op): Tidy ever-so-slightly.
7134 (build_conditional_expr): Remove extra parameter to
7135 build_type_conversion.
7136 (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
7137 we're using.
7138 (expand_ptrmemfunc_cst): Define.
7139 (delta2_from_ptrmemfunc): Likewise.
7140 (pfn_from_ptrmemfunc): Likewise.
7141
7142 1999-03-19 Mark Mitchell <mark@codesourcery.com>
7143
7144 * init.c (build_member_call): Handle template-id expressions
7145 correctly.
7146 * typeck.c (build_x_function_call): Likewise.
7147
7148 1999-03-19 Chip Salzenberg <chip@perlsupport.com>
7149
7150 * friend.c (make_friend_class): Avoid core dump when
7151 not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
7152
7153 1999-03-18 Jason Merrill <jason@yorick.cygnus.com>
7154
7155 * decl.c (start_function): Suppress normal linkage heuristics
7156 for #pragma interface under MULTIPLE_SYMBOL_SPACES.
7157
7158 1999-03-19 Alexandre Oliva <oliva@dcc.unicamp.br>
7159
7160 * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c.
7161 ($(srcdir)/cp/parse.c): Moved from ../Makefile.in.
7162
7163 1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de>
7164
7165 * parse.y (named_complex_class_head_sans_basetype):
7166 Do not push a scope for error_mark_node.
7167 (maybe_base_class_list): Likewise.
7168
7169 * decl.c (start_decl): Check for error_mark_node as a type.
7170 Detected by g++.brendan/array-refs.C.
7171 (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C.
7172 (maybe_build_cleanup_1): Likewise. Detected by
7173 g++.jason/incomplete1.C.
7174
7175 * tree.c (build_dummy_object): Use void_zero_node instead of the
7176 error_mark_node.
7177 (is_dummy_object): Check for such a node.
7178 Detected by g++.bob/inherit1.C
7179
7180 1999-03-16 Jason Merrill <jason@yorick.cygnus.com>
7181
7182 * method.c (old_backref_index): Split out...
7183 (flush_repeats): From here. Rename back from try_old_backref.
7184 (build_mangled_name): Put back some old-style repeat handling.
7185
7186 Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7187
7188 * lex.c: Don't include setjmp.h.
7189 (parse_float): New static function.
7190 (pf_args): New struct.
7191 (real_yylex): Use them in call to `do_float_handler'.
7192
7193 1999-03-15 Mark Mitchell <mark@markmitchell.com>
7194
7195 * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
7196 * tree.c (layout_basetypes): Not here.
7197 * search.c (dfs_search): Remove; no longer used.
7198
7199 1999-03-12 Mark Mitchell <mark@markmitchell.com>
7200
7201 * decl2.c (validate_nonmember_using_decl): Issue sensible
7202 error-messages on bogus qualifiers.
7203
7204 1999-03-14 Jason Merrill <jason@yorick.cygnus.com>
7205
7206 * call.c (add_function_candidate): Fix uninitialized variable.
7207
7208 * Makefile.in (search.o): Add dependency on varray.h.
7209
7210 1999-03-13 Jason Merrill <jason@yorick.cygnus.com>
7211
7212 * decl.c (duplicate_decls): Use same_type_p.
7213 * method.c (try_old_backref): Renamed from flush_repeats. Use
7214 same_type_p. Don't try to handle repeats. Return success.
7215 (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support
7216 calls from old-style code, too.
7217 (check_ktype): Use same_type_p.
7218 (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT.
7219 (build_qualified_name): Simplify logic.
7220 (process_overload_item): Strip typedefs and quals at the top.
7221 (build_mangled_name_for_type_with_Gcode): Remove call to
7222 type_canonical_variant.
7223 (build_mangled_name): Likewise. Remove support for old-style
7224 repeats, which have been disabled since 2.7.2. Don't mess with
7225 TREE_USED.
7226 (build_decl_overload_real): Don't mess with TREE_USED.
7227
7228 1999-03-13 Nathan Sidwell <nathan@acm.org>
7229
7230 * error.c (cp_printers): Add 'F' escape character.
7231 (dump_type_real): Remove TREE_LIST (fnargs) printing.
7232 Functionality moved to dump_parameters.
7233 (dump_type_suffix): Use dump_parameters and dump_exception_spec.
7234 (dump_function_decl): Extend meaning of V parameter. Use
7235 dump_parameters and dump_exception_spec.
7236 (dump_parameters): New static function.
7237 (dump_exception_spec): New static function.
7238 (fndecl_as_string): Change argument semantics. Use
7239 dump_function_decl directly.
7240
7241 * sig.c (build_signature_table_constructor): Use cp_error.
7242
7243 1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de>
7244
7245 * semantics.c (finish_switch_cond): Handle error cases gracefully.
7246 Detected by g++.law/enum5.C.
7247
7248 * typeck.c (build_modify_expr): Check for errors after resolving
7249 offsets. Detected by g++.brendan/static1.C.
7250
7251 * decl.c (complete_array_type): Ignore initial_value if it is an
7252 error. Detected by g++.benjamin/17930.C.
7253
7254 * typeck2.c (process_init_constructor): Return error if one argument
7255 is in error. Detected by g++.benjamin/13478.C.
7256
7257 1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
7258
7259 * decl.c (select_decl): Allow class templates when we need types.
7260 * decl2.c (ambiguous_decl): Likewise.
7261
7262 1999-03-12 Mark Mitchell <mark@markmitchell.com>
7263
7264 * lex.c (do_identifier): Correct call to enforce_access.
7265 * search.c (accessible_p): Tweak comment.
7266
7267 1999-03-10 Mark Mitchell <mark@markmitchell.com>
7268
7269 * semantics.c (begin_class_definition): Call build_self_reference.
7270 (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
7271
7272 * search.c (assert_canonical_unmarked): Fix typo in prototype.
7273
7274 * search.c (dfs_canonical_queue): New function.
7275 (dfs_assert_unmarked_p): Likewise.
7276 (assert_canonical_unmarked): Likewise.
7277 (access_in_type): Use it.
7278 (accessible_p): Likewise. Walk the whole tree when umarking.
7279
7280 * sig.c (build_signature_table_constructor): Use accessible_p
7281 instead of compute_access.
7282
7283 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
7284
7285 * call.c (add_builtin_candidates): Handle overloaded conversion ops.
7286
7287 1999-03-09 Mark Mitchell <mark@markmitchell.com>
7288
7289 * cp-tree.h (flag_access_control): Declare.
7290 (TREE_VIA_PPUBLIC): Document.
7291 (DECL_NONSTATIC_MEMBER_P): New macro.
7292 (enforce_access): Return an indication of whether or not access
7293 was permitted.
7294 (build_self_reference): Change prototype.
7295 (compute_access): Replace with ...
7296 (accessible_p): New function.
7297 (dfs_walk): Change prototype.
7298 (dfs_unmark): Likewise.
7299 (markedp): Likewise.
7300 * call.c (enforce_access): Use accessible_p.
7301 * class.c (build_self_reference): Insert the declaration into the
7302 list of members for this type, and make it public.
7303 * decl.c (xref_basetypes): Avoid ill-timed recursion.
7304 * init.c (build_offset_ref): Use lookup_member, not three separate
7305 name-lookups. Call enforce_access rather than checking for
7306 illegal accesses here.
7307 (resolve_offset_ref): Likewise.
7308 * lex.c (do_identifier): Likewise.
7309 * method.c (hack_identifier): Likewise.
7310 * parse.y (self_reference): Remove.
7311 (opt_component_decl_list): Don't use it.
7312 * parse.c: Regenerated.
7313 * pt.c (print_candidates): Generalize to handle lists of
7314 overloaded functions.
7315 (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's
7316 not set.
7317 (get_template_base): Use new calling convention for dfs_walk.
7318 * search.c: Include varray.h. Add prototypes.
7319 (dfs_walk): Accept a data pointer to pass to the work functions.
7320 All callers changed. All work functions changed.
7321 (breadth_first_search): Rename to bfs_walk, and make consistent
7322 with dfs_walk.
7323 (dfs_walk_real): New function.
7324 (canonical_binfo): New function.
7325 (context_for_name_lookup): Likewise.
7326 (shared_marked_p): Likewise.
7327 (shared_unmarked_p): Likewise.
7328 (lokup_field_queue_p): Likewise.
7329 (lookup_field_r): Generalize to handle both functions and fields.
7330 (lookup_field): Just call lookup_member.
7331 (lookup_fnfields): Likewise.
7332 (lookup_member): Move body of lookup_field here and generalize.
7333 (dfs_accessible_queue_p): Likewise.
7334 (dfs_accessible_p): Likewise.
7335 (dfs_access_in_type): Likewise.
7336 (access_in_type): Likewise.
7337 (compute_access): Remove, and replace with ...
7338 (accessible_p): New function.
7339 (vbase_types): Remove.
7340 (vbase_decl_ptr_intermediate): Likewise.
7341 (vbase_decl_ptr): Likewise.
7342 (vbase_init_result): Likewise.
7343 (closed_envelopes): Likewise.
7344 (bvtable): Likewise.
7345
7346 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
7347
7348 * call.c (add_function_candidate): Check for proper number of args
7349 before checking the validity of those args.
7350
7351 1999-03-06 Jason Merrill <jason@yorick.cygnus.com>
7352
7353 * cp-tree.h (struct lang_type): Add anon_union field.
7354 (ANON_UNION_TYPE_P): Use it instead of examining type.
7355 (SET_ANON_UNION_TYPE_P): New macro.
7356 * decl.c (check_tag_decl): Use it.
7357
7358 * search.c (compute_access): Handle non-type contexts earlier, and
7359 handle NULL_TREE.
7360
7361 * tree.c (build_exception_variant): Use copy_to_permanent.
7362
7363 * decl2.c (setup_initp): Give statics with no priority the default
7364 priority here.
7365 (do_dtors, do_ctors, finish_file): Remove special handling of
7366 non-prioritized statics.
7367
7368 1999-03-05 Mark Mitchell <mark@markmitchell.com>
7369
7370 * cp-tree.h (ANON_UNION_TYPE_P): Robustify.
7371 * decl.c (make_typename_type): Don't issue an error if an
7372 immediate lookup fails; it migt be resolved later.
7373 * friend.c (is_friend): Add comment.
7374 * search.c (breadth_first_search): Add POSTFN and DATA
7375 parameters. Tidy. All callers changed.
7376 (lookup_field_queue_p): New function.
7377 (lookup_field_r): Likewise.
7378 (lookup_field_post): Likewise.
7379 (lookup_field): Use them, via breadth_first_search, instead of
7380 duplicating logic.
7381 (compute_access): Robustify.
7382 (lookup_fnfield_info): New structure.
7383
7384 1999-03-05 Jason Merrill <jason@yorick.cygnus.com>
7385
7386 * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again.
7387
7388 1999-03-03 Jason Merrill <jason@yorick.cygnus.com>
7389
7390 * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
7391 cc happy.
7392
7393 * decl2.c (import_export_class): Also return if
7394 CLASSTYPE_INTERFACE_ONLY is set.
7395
7396 1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de>
7397
7398 * decl.c (push_overloaded_decl): Only overwrite the old binding if
7399 there was one.
7400 * decl2.c (do_local_using_decl): Fix loop termination.
7401
7402 1999-03-02 Mark Mitchell <mark@markmitchell.com>
7403
7404 * cp-tree.h (determine_specialization): Don't declare.
7405 * pt.c (determine_specialization): Make it static. Eliminate
7406 complain parameter. Note that decl is always non-NULL now, and
7407 simplify accordingly.
7408
7409 * decl.c (maybe_push_to_top_level): Always call
7410 push_cp_function_context.
7411 (pop_from_top_level): Always call pop_cp_function_context.
7412
7413 1999-02-26 Nathan Sidwell <nathan@acm.org>
7414
7415 * typeck.c (complete_type_or_else): Add VALUE arg, for helpful
7416 diagnostics.
7417 * cp-tree.h (complete_type_or_else): Added VALUE parameter.
7418 * init.c (build_new_1): Extra arg to complete_type_or_else.
7419 (build_delete): Likewise.
7420 * typeck.c (require_complete_type): Likewise.
7421 (pointer_int_sum): Likewise.
7422 (pointer_diff): Likewise.
7423 (build_component_ref): Likewise.
7424
7425 * typeck2.c (incomplete_type_error): Always use cp_error.
7426 Show declaration of undefined type, if appropriate.
7427 Deal with UNKNOWN_TYPE nodes.
7428
7429 * typeck.c (require_complete_type): Use TYPE_SIZE as
7430 size_zero_node to mean incomplete type.
7431 (require_complete_type_in_void): New function.
7432 (build_compound_expr): Call complete_type_in_void for LHS.
7433 (build_c_cast): Call complete_type_in_void for void cast.
7434 * cvt.c (ocp_convert): Call complete_type_in_void for void cast.
7435 * decl.c (cplus_expand_expr_stmt): Void expression checks moved to
7436 require_complete_type_in_void. Call it.
7437 * cp-tree.h (require_complete_type_in_void): Prototype new function.
7438
7439 * typeck.c (convert_arguments): Use alternative format for
7440 function decls. Don't require_complete_type here. Simplify
7441 diagnostic printing.
7442 (convert_for_initialization): Don't require_complete_type on RHS yet.
7443 * call.c (convert_arg_to_ellipsis): Call require_complete_type.
7444
7445 * call.c (build_over_call): Cope with qualified void return type.
7446 * semantics.c (finish_call_expr): Likewise.
7447 * typeck.c (build_function_call_real): Likewise.
7448 (c_expand_return): Likewise.
7449 * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
7450
7451 * call.c (print_z_candidates): Use alternate print format, to be
7452 consistent with (pt.c) print_candidates.
7453 * method.c (hack_identifier): List candidate members.
7454 * search.c (lookup_field): Build ambiguous list, and show it, if
7455 ambiguous.
7456
7457 1999-02-26 Mark Mitchell <mark@markmitchell.com>
7458
7459 * typeck.c (decay_conversion): Don't confuse constant array
7460 variables with their initializers.
7461
7462 * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when
7463 merging decls.
7464 * pt.c (regenerate_decl_from_template): Tweak for clarity.
7465 (instantiate_decl): Mark a decl instantiated before regenerating
7466 it to avoid recursion.
7467 * tree.c (mapcar): Don't call decl_constant_value unless we know
7468 something is TREE_READONLY_DECL_P.
7469
7470 * class.c (check_for_override): Don't stop checking when we find
7471 the first overridden function. Delete #if 0'd code.
7472 * search.c (get_matching_virtual): Likewise.
7473
7474 1999-02-25 Richard Henderson <rth@cygnus.com>
7475
7476 * lang-specs.h: Define __FAST_MATH__ when appropriate.
7477
7478 1999-02-24 Mike Stump <mrs@wrs.com>
7479
7480 * typeck.c (convert_for_assignment): Allow boolean integral constant
7481 expressions to convert to null pointer.
7482
7483 1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
7484
7485 * decl.c (lookup_namespace_name): Resolve namespace aliases.
7486
7487 * class.c (push_nested_class): Allow namespaces.
7488
7489 * decl2.c (set_decl_namespace): Add friendp parameter.
7490 * decl.c (grokfndecl): Pass it.
7491 (grokvardecl): Likewise.
7492 * cp-tree.h: Change declaration.
7493
7494 1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
7495
7496 * pt.c (tsubst): Allow an array of explicit size zero.
7497
7498 1999-02-23 Jason Merrill <jason@yorick.cygnus.com>
7499
7500 * errfn.c: Change varargs code to look like toplev.c.
7501
7502 * method.c (process_modifiers): Don't prepend 'U' for char or
7503 wchar_t.
7504
7505 1999-02-20 Craig Burley <craig@jcb-sc.com>
7506
7507 * Make-lang.in (cplib2.ready): Don't consider updating
7508 cplib2 stuff if the current directory isn't writable, as
7509 it won't work (such as during a `make install').
7510
7511 Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
7512
7513 * decl2.c (start_objects): Make file scope constructors and
7514 destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
7515 ASM_OUTPUT_DESTRUCTOR are defined.
7516
7517 1999-02-19 Mark Mitchell <mark@markmitchell.com>
7518
7519 * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
7520 (fn_type_unification): Adjust prototype.
7521 (lookup_fnfields_1): Declare.
7522 * call.c (add_template_candidate_real): Adjust call to
7523 fn_type_unification.
7524 * class.c (add_method): Don't allow duplicate declarations of
7525 constructors or destructors.
7526 (resolve_address_of_overloaded_function): Remove unused variable.
7527 Adjust call to fn_type_unification.
7528 * decl.c (grokfndecl): Be more robust in the face of illegal
7529 specializations.
7530 * decl2.c (check_classfn): Remove hokey handling of member
7531 templates.
7532 * pt.c (determine_specialization): Improve comments. Adjust to
7533 handle template argument deduction as per the standard.
7534 (check_explicit_specialization): Fix comment spacing. Handle
7535 type-conversion operators correctly. Improve error-recovery.
7536 (fn_type_unification): Remove EXTRA_FN_ARG parameter.
7537 (get_bindings_real): Simplify handling of static members.
7538 * search.c (lookup_fnfields_1): Make it have external linkage.
7539 * typeck.c (compparms): Fix comment.
7540 (build_unary_op): Don't try to figure out which template
7541 specialization is being referred to when when the address-of
7542 operator is used with a template function.
7543
7544 Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7545
7546 * cp-tree.h (lvalue_or_else): Qualify a char* with the `const'
7547 keyword to match an analogous change at the top level.
7548
7549 * tree.c (lvalue_or_else): Likewise.
7550
7551 1999-02-17 Mark Mitchell <mark@markmitchell.com>
7552
7553 * decl.c (xref_basetypes): Comment.
7554 * pt.c (instantiate_class_template): Use xref_basetypes.
7555
7556 1999-02-16 Mark Mitchell <mark@markmitchell.com>
7557
7558 * cp-tree.h (tsubst): Change prototype.
7559 (tsubst_expr): Likewise.
7560 (tsubst_copy): Likewise.
7561 (type_unification): Remove prototype.
7562 * call.c (convert_default_arg): Adjust call to tsubst_expr.
7563 * class.c (resolve_address_of_overloaded_function): Just use
7564 fn_type_unification.
7565 * decl.c (grokdeclarator): Adjust call to tsubst.
7566 * method.c (build_template_parm_names): Likewise.
7567 * pt.c (GTB_VIA_VIRTUAL): New macro.
7568 (GTB_IGNORE_TYPE): Likewise.
7569 (resolve_overloaded_unification): Add `complain' parameter.
7570 (try_one_overload): Likewise.
7571 (tsubst_template_arg_vector): Likewise.
7572 (tsubst_template_parms): Likewise.
7573 (tsubst_aggr_type): Likewise.
7574 (tsubst_arg_types): Likewise.
7575 (tsubst_call_declarator_parms): Likewise.
7576 (unify): Remove explicit_mask.
7577 (type_unification_real): Likewise.
7578 (get_template_base_recursive): Likewise.
7579 (coerce_template_template_parms): Provide prototype.
7580 (tsubst_function_type): Likewise.
7581 (try_class_unification): New function.
7582 All callers changed to use new complain parameter.
7583 (get_template_base): Use try_class_unification.
7584 (unify): Adjust handling of classes derived from template types.
7585 (fn_type_unification): Substitute explicit arguments before
7586 unification.
7587
7588 1999-02-16 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
7589
7590 * decl.c (pushdecl): Remove dead code.
7591
7592 1999-02-16 Jason Merrill <jason@yorick.cygnus.com>
7593
7594 * decl2.c (finish_objects): Fix code I missed in previous change.
7595
7596 1999-02-13 Jason Merrill <jason@yorick.cygnus.com>
7597
7598 * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
7599 (grokdeclarator): Don't expect error_mark_node from grokfndecl.
7600
7601 * pt.c (maybe_process_partial_specialization): Complain about
7602 'template <>' on non-specialization.
7603
7604 1999-02-10 Jason Merrill <jason@yorick.cygnus.com>
7605
7606 * decl.c (grokdeclarator): Catch wierd declarators.
7607 * decl2.c (finish_file): Don't abort because of namespace parsing
7608 failure.
7609 (check_decl_namespace): Remove.
7610
7611 1999-02-09 Mark Mitchell <mark@markmitchell.com>
7612
7613 * cp-tree.h (get_template_base): Don't declare.
7614 (dfs_walk): Declare.
7615 (dfs_unmark): Likewise.
7616 (markedp): Likewise.
7617 * pt.c (unify): Remove duplicate declaration. Pass tparms and
7618 targs to get_template_base.
7619 (get_template_base_recursive): Move here from search.c. Check to
7620 see that the base found can be instantiated to form the desired
7621 type.
7622 (get_template_base): Likewise.
7623 (get_class_bindings): Simplify.
7624 * search.c (get_template_base_recursive): Move to pt.c.
7625 (get_template_base): Likewise.
7626 (markedp): Make it global.
7627 (dfs_walk): Likewise.
7628 (dfs_unmark): Likewise.
7629
7630 1999-02-07 Jason Merrill <jason@yorick.cygnus.com>
7631
7632 * pt.c (maybe_process_partial_specialization): Complain about
7633 specialization in wrong namespace.
7634 * tree.c (decl_namespace_context): New fn.
7635
7636 1999-02-06 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
7637
7638 * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
7639 * pt.c (coerce_template_template_parms): Handle nested
7640 template template parameters.
7641
7642 Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com)
7643
7644 * typeck2.c: Update email addresses.
7645
7646 1999-02-04 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
7647
7648 * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag
7649 turned off.
7650
7651 1999-02-04 Jason Merrill <jason@yorick.cygnus.com>
7652
7653 * lex.c (retrofit_lang_decl): Split out...
7654 (build_lang_decl): From here.
7655 * decl.c (pushdecl): Call it for functions generated by the middle
7656 end that don't have DECL_LANG_SPECIFIC.
7657 * cp-tree.h: Declare it.
7658
7659 * decl2.c: Remove flag_init_priority. Always enable initp stuff.
7660 (start_objects, finish_objects): Only use special
7661 init_priority code if the user specified a priority.
7662 (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
7663 objects.
7664
7665 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
7666
7667 * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and
7668 mkstemp.o. Get them from libiberty now.
7669 (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o.
7670
7671 Tue Feb 2 22:38:48 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
7672
7673 * decl2.c (lang_decode_option): Use read_integral_parameter.
7674
7675 1999-02-01 Mark Mitchell <mark@markmitchell.com>
7676
7677 * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
7678 before calling complete_type_or_else.
7679
7680 Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7681
7682 * input.c (inline): Don't define, its handled by system.h.
7683
7684 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
7685
7686 * decl2.c: Don't define flag_no_ident here. Don't process
7687 -f(no-)ident here.
7688 * cp-tree.h: Don't declare flag_no_ident here.
7689 * lang-specs.h: Map -Qn to -fno-ident.
7690
7691 1999-01-28 Jason Merrill <jason@yorick.cygnus.com>
7692
7693 * cp-tree.h (struct tree_binding): Replace scope field with a union.
7694 (BINDING_SCOPE): Adjust.
7695 * decl.c (BINDING_LEVEL): Adjust.
7696
7697 1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
7698
7699 * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
7700 member constants.
7701
7702 * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
7703 a ctor initializer.
7704
7705 * tree.c (equal_functions): Fix name in prototype.
7706
7707 * decl.c (push_local_binding): Add FLAGS argument.
7708 (pushdecl, push_overloaded_decl): Pass it.
7709 * decl2.c (do_local_using_decl): Likewise.
7710 * cp-tree.h: Adjust prototype.
7711 * decl.c (poplevel): Fix logic.
7712
7713 * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
7714 (poplevel): Handle that. Fix logic for removing TREE_LISTs.
7715 (cat_namespace_levels): Don't loop forever.
7716
7717 1999-01-25 Richard Henderson <rth@cygnus.com>
7718
7719 * typeck.c (build_reinterpret_cast): Fix typo in duplicated test.
7720
7721 1999-01-25 Jason Merrill <jason@yorick.cygnus.com>
7722
7723 * class.c (resolve_address_of_overloaded_function): Mark the
7724 chosen function used.
7725
7726 * call.c (build_call): Make sure that a function coming in has
7727 been marked used already.
7728 * decl.c (expand_static_init): Call mark_used instead of
7729 assemble_external.
7730 * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
7731 alloc_eh_object, expand_throw): Likewise.
7732 * init.c (build_builtin_delete_call): Likewise.
7733 * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
7734 expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
7735 expand_generic_desc): Likewise.
7736
7737 1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
7738
7739 * tree.c (equal_functions): New function.
7740 (ovl_member): Call it.
7741
7742 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
7743
7744 * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf.
7745
7746 1999-01-25 Martin von Loewis <loewis@informatik.hu-berlin.de>
7747
7748 * decl.c (decls_match): Return 1 if old and new are identical.
7749 (push_overloaded_decl): Set OVL_USED when PUSH_USING.
7750
7751 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
7752
7753 * decl.c (start_function): Make member functions one_only on windows.
7754 * decl2.c (import_export_decl): Likewise.
7755
7756 * decl.c (grokdeclarator): Don't complain about implicit int in
7757 a system header. Change same-name field check to not complain in
7758 a system header instead of within extern "C".
7759
7760 1999-01-21 Mark Mitchell <mark@markmitchell.com>
7761
7762 * cp-tree.h (PUSH_GLOBAL): New macro.
7763 (PUSH_LOCAL): Likewise.
7764 (PUSH_USING): Likewise.
7765 (namespace_bindings_p): Declare.
7766 (push_overloaded_decl): Likewise.
7767 * decl.c (push_overloaded_decl): Don't make it static. Check for
7768 illegal declarations after using declarations here.
7769 (namespace_bindings_p): Likewise.
7770 (duplicate_decls): Don't consider declarations from different
7771 namespaces to be the same.
7772 (pushdecl): Use symbolic PUSH_ constants in calls to
7773 push_overloaded_decl.
7774 (push_overloaded_decl_1): Likewise.
7775 * decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
7776 (do_nonmember_using_decl): Check for illegal using declarations
7777 after ordinary declarations here.
7778 (do_local_using_decl): Call pushdecl to insert declarations.
7779
7780 1999-01-21 Jason Merrill <jason@yorick.cygnus.com>
7781
7782 * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo.
7783
7784 1999-01-21 Mark Mitchell <mark@markmitchell.com>
7785
7786 * tree.c (build_cplus_array_type_1): Don't call build_array_type
7787 for types involving template parameters.
7788
7789 * cp-tree.h (PARM_DECL_EXPR): Delete.
7790 (convert_default_arg): Change prototype.
7791 (check_default_argument): Declare.
7792 (search_tree): Likewise.
7793 * call.c (convert_default_arg): Take the function to which the
7794 default argument belongs as a parameter, and do any necessary
7795 instantiation here, instead of ...
7796 (build_over_call): Here.
7797 * decl.c (local_variable_p): New function.
7798 (check_default_argument): Likewise, split out and tidied from ...
7799 (grokparms): Here.
7800 * error.c (dump_expr): Don't set PARM_DECL_EXPR.
7801 * pt.c (tsubst_call_declarator_parms): New function.
7802 (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing
7803 with CALL_EXPRs, rather than trying to be clever.
7804 (tsubst): Use tsubst_call_declarator_parms.
7805 * tree.c (search_tree): Don't make it static.
7806 * typeck.c (convert_arguments): Use new interface to
7807 convert_default_arg.
7808
7809 1999-01-20 Mark Mitchell <mark@markmitchell.com>
7810
7811 * error.c (dump_function_decl): Don't print the argument types for
7812 a function when the verbosity level is negative.
7813
7814 * call.c (build_over_call): Check format attributes at call-time.
7815
7816 * pt.c (tsubst_copy): Fix comment.
7817 (unify): Don't allow unification with variable-sized arrays.
7818
7819 * semantics.c (finish_stmt_expr): When processing a template make
7820 the BIND_EXPR long-lived.
7821
7822 1999-01-19 Jason Merrill <jason@yorick.cygnus.com>
7823
7824 * decl2.c (finish_vtable_vardecl): Make vtables comdat here.
7825 (import_export_vtable): Not here.
7826
7827 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
7828
7829 * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique
7830 non-static member function.
7831
7832 1999-01-18 Nathan Sidwell <nathan@acm.org>
7833
7834 * class.c (instantiate_type): Only diagnose illegal address of member
7835 function if complaining.
7836
7837 * decl.c (lookup_name_real): Remove duplicate code.
7838
7839 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
7840
7841 * tree.c (copy_template_template_parm): Use permanent_obstack.
7842
7843 1999-01-18 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
7844
7845 * pt.c (unify): Remove restrictions on deduction of argument
7846 of template template parameters.
7847
7848 1999-01-18 Nathan Sidwell <nathan@acm.org>
7849
7850 * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
7851
7852 * class.c (resolve_address_of_overloaded_function): Show list of
7853 all candidates, when none of them match.
7854
7855 1999-01-18 Chip Salzenberg <chip@perlsupport.com>
7856
7857 * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
7858 definition of 'casting away const' in reinterpret_cast<>.
7859
7860 1999-01-18 Graham <grahams@rcp.co.uk>
7861
7862 * cvt.c: Add include for decl.h, remove extern for
7863 static_aggregates which is now provided by decl.h.
7864
7865 * Makefile.in (cvt.o): Add dependency for decl.h and missing
7866 dependencies for convert.h and flags.h.
7867
7868 1999-01-18 Nathan Sidwell <nathan@acm.org>
7869
7870 * decl2.c (do_dtors): Set current location to that of the
7871 decl, for sensible diagnostics and debugging.
7872 (check_classfn): Issue `incomplete type' error, if
7873 class is not defined.
7874
7875 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
7876
7877 * cp-tree.h: Add prototype for bound_pmf_p.
7878
7879 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
7880 Manfred Hollstein <manfred@s-direktnet.de>
7881
7882 * decl.c (grokdeclarator): Don't make 'main(){}' an error with only
7883 -Wreturn-type.
7884
7885 1999-01-16 Nathan Sidwell <nathan@acm.org>
7886
7887 * cp-tree.h (struct lang_type): Added has_mutable flag.
7888 (CLASSTYPE_HAS_MUTABLE): New macro to access it.
7889 (TYPE_HAS_MUTABLE_P): New macro to read it.
7890 (cp_has_mutable_p): Prototype for new function.
7891 * class.c (finish_struct_1): Set has_mutable from members.
7892 * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if
7893 it contains a mutable.
7894 * typeck.c (cp_has_mutable_p): New function.
7895
7896 1999-01-15 Mark Mitchell <mark@markmitchell.com>
7897
7898 * pt.c (process_template_parm): Ignore top-level qualifiers on
7899 non-type parameters.
7900
7901 * decl.c (start_function): Use current_function_parms in the call
7902 to require_complete_type_for_parms, not the probably empty
7903 DECL_ARGUMENTS.
7904
7905 1999-01-14 Jason Merrill <jason@yorick.cygnus.com>
7906
7907 * semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
7908
7909 * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
7910 that we don't suppress the other copies.
7911 * lex.c (handle_cp_pragma): Likewise.
7912
7913 1999-01-13 Mark Mitchell <mark@markmitchell.com>
7914
7915 * decl.c (grokdeclarator): Undo 1998-12-14 change.
7916 * tree.c (build_cplus_array_type_1): Likewise.
7917 * pt.c (instantiate_class_template): Remove misleading comment.
7918 (tsubst_aggr_type): Substitute if there are template parameters,
7919 regardless of whether or not they use template arguments.
7920 (unify): Likewise, but for unification.
7921
7922 1999-01-12 Richard Henderson <rth@cygnus.com>
7923
7924 * cp-tree.h (flag_permissive): Declare extern.
7925
7926 1999-01-06 Mark Mitchell <mark@markmitchell.com>
7927
7928 * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT
7929 here.
7930 (lang_type): Add is_partial_instantiation. Decrease width of
7931 dummy.
7932 (PARTIAL_INSTANTIATION_P): New macro.
7933 (OPERATOR_TYPENAME_P): Remove.
7934 * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not
7935 OPERATOR_TYPENAME_P.
7936 (grok_op_properties): Likewise.
7937 * friend.c (do_friend): Handle friends that are member functions
7938 correctly.
7939 * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT.
7940 * pt.c (instantiate_class_template): Rework for clarity. Avoid
7941 leaving TYPE_BEING_DEFINED set in obscure cases. Don't do
7942 any more partial instantiation than is absolutely necessary for
7943 implicit typename. Set PARTIAL_INSTANTIATION_P.
7944 (tsubst_decl): Use IDENTIFIER_TYPENAME_P.
7945 * semantics.c (begin_class_definition): Handle partial
7946 specializations of a type that was previously partially
7947 instantiated.
7948
7949 Wed Jan 6 03:18:53 1999 Mark Elbrecht <snowball3@usa.net.
7950
7951 * g++spec.c (LIBSTDCXX): Provide default definition.
7952 (lang_specific_driver): Use LIBSTDCXX instead of "-lstdc++".
7953
7954 Tue Jan 5 22:11:25 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7955
7956 * Make-lang.in (g++.o): Depend on prefix.h.
7957
7958 1999-01-04 Jason Merrill <jason@yorick.cygnus.com>
7959
7960 * tree.c (bound_pmf_p): New fn.
7961 * typeck.c (build_c_cast): Use it.
7962
7963 * decl.c (grok_op_properties): Use same_type_p.
7964
7965 Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7966
7967 * Makefile.in (cvt.o): Depend on toplev.h.
7968
7969 * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes.
7970
7971 * cvt.c: Include toplev.h.
7972
7973 * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and
7974 definitions.
7975
7976 * init.c (expand_vec_init): Initialize variable `itype'.
7977
7978 * lex.c (yyerror): Cast the argument passed to a ctype function to
7979 an unsigned char.
7980
7981 * method.c (build_mangled_C9x_name): Wrap prototype and definition
7982 in "HOST_BITS_PER_WIDE_INT >= 64".
7983
7984 * typeck.c (build_binary_op): Mark parameter `convert_p' with
7985 ATTRIBUTE_UNUSED.
7986
7987 1998-12-22 Mark Mitchell <mark@markmitchell.com>
7988
7989 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
7990 * tree.c (build_exception_variant): Don't crash on empty throw
7991 specs.
7992
7993 1998-12-18 DJ Delorie <dj@cygnus.com>
7994
7995 * cvt.c (convert_to_reference): Check for both error_mark_node
7996 and NULL_NODE after call to convert_for_initialization.
7997
7998 1998-12-17 Jason Merrill <jason@yorick.cygnus.com>
7999
8000 * error.c (interesting_scope_p): New fn.
8001 (dump_simple_decl): Use it.
8002 (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
8003 (dump_expr, case OFFSET_REF): Print ->* if appropriate.
8004
8005 1998-12-16 Mark Mitchell <mark@markmitchell.com>
8006
8007 * class.c (resolve_address_of_overloaded_function): Do conversion
8008 to correct type here, rather than ...
8009 (instantiate_type): Here.
8010
8011 * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
8012 (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
8013 (decl_template_parm_p): Remove.
8014 * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
8015 parameter.
8016 * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
8017 * pt.c (push_inline_template_parms_recursive): Set it.
8018 (decl_template_parm_p): Remove.
8019 (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
8020 (process_template_parm): Set it.
8021
8022 Wed Dec 16 16:33:58 1998 Dave Brolley <brolley@cygnus.com>
8023
8024 * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
8025 if configured with cpplib.
8026
8027 1998-12-15 Mark Mitchell <mark@markmitchell.com>
8028
8029 * decl.c (poplevel): Make sure ns_binding is initialized.
8030
8031 * decl.c (finish_function): Undo inadvertent change in previous
8032 patch.
8033
8034 1998-12-14 Mark Mitchell <mark@markmitchell.com>
8035
8036 * class.c (pushclass): Tweak handling of class-level bindings.
8037 (resolve_address_of_overloaded_function): Update pointer-to-member
8038 handling.
8039 (instantiate_type): Likewise.
8040 * cvt.c (cp_convert_to_pointer): Likewise.
8041 * decl.c (pop_binding): Take the DECL to pop, not just the name.
8042 Deal with `struct stat' hack.
8043 (binding_level): Add to documentation.
8044 (push_binding): Clear BINDING_TYPE.
8045 (add_binding): New function.
8046 (push_local_binding): Use it.
8047 (push_class_binding): Likewise.
8048 (poplevel): Adjust calls to pop_binding.
8049 (poplevel_class): Likewise.
8050 (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
8051 declarations to current binding level.
8052 (push_class_level_binding): Likewise.
8053 (push_overloaded_decl): Adjust handling of OVERLOADs in local
8054 bindings.
8055 (lookup_namespace_name): Don't crash when confronted with a
8056 TEMPLATE_DECL.
8057 (lookup_name_real): Do `struct stat' hack in local binding
8058 contexts.
8059 (build_ptrmemfunc_type): Adjust documentation.
8060 (grokdeclarator): Don't avoid building real array types when
8061 processing templates unless really necessary.
8062 (finish_method): Adjust calls to pop_binding.
8063 * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
8064 not reparse_decl_as_expr.
8065 (build_expr_from_tree): Deal with a template-id as the function to
8066 call in a METHOD_CALL_EXPR.
8067 * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
8068 (maybe_adjust_types_For_deduction): Don't do peculiar things with
8069 METHOD_TYPEs here.
8070 (resolve_overloaded_unification): Handle COMPONENT_REFs. Build
8071 pointer-to-member types where necessary.
8072 * tree.c (build_cplus_array_type_1): Don't avoid building real
8073 array types when processing templates unless really necessary.
8074 (build_exception_variant): Compare the exception lists correctly.
8075
8076 1998-12-13 Mark Mitchell <mark@markmitchell.com>
8077
8078 * cp-tree.def (CPLUS_BINDING): Update documentation.
8079 * cp-tree.h (LOCAL_BINDING_P): New macro.
8080 (lang_identifier): Rename local_value to bindings.
8081 (tree_binding): Make `scope' of type `void*', not `tree'.
8082 (BINDING_SCOPE): Update documentation.
8083 (IDENTIFIER_LOCAL_VALUE): Remove.
8084 (IDENTIFIER_CLASS_VALUE): Document.
8085 (IDENTIFIER_BINDING): New macro.
8086 (IDENTIFIER_VALUE): Likewise.
8087 (TIME_IDENTIFIER_TIME): Likewise.
8088 (TIME_IDENTIFIER_FILEINFO): Likewise.
8089 (IMPLICIT_TYPENAME_P): Likewise.
8090 (set_identifier_local_value): Remove.
8091 (push_local_binding): New function.
8092 (push_class_binding): Likewise.
8093 * class.c (pushclass): Update comments; use push_class_binding.
8094 * decl.c (set_identifier_local_value_with_scope): Remove.
8095 (set_identifier_local_value): Likewise.
8096 (push_binding): New function.
8097 (pop_binding): Likewise.
8098 (binding_level): Update documentation. Remove shadowed.
8099 (BINDING_LEVEL): New macro.
8100 (free_binding_nodes): New variable.
8101 (poplevel): Adjust for new name-lookup scheme. Don't mess up
8102 BLOCK_VARs when doing for-scope extension. Remove effectively
8103 dead code.
8104 (pushlevel_class): Tweak formatting.
8105 (poplevel_class): Adjust for new name-lookup scheme.
8106 (print_binding_level): Likewise.
8107 (store_bindings): Likewise.
8108 (pushdecl): Likewise.
8109 (pushdecl_class_level): Likewise.
8110 (push_class_level_binding): Likewise.
8111 (push_overloaded_decl): Update comments. Adjust for new
8112 name-lookup scheme.
8113 (lookup_name_real): Likewise.
8114 (lookup_name_current_level): Likewise.
8115 (cp_finish_decl): Likewise.
8116 (require_complete_types_for_parms): Likewise. Remove misleading
8117 #if 0'd code.
8118 (grok_parms): Likewise. Don't call
8119 require_complete_types_for_parms here.
8120 (grok_ctor_properties): Don't treat templates as copy
8121 constructors.
8122 (grop_op_properties): Or as assignment operators.
8123 (start_function): Document. Adjust for new name-lookup scheme.
8124 (finish_function): Likewise.
8125 * decl2.c (do_local_using_decl): Use push_local_binding.
8126 * lex.c (begin_definition_of_inclass_inline): New function, split
8127 out from ...
8128 (do_pending_inlines): Here, and ...
8129 (process_next_inline): Here.
8130 (get_time_identifier): Use TIME_IDENTIFIER_* macros.
8131 (init_filename_times): Likewise.
8132 (extract_interface_info): Likewise.
8133 (ste_typedecl_interface_info): Likewise.
8134 (check_newline): Likewise.
8135 (dump_time_statistics): Likewise.
8136 (handle_cp_pragma): Likewise.
8137 (do_identifier): Adjust for new name-lookup scheme.
8138 * parse.y (function_try_block): Return ctor_initializer_opt value.
8139 (fndef): Use it.
8140 (fn.defpen): Pass appropriate values to start_function.
8141 (pending_inline): Use functor_try_block value, and pass
8142 appropriate values to finish_function.
8143 * pt.c (is_member_template): Update documentation; remove handling
8144 of FUNCTION_DECLs. As per name, this function should deal only in
8145 TEMPLATE_DECLs.
8146 (decl_template_parm_p): Change name of olddecl parameter to decl.
8147 (check_template_shadow): Adjust for new name-lookup scheme.
8148 (lookup_template_class): Likewise.
8149 (tsubst_decl): Tweak so as not to confuse member templates with
8150 copy constructors and assignment operators.
8151 (unify): Handle UNION_TYPEs.
8152 * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
8153 (lang_print_xnode): Adjust for new name-lookup scheme.
8154 * typeck.c (mark_addressable): Likewise.
8155 (c_expand_return): Likewise.
8156
8157 1998-12-08 Jason Merrill <jason@yorick.cygnus.com>
8158
8159 * decl.c (grokdeclarator): Allow field with same name as class
8160 in extern "C".
8161
8162 * decl.c (lookup_name_real): Don't limit field lookup to types.
8163 * class.c (check_member_decl_is_same_in_complete_scope): No error
8164 if icv and x are the same.
8165 * lex.c (do_identifier): Tweak error message.
8166
8167 1998-12-10 Mark Mitchell <mark@markmitchell.com>
8168
8169 * decl.c (start_enum): Use push_obstacks, not
8170 end_temporary_allocation.
8171 (finish_enum): Call pop_obstacks.
8172
8173 1998-12-10 Mark Mitchell <mark@markmitchell.com>
8174
8175 * class.c (instantiate_type): Return error_mark_node rather than
8176 junk.
8177
8178 1998-12-09 Mark Mitchell <mark@markmitchell.com>
8179
8180 * cp-tree.h (most_specialized_instantiation): New function.
8181 (print_candidates): Likewise.
8182 * class.c (validate_lhs): Remove.
8183 (resolve_address_of_overloaded_function): New function, split out
8184 and then substantially reworked, from ...
8185 (instantiate_type): Use it. Simplify.
8186 * cvt.c (convert_to_reference): Complain when caller has indicated
8187 that's the right thing to do. Don't crash if instantiate_type
8188 fails.
8189 * pt.c: Substitute `parameters' for `paramters' throughout.
8190 (print_candidates): Don't make it static.
8191 (most_specialized_instantiation): Split out from ...
8192 (most_specialized): Here.
8193
8194 Wed Dec 9 15:33:01 1998 Dave Brolley <brolley@cygnus.com>
8195
8196 * lex.c (lang_init_options): Initialize cpplib.
8197 * decl2.c (parse_options,cpp_initialized): Removed.
8198 (lang_decode_option): Move initialization of cpplib to
8199 lang_init_options.
8200
8201 1998-12-09 Mark Mitchell <mark@markmitchell.com>
8202
8203 * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
8204 well as the TYPE_DECL, when a typedef name is assigned to a
8205 previously anonymous type.
8206
8207 1998-12-08 Andrew MacLeod <amacleod@cygnus.com>
8208
8209 * cp/except.c (call_eh_info): Use __start_cp_handler instead of
8210 __cp_eh_info for getting the eh info pointer. Add table_index to
8211 field list.
8212 (push_eh_cleanup): Don't increment 'handlers' data field.
8213 (process_start_catch_block): Don't set the 'caught' field.
8214
8215 * cp/exception.cc (CP_EH_INFO): New macro for getting the
8216 exception info pointer within library routines.
8217 (__cp_eh_info): Use CP_EH_INFO.
8218 (__start_cp_handler): Get exception info pointer, set caught field,
8219 and increment the handlers field. Avoids this being done by handlers.
8220 (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
8221 (uncaught_exception): Use CP_EH_INFO macro.
8222
8223 Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com)
8224
8225 * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
8226
8227 Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
8228
8229 * lex.c (check_newline): Add support for \ as `natural'
8230 characters in file names in #line to be consistent with #include
8231 handling. We support escape processing in the # 1 "..." version of
8232 the command. See also support in cp/lex.c.
8233
8234 1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
8235
8236 * cp/decl2.c: s/data/opts/ when initializing cpp_reader
8237 structure.
8238
8239 1998-12-07 Jason Merrill <jason@yorick.cygnus.com>
8240
8241 * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
8242
8243 * error.c (dump_simple_decl): Also print namespace context.
8244 (dump_function_decl): Likewise.
8245
8246 * decl2.c (ambiguous_decl): Don't print old value if it's
8247 error_mark_node.
8248
8249 * decl.c (lookup_name_real): Fix handling of local types shadowed
8250 by a non-type decl. Remove obsolete code.
8251 * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
8252
8253 * lang-options.h: Add -fpermissive.
8254 * decl2.c: Likewise.
8255 * cp-tree.h: Add flag_permissive.
8256 * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
8257 were specified, set flag_pedantic_errors.
8258 * call.c (build_over_call): Turn dropped qualifier messages
8259 back into pedwarns.
8260 * cvt.c (convert_to_reference): Likewise.
8261 * typeck.c (convert_for_assignment): Likewise.
8262
8263 1998-12-05 Jason Merrill <jason@yorick.cygnus.com>
8264
8265 * decl2.c (coerce_new_type): Use same_type_p.
8266 (coerce_delete_type): Likewise.
8267
8268 * call.c (check_dtor_name): Return 1, not error_mark_node.
8269
8270 1998-12-04 Jason Merrill <jason@yorick.cygnus.com>
8271
8272 * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
8273 if MULTIPLE_SYMBOL_SPACES.
8274
8275 * pt.c (check_template_shadow): New fn.
8276 * decl2.c (grokfield): Use it.
8277 * decl.c (pushdecl): Likewise.
8278 (pushdecl_class_level): Likewise.
8279 (start_method): Likewise.
8280 (xref_tag): Don't try to use 't' if we're defining.
8281
8282 * call.c (check_dtor_name): Just return an error_mark_node.
8283 * pt.c (lookup_template_class): Complain about using non-template here.
8284 * parse.y (apparent_template_type): Not here.
8285
8286 * pt.c (check_explicit_specialization): Complain about specialization
8287 with C linkage.
8288
8289 * lang-options.h: Add -f{no-,}implicit-inline-templates.
8290
8291 * pt.c (convert_nontype_argument): Don't assume that any integer
8292 argument is intended to be a constant-expression.
8293
8294 1998-12-03 Mark Mitchell <mark@markmitchell.com>
8295
8296 * class.c (handle_using_decl): Fix comment. Don't lookup
8297 constructors in base classes.
8298 (validate_lhs): Fix typo in comment.
8299 * search.c (lookup_field_1): Don't return a USING_DECL.
8300
8301 * cp-tree.h (DECL_ACCESS): Improve documentation.
8302
8303 * decl.c (expand_static_init): Don't set the initialization-done
8304 flag until the initialization is done.
8305
8306 1998-12-02 Mark Mitchell <mark@markmitchell.com>
8307
8308 * decl2.c (validate_nonmember_using_decl): Complain about using
8309 declarations for class members.
8310
8311 1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
8312
8313 * typeck2.c (process_init_constructor): Use same_type_p.
8314
8315 * decl.c (check_tag_decl): Don't warn about null decl inside a
8316 class.
8317
8318 * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
8319 UNIFY_ALLOW_NONE.
8320 (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
8321 (resolve_overloaded_unification): Strip baselinks.
8322
8323 Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8324
8325 * g++spec.c: Don't prototype xmalloc.
8326
8327 1998-11-25 Jason Merrill <jason@yorick.cygnus.com>
8328
8329 * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
8330
8331 * decl.c (check_tag_decl): Do complain about null friend decl at
8332 file scope.
8333
8334 1998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
8335
8336 * lex.c (make_lang_type): Clear the whole struct lang_type, not
8337 only the first multiple of sizeof (int).
8338
8339 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
8340
8341 * decl.c (start_decl): An explicit specialization of a static data
8342 member is only a definition if it has an initializer.
8343
8344 * except.c (expand_throw): Use cp_finish_decl for the throw temp.
8345 * cvt.c (build_up_reference): Pass DIRECT_BIND down into
8346 cp_finish_decl.
8347 * init.c (expand_default_init): Check for DIRECT_BIND instead of
8348 DECL_ARTIFICIAL.
8349
8350 * call.c (build_over_call): Use build_decl.
8351
8352 * except.c (expand_throw): Just use convert, not
8353 build_reinterpret_cast.
8354
8355 * lex.c (handle_generic_pragma): Use token_buffer.
8356
8357 * decl.c (check_tag_decl): Don't complain about null friend decl.
8358
8359 1998-11-24 Dave Pitts <dpitts@cozx.com>
8360
8361 * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the
8362 first position.
8363 * lex.c (check_newline): Use ISALPHA.
8364 (readescape): Use ISGRAPH.
8365 (yyerror): Use ISGRAPH.
8366
8367 1998-11-24 Nathan Sidwell <nathan@acm.org>
8368
8369 * search.c (get_abstract_virtuals): Do not use initial
8370 CLASSTYPE_ABSTRACT_VIRTUALS.
8371 * typeck2.c (abstract_virtuals_error): Show location of abstract
8372 declaration.
8373 * call.c (build_new_method_call): Use
8374 CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
8375 * class.c (finish_struct_bits): Don't bother working out whether
8376 get_abstract_virtuals will do anything, just do it.
8377
8378 1998-11-24 Graham <grahams@rcp.co.uk>
8379
8380 * typeck.c (build_component_ref): Remove unused statement.
8381
8382 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
8383
8384 * class.c (add_method): Catch invalid overloads.
8385
8386 * class.c (add_method): Build up OVERLOADs properly for conversion ops.
8387 * search.c (lookup_conversions): Handle getting real OVERLOADs.
8388 (add_conversions): Likewise. Revert last change.
8389 * call.c (add_conv_candidate): Pass totype to add_candidate instead
8390 of fn. Don't add a new candidate if the last one was for the same
8391 type.
8392 (print_z_candidates): Handle getting a type as a function.
8393 (joust): If we got two conversion candidates to the same type,
8394 just pick one.
8395 (build_object_call): Lose 'templates'.
8396 (build_user_type_conversion_1): Handle getting real OVERLOADs.
8397
8398 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
8399
8400 * typeck2.c (process_init_constructor): If there are elements
8401 that don't have initializers and they need to have constructors
8402 run, supply them with initializers.
8403
8404 * class.c (finish_struct_1): A class with a 0-width bitfield is
8405 still empty.
8406
8407 1998-11-23 Mark Mitchell <mark@markmitchell.com>
8408
8409 * pt.c (instantiate_class_template): Don't try to figure out what
8410 specialization to use for a partial instantiation. Correct
8411 typos in a couple of comments. Avoid calling uses_template_parms
8412 multiple times.
8413
8414 1998-11-23 Benjamin Kosnik <bkoz@cygnus.com>
8415
8416 * method.c (process_overload_item): Add call to
8417 build_mangled_C9x_name for intTI_type_nodes.
8418 (build_mangled_C9x_name): Add prototype, define.
8419 * decl.c (init_decl_processing): Add names for
8420 TImode_type_node.
8421
8422 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
8423
8424 * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
8425
8426 * class.c (finish_struct_1): Set things up for 0-width bitfields
8427 like we do for others.
8428
8429 * decl.c (check_tag_decl): New fn.
8430 (shadow_tag): Split out from here.
8431 * decl2.c (grok_x_components): Call it.
8432
8433 1998-11-22 Jason Merrill <jason@yorick.cygnus.com>
8434
8435 * decl.c: Lose warn_about_return_type.
8436 (grokdeclarator): Always complain about implicit int, except for
8437 `main () { ... }'.
8438
8439 * decl.c (tag_name): New fn.
8440 (xref_tag): Complain about using typedef-name after class-key.
8441
8442 * init.c (expand_vec_init): Also keep going if from_array.
8443
8444 * tree.c (is_overloaded_fn): Also handle the output of
8445 build_offset_ref.
8446
8447 * decl.c (grokdeclarator): Use constructor_name when comparing
8448 field name against enclosing class.
8449 * class.c (finish_struct_anon): Likewise.
8450
8451 1998-11-22 Mark Mitchell <mark@markmitchell.com>
8452
8453 * decl.c (poplevel): Remove code to handle KEEP == 2.
8454 (finish_function): Don't confuse BLOCK-order when
8455 processing a destructor.
8456
8457 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
8458
8459 * decl.c (require_complete_types_for_parms): Call layout_decl
8460 after we've completed the type.
8461
8462 1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de>
8463
8464 * decl2.c (validate_nonmember_using_decl): Allow using templates
8465 from the global namespace.
8466
8467 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
8468
8469 Handle specifying template args to member function templates.
8470 * tree.c (build_overload): Always create an OVERLOAD for a template.
8471 * search.c (add_conversions): Handle finding an OVERLOAD.
8472 * decl2.c (check_classfn): Likewise.
8473 * lex.c (identifier_type): See through a baselink.
8474 * parse.y (do_id): Don't call do_identifier if we got a baselink.
8475 * class.c (instantiate_type, case TREE_LIST): Recurse.
8476
8477 * decl.c (grokdeclarator): Allow a boolean constant for array
8478 bounds, odd as that sounds.
8479
8480 * pt.c (unify): Be more strict about non-type parms, except for
8481 array bounds.
8482 (UNIFY_ALLOW_INTEGER): New macro.
8483
8484 1998-11-19 Manfred Hollstein <manfred@s-direktnet.de>
8485
8486 * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir).
8487
8488 1998-11-19 Jason Merrill <jason@yorick.cygnus.com>
8489
8490 * semantics.c (begin_class_definition): Call
8491 maybe_process_partial_specialization before push_template_decl.
8492 Don't call push_template_decl for a specialization.
8493 * search.c (lookup_field): Do return a member template class.
8494 * decl2.c (handle_class_head): Handle member template classes.
8495
8496 * decl.c (grokdeclarator): A parm type need not be complete.
8497
8498 * pt.c (convert_nontype_argument): Fix thinko.
8499
8500 1998-11-18 Mark Mitchell <mark@markmitchell.com>
8501
8502 * cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
8503 (global_delete_fndecl): New variable.
8504 * decl.c (global_delete_fndecl): Define it.
8505 (init_decl_processing): Set it.
8506 * init.c (build_builtin_delete_call): Use it.
8507 * tree.c (mapcar): Recursively call mapcar for the type of EXPR
8508 nodes.
8509
8510 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
8511
8512 * decl.c (cplus_expand_expr_stmt): Always complain about unresolved
8513 type.
8514
8515 * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue.
8516 * call.c (build_object_call): Also support references to functions.
8517 * typeck.c (convert_for_initialization): Don't decay a function
8518 if the target is a reference to function.
8519
8520 * search.c (add_conversions): Get all the overloads from a class.
8521
8522 * decl.c (grok_ctor_properties): Complain about any constructor
8523 that will take a single arg of the class type by value.
8524
8525 * typeck2.c (build_functional_cast): Can't create objects of
8526 abstract classes this way.
8527 * cvt.c (ocp_convert): Likewise.
8528
8529 * decl.c (grokfndecl): Member functions of local classes are not
8530 public.
8531
8532 1998-11-18 Mark Mitchell <mark@markmitchell.com>
8533
8534 * Make-lang.in (cc1plus): Add dependency on hash.o.
8535
8536 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
8537
8538 * search.c (get_abstract_virtuals): Complain about virtuals with
8539 no final overrider.
8540 * typeck2.c (abstract_virtuals_error): Remove handling for virtuals
8541 with no final overrider.
8542 * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
8543 on virtuals with no final overrider.
8544
8545 * lex.c (reinit_parse_for_block): Add a space after the initial ':'.
8546
8547 * class.c (finish_struct_1): Don't remove zero-width bit-fields until
8548 after layout_type.
8549
8550 * friend.c (do_friend): Don't set_mangled_name_for_decl.
8551
8552 * class.c (finish_struct_anon): Complain about non-fields.
8553 * decl2.c (build_anon_union_vars): Likewise.
8554
8555 * decl.c (grokdeclarator): Normal data members can't have the same
8556 name as the class, either.
8557 * class.c (finish_struct_anon): Neither can members of an
8558 anonymous union.
8559
8560 1998-11-17 Mark Mitchell <mark@markmitchell.com>
8561
8562 * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses.
8563 (TYPE_BINFO): Likewise.
8564 (IS_AGGR_TYPE): Tweak.
8565 (SET_IS_AGGR_TYPE): New macro.
8566 (CLASS_TYPE_P): Tweak.
8567 (lang_type): Group mark bitfields together. Remove linenum.
8568 (CLASSTYPE_SOURCE_LINE): Remove macro.
8569 (CLASSTYPE_MARKED_N): New macro.
8570 (SET_CLASSTYPE_MARKED_N): Likewise.
8571 (CLEAR_CLASSTYPE_MARKED_N): Likewise.
8572 (CLASS_TYPE_MARKED_*): Use them.
8573 (SET_CLASSTYPE_MARKED_*): Likewise.
8574 (CLEAR_CLASSTYPE_MARKED_*): Likewise.
8575 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
8576 (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well.
8577 (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE.
8578 * class.c (class_cache_obstack): New variable.
8579 (class_cache_firstobj): Likewise.
8580 (finish_struct): Don't set CLASSTYPE_SOURCE_LINE.
8581 (pushclass): Free the cache, when appropriate.
8582 (popclass): Tidy.
8583 (maybe_push_cache_obstack): Use class_cache_obstack.
8584 * decl.c (include hash.h).
8585 (typename_hash): New function.
8586 (typename_compare): Likewise.
8587 (build_typename_type): Check the hash table to avoid creating
8588 duplicates.
8589 (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE.
8590 (grokdeclarator): Use CLASS_TYPE_P.
8591 (xref_basetypes): Likewise.
8592 (start_function): Likewise. Don't put current_class_ref on the
8593 permanent obstack.
8594 * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO
8595 and TYPE_TI_ARGS.
8596 * lex.c (note_got_semicolon): Use CLASS_TYPE_P.
8597 (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated
8598 fields for types other than class types. Do clear TYPE_ALIAS_SET
8599 for types other than class types, though.
8600 * method.c (build_overload_identifier): Use CLASS_TYPE_P and
8601 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
8602 * pt.c (process_template_parm): Don't set
8603 CLASSTYPE_GOT_SEMICOLON.
8604 (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
8605 Coerce arguments on the momentary obstack.
8606 (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
8607 (instantiate_class_template): Calculate template arguments on the
8608 momentary obstack. Tidy.
8609 (tsubst_template_arg_vector): Use make_temp_vec.
8610 (tsubst_aggr_type): Put template arguments on the momentary
8611 obstack.
8612 (tsubst_decl): Likewise.
8613 (tsubst): Copy the array bounds index to the permanent obstack
8614 before building index types. Use new macros.
8615 (unify): Use new macros.
8616 (do_type_instantiation): Likewise.
8617 * search.c (lookup_fnfields_1): Use new macros.
8618 (dfs_pushdecls): Build envelopes on the cache obstack.
8619 (dfs_compress_decls): Use new macros.
8620 (push_class_decls): Build on the cache obstack.
8621 * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON.
8622 * sign.c (build_signature_pointer_or_reference_type): Use
8623 SET_IS_AGGR_TYPE.
8624 * tree.c (make_binfo): Check CLASS_TYPE_P.
8625 (copy_template_template_parm): Adjust.
8626 (make_temp_vec): Use push_expression_obstack.
8627 * typeck.c (complete_type): Use new macros.
8628 (comptypes): Likewise.
8629
8630 1998-11-17 Jason Merrill <jason@yorick.cygnus.com>
8631
8632 * pt.c (tsubst): Add diagnostics for invalid array, reference
8633 and pointer to member types.
8634
8635 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
8636
8637 * typeck2.c (my_friendly_abort): Don't fatal twice in a row.
8638
8639 * typeck.c (c_expand_start_case): Use build_expr_type_conversion.
8640 Simplify.
8641
8642 * parse.y (structsp): Fix cut-and-paste error.
8643
8644 * init.c (build_new): Complain about non-integral size.
8645
8646 * parse.y (unary_expr): Complain about defining types in sizeof.
8647
8648 * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn.
8649
8650 * rtti.c (build_x_typeid): Complain about typeid without
8651 including <typeinfo>.
8652 (get_typeid): Likewise. Complain about typeid of incomplete type.
8653 (get_tinfo_fn_dynamic): Likewise.
8654 (get_typeid_1): Not static anymore.
8655 * except.c (build_eh_type_type): Use get_typeid_1.
8656
8657 * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to
8658 ambiguous or private bases. Fix warning for reference cast.
8659
8660 1998-11-16 Mark Mitchell <mark@markmitchell.com>
8661
8662 * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
8663 * decl.c (duplicate_decls): Remove special-case code to deal with
8664 template friends, and just do the obvious thing.
8665 * pt.c (register_specialization): Tweak for clarity, and also to
8666 clear DECL_INITIAL for an instantiation before it is merged with a
8667 specialization.
8668 (check_explicit_specialization): Fix indentation.
8669 (tsubst_friend_function): Handle both definitions in friend
8670 declaration and outside friend declarations.
8671 (tsubst_decl): Don't clear DECL_INITIAL for an instantiation.
8672 (regenerate_decl_from_template): Tweak accordingly.
8673 (instantiate_decl): Likewise.
8674
8675 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
8676
8677 * decl.c (cplus_expand_expr_stmt): Promote warning about naked
8678 member function reference to error.
8679 * cvt.c (ocp_convert): Complain about converting an overloaded
8680 function to void.
8681
8682 * init.c (build_offset_ref): Just return a lone static member
8683 function.
8684
8685 * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs,
8686 not internal ones.
8687
8688 * typeck.c (build_binary_op_nodefault): Improve error handling.
8689
8690 * decl.c (grokfndecl): Complain about making 'main' a template.
8691
8692 * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*.
8693
8694 * call.c (build_method_call): Handle a BIT_NOT_EXPR around a
8695 TYPE_DECL in a template.
8696
8697 1998-11-15 Jason Merrill <jason@yorick.cygnus.com>
8698
8699 * typeck2.c (my_friendly_abort): Add URL in the other case, too.
8700
8701 * decl.c (struct cp_function): Add named_label_uses.
8702 (push_cp_function_context): Save it.
8703 (pop_cp_function_context): Restore it.
8704 (define_label): Also complain about jumping into the scope of
8705 non-POD objects that don't have constructors.
8706 * tree.c (pod_type_p): New fn.
8707
8708 * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner.
8709 * rtti.c (synthesize_tinfo_fn): Call import_export_decl here.
8710 (get_tinfo_fn): Not here.
8711 * repo.c (repo_get_id): Abort if we get called for an incomplete
8712 type.
8713
8714 1998-11-13 Mark Mitchell <mark@markmitchell.com>
8715
8716 * except.c (expand_throw): Make sure first argument to
8717 __cp_push_exception is of type `void*' to avoid spurious error
8718 messages.
8719
8720 1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
8721
8722 * pt.c (try_one_overload): Take orig_targs again. Only check for
8723 mismatches against them; we don't care what a previous call found.
8724 (resolve_overloaded_unification): Adjust.
8725
8726 * search.c (lookup_field): Don't return anything for a non-type
8727 field from a dependent type.
8728 * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
8729 in an array declarator.
8730 (start_decl): Push into the class before looking for the field.
8731
8732 1998-11-08 Mark Mitchell <mark@markmitchell.com>
8733
8734 * method.c (build_overload_value): Handle REFERENCE_TYPE.
8735
8736 1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
8737
8738 * decl.c (grokdeclarator): Allow namespace-scoped members if they
8739 are friends.
8740
8741 1998-11-08 Jason Merrill <jason@yorick.cygnus.com>
8742
8743 * pt.c (tsubst_decl): Don't mess with the global value of an
8744 un-mangled DECL_ASSEMBLER_NAME.
8745
8746 1998-11-03 Christopher Faylor <cgf@cygnus.com>
8747
8748 * decl.c (init_decl_processing): Remove CYGWIN conditional
8749 since CYGWIN is now able to deal with trapping signals.
8750
8751 Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8752
8753 * cp-tree.h: Don't include gansidecl.h.
8754 * exception.cc: Include gansidecl.h (since we don't include config.h)
8755 * g++spec.c: Don't include gansidecl.h.
8756
8757 1998-11-06 Mark Mitchell <mark@markmitchell.com>
8758
8759 * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease
8760 size of dummy.
8761 (DECL_DEFINED_IN_CLASS_P): New macro.
8762 (TEMPLATE_PARMS_FOR_INLINE): Document.
8763 (check_static_variable_definition): New function.
8764 * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if
8765 appropriate.
8766 (check_static_variable_definition): Split out from ...
8767 (grokdeclarator): Here.
8768 * pt.c (check_default_tmpl_args): New function, split out from ...
8769 (push_template_decl_real): Here.
8770 (instantiate_template): Fix comment.
8771
8772 1998-11-04 Mark Mitchell <mark@markmitchell.com>
8773
8774 * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued.
8775 (CP_TYPE_VOLATILE_P): Likewise.
8776 (CP_TYPE_RESTRICT_P): Likewise.
8777
8778 1998-11-03 Mark Mitchell <mark@markmitchell.com>
8779
8780 * pt.c (tsubst): Use build_index_type, not build_index_2_type.
8781
8782 1998-11-02 Jason Merrill <jason@yorick.cygnus.com>
8783
8784 * class.c (instantiate_type): Be more helpful.
8785
8786 * decl2.c (import_export_decl): Call import_export_class.
8787
8788 * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
8789 * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
8790 * pt.c (tsubst_copy): Likewise.
8791
8792 1998-11-02 Mark Mitchell <mark@markmitchell.com>
8793
8794 * init.c (expand_vec_init): Fix off-by-one error.
8795
8796 1998-11-02 Alexandre Oliva <oliva@dcc.unicamp.br>
8797
8798 * parse.y (apparent_template_type): New type.
8799 (named_complex_class_head_sans_basetype): Use it.
8800 * Makefile.in (CONFLICTS): One new conflict.
8801 * parse.c: Regenerated.
8802
8803 1998-11-01 Mark Mitchell <mark@markmitchell.com>
8804
8805 * cp-tree.h (COMPARE_STRICT): New macro.
8806 (COMPARE_BASE): Likewise.
8807 (COMPARE_RELAXED): Likewise.
8808 (COMPARE_REDECLARATION): Likewise.
8809 (same_type_p): Likewise.
8810 (same_or_base_type_p): Likewise.
8811 * call.c (standard_conversion): Use them, in place of comptypes
8812 with numeric arguments.
8813 (reference_binding): Likewise.
8814 (convert_like): Likewise.
8815 (build_over_call): Likewise.
8816 (is_subseq): Likewise.
8817 (is_properly_derived_from): Likewise.
8818 (compare_ics): Likewise.
8819 (joust): Likewise.
8820 * class.c (delete_duplicate_fields_1): Likewise.
8821 (resolves_to_fixed_type_p): Likewise.
8822 (instantiate_type): Likewise. Remove #if 0'd code.
8823 * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here.
8824 (pushdecl): Likewise.
8825 (lookup_name_real): Likewise.
8826 (grokdeclarator): Likewise. Check for illegal array declarations.
8827 (grokparms): Likewise.
8828 (grok_op_properties): Likewise.
8829 * decl2.c (check_classfn): Likewise.
8830 * friend.c (is_friend): Likewise.
8831 (make_friend_class): Likewise.
8832 * init.c (expand_aggr_init): Likewise.
8833 (expand_vec_init): Likewise.
8834 * pt.c (is_member_template_class): Remove declaration.
8835 (is_specialization_of): Use COMPARE_* and new macros.
8836 (comp_template_parms): Likewise.
8837 (convert_nontype_argument): Likewise.
8838 (coerce_template_template_parms): Likewise.
8839 (template_args_equal): Likewise.
8840 (lookup_template_class): Likewise.
8841 (type_unification_real): Likewise.
8842 (unify): Likewise.
8843 (get_bindings_real): Likewise.
8844 * search.c (covariant_return_p): Likewise.
8845 (get_matching_virtual): Likewise.
8846 * sig.c (match_method_types): Likewise.
8847 * tree.c (vec_binfo_member): Likewise.
8848 (cp_tree_equal): Likewise.
8849 * typeck.c (common_type): Likewise.
8850 (comp_array_types): Likewise. Get issues involving unknown array
8851 bounds right.
8852 (comptypes): Update comments. Use new flags.
8853 (comp_target_types): Use new macros.
8854 (compparms): Likewise.
8855 (comp_target_parms): Likewise.
8856 (string_conv_p): Likewise.
8857 (build_component_ref): Likewise.
8858 (build_indirect_ref): Likewise.
8859 (build_conditional_expr): Likewise.
8860 (build_static_cast): Likewise.
8861 (build_reinterpret_cast): Likewise.
8862 (build_const_cast): Likewise.
8863 (build_modify_expr): Likewise.
8864 (convert_for_assignment): Likewise.
8865 (comp_ptr_ttypes_real): Likewise.
8866 (ptr_reasonably_similar): Likewise.
8867 (comp_ptr_ttypes_const): Likewise.
8868
8869 1998-10-31 Jason Merrill <jason@yorick.cygnus.com>
8870
8871 * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error.
8872
8873 1998-10-30 Mark Mitchell <mark@markmitchell.com>
8874
8875 * decl2.c (delete_sanity): Pass integer_zero_node, not
8876 integer_two_node, to build_vec_delete.
8877 * init.c (build_array_eh_cleanup): Remove.
8878 (expand_vec_init_try_block): New function.
8879 (expand_vec_init_catch_clause): Likewise.
8880 (build_vec_delete_1): Don't deal with case that auto_delete_vec
8881 might be integer_two_node anymore.
8882 (expand_vec_init): Rework for initialization-correctness and
8883 exception-correctness.
8884 * typeck2.c (process_init_constructor): Make mutual exclusivity
8885 of cases more obvious.
8886
8887 1998-10-29 Jason Merrill <jason@yorick.cygnus.com>
8888
8889 * decl.c (lookup_name_real): OK, only warn if not lexing.
8890 Simplify suggested fix.
8891
8892 * cp-tree.h (IDENTIFIER_MARKED): New macro.
8893 * search.c (lookup_conversions): Use breadth_first_search.
8894 (add_conversions): Avoid adding two conversions to the same type.
8895 (breadth_first_search): Work with base binfos, rather
8896 than binfos and base indices.
8897 (get_virtual_destructor): Adjust.
8898 (tree_has_any_destructor_p): Adjust.
8899 (get_matching_virtual): Adjust.
8900
8901 * pt.c (push_template_decl_real): Generalize check for incorrect
8902 number of template parms.
8903 (is_member_template_class): #if 0.
8904
8905 1998-10-29 Richard Henderson <rth@cygnus.com>
8906
8907 * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
8908 last.
8909
8910 1998-10-28 Zack Weinberg <zack@rabi.phys.columbia.edu>
8911
8912 * lex.c: Call check_newline from lang_init always. After
8913 calling cpp_start_read, set yy_cur and yy_lim to read from the
8914 cpplib token buffer.
8915
8916 1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
8917
8918 * class.c (instantiate_type): Don't consider templates for a normal
8919 match.
8920
8921 * class.c (finish_struct_1): Don't complain about non-copy
8922 assignment ops in union members.
8923
8924 * class.c (build_vtable): Don't pass at_eof to import_export_vtable.
8925 (prepare_fresh_vtable): Likewise.
8926 (finish_struct_1): Don't call import_export_class.
8927 * decl2.c (finish_vtable_vardecl): Do import/export stuff.
8928 (finish_prevtable_vardecl): Lose.
8929 (finish_file): Don't call it.
8930 * pt.c (instantiate_class_template): Likewise.
8931 * cp-tree.h: Remove it.
8932
8933 * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
8934 * decl.c (finish_function): Not here.
8935 (start_function): Do set DECL_INITIAL.
8936
8937 * pt.c (push_template_decl_real): Complain about default template
8938 args for enclosing classes.
8939
8940 * call.c (add_function_candidate): Treat conversion functions
8941 as coming from the argument's class.
8942 * cp-tree.h (DECL_CONV_FN_P): New fn.
8943 (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE.
8944 * class.c (add_method): Use DECL_CONV_FN_P.
8945 * decl2.c (check_classfn): Likewise.
8946 * error.c (dump_function_name): Likewise.
8947 (dump_function_decl): Likewise.
8948 * pt.c (fn_type_unification): Likewise.
8949 * search.c (add_conversions): Likewise.
8950
8951 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
8952
8953 * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL.
8954 * method.c (hack_identifier): Also check for using RESULT_DECL
8955 from outer context.
8956
8957 1998-10-27 Mark Mitchell <mark@markmitchell.com>
8958
8959 * decl.c (grokdeclarator): Use type_quals, rather than constp,
8960 consistently.
8961
8962 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
8963
8964 * call.c (standard_conversion): instantiate_type here.
8965 (reference_binding): And here.
8966 (implicit_conversion): Not here.
8967 (build_op_delete_call): No need to cons up an OVERLOAD.
8968 * cvt.c (cp_convert_to_pointer): instantiate_type here.
8969 (convert_to_reference): And here.
8970 * decl.c (grok_reference_init): Not here.
8971 (grokparms): Or here.
8972 * typeck2.c (digest_init): Or here.
8973 * typeck.c (decay_conversion): Take the address of overloaded
8974 functions, too.
8975 (require_instantiated_type): Lose.
8976 (convert_arguments): Don't handle unknown types here.
8977 (build_c_cast): Likewise.
8978 (build_binary_op): Gut.
8979 (build_conditional_expr): Don't require_instantiated_type.
8980 (build_modify_expr): Likewise.
8981 (build_static_cast): Don't instantiate_type.
8982 (build_reinterpret_cast): Likewise.
8983 (build_const_cast): Likewise.
8984 (convert_for_initialization): Likewise.
8985 (build_ptrmemfunc): Use type_unknown_p.
8986 (convert_for_assignment): Also do default_conversion on overloaded
8987 functions. Hand them off to ocp_convert.
8988
8989 1998-10-26 Mark Mitchell <mark@markmitchell.com>
8990
8991 * error.c (dump_decl): Deal with TEMPLATE_DECLs that are
8992 VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
8993
8994 * class.c (finish_struct_1): Use build_cplus_array_type to build
8995 array types.
8996 * decl.c (init_decl_processing): Likewise.
8997 * except.c (expand_end_eh_spec): Likewise.
8998 * search.c (expand_upcast_fixups): Simplify very slightly.
8999
9000 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
9001
9002 * decl.c (grokdeclarator): Complain about a variable using
9003 constructor syntax coming back null from start_decl.
9004
9005 * friend.c (make_friend_class): Complain about trying to make
9006 a non-class type a friend.
9007
9008 * decl.c (grokfndecl): Set DECL_INITIAL for a defn here.
9009 (start_function): Not here.
9010
9011 1998-10-26 Brendan Kehoe <brendan@cygnus.com>
9012
9013 * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
9014
9015 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
9016
9017 * typeck2.c (process_init_constructor): Only skip anonymous fields
9018 if they are bitfields.
9019
9020 * cp-tree.def (TYPEOF_TYPE): New code.
9021 * error.c (dump_type_real): Handle it.
9022 * pt.c (tsubst): Likewise.
9023 * tree.c (search_tree): Likewise.
9024 * semantics.c (finish_typeof): New fn.
9025 * parse.y (typespec): Use it.
9026 * cp-tree.h: Declare it.
9027
9028 1998-10-26 Manfred Hollstein <manfred@s-direktnet.de>
9029
9030 * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional.
9031
9032 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
9033
9034 * typeck.c (convert_arguments): Don't handle pmf references
9035 specially.
9036
9037 * init.c (build_member_call): Don't try to convert to the base type
9038 if it's ambiguous or pedantic.
9039
9040 * typeck2.c (check_for_new_type): Only depend on pedantic for
9041 C-style casts.
9042
9043 1998-10-25 Mark Mitchell <mark@markmitchell.com>
9044
9045 * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all
9046 non-converting constructors.
9047
9048 1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
9049
9050 * gxxint.texi: Correct documentation for n, N, Q, and B.
9051
9052 1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
9053
9054 * parse.y (condition): Convert VAR_DECL from reference to indirect
9055 reference.
9056
9057 1998-10-23 Andrew MacLeod <amacleod@cygnus.com>
9058
9059 * exception.cc (__cp_pop_exception): Free the original exception
9060 value, not the potentially coerced one.
9061
9062 1998-10-23 Mark Mitchell <mark@markmitchell.com>
9063
9064 * Makefile.in (hash.h): Run gperf when necessary.
9065
9066 * cp-tree.h (CP_TYPE_READONLY): Remove.
9067 (CP_TYPE_VOLATILE): Likewise.
9068 (CP_TYPE_QUALS): New macro.
9069 (CP_TYPE_CONST_P): Likewise.
9070 (CP_TYPE_VOLATILE_P): Likewise.
9071 (CP_TYPE_RESTRICT_P): Likewise.
9072 (CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
9073 (cp_build_type_variant): Rename to ...
9074 (cp_build_qualified_type): New function.
9075 (c_apply_type_quals_to_decl): Declare.
9076 (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
9077 (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
9078 (cp_type_qual_from_rid): New function.
9079 (compparms): Remove unused parameter. All callers changed.
9080 (cp_type_quals): New function.
9081 (at_least_as_qualified_p): Likewise.
9082 (more_qualified_p): Likewise.
9083
9084 * call.c (standard_conversion): Replace calls to
9085 cp_build_type_variant with cp_build_qualified_type. Use
9086 CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
9087 compare them. Use CP_TYPE_* macros to check qualifiers.
9088 (reference_binding): Likewise.
9089 (implicit_conversion): Likewise.
9090 (add_builtin_candidates): Likewise.
9091 (build_over_call): Likewise.
9092 * class.c (overrides): Compare all qualifiers, not just `const',
9093 on method declarations.
9094 * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
9095 (convert_pointer_to_real): Likewise.
9096 (type_promotes_to): Likewise.
9097 * decl.c (check_for_uninitialized_const_var): New function.
9098 (init_decl_processing): More CP_TYPE_QUALS conversion, etc.
9099 (cp_finish_decl): Use check_for_uninitialized_const_var.
9100 (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to
9101 handle `restrict'.
9102 (grok_ctor_properties): Likewise.
9103 (grok_op_properties): Likewise.
9104 (start_function): Likewise.
9105 (rever_static_member_fn): Likewise.
9106 * decl2.c (grok_method_quals): Likewise.
9107 (grokfield): Likewise.
9108 * error.c (dump_readonly_or_volatile): Rename to ...
9109 (dump_qualifiers): New function. Handle `restrict'.
9110 (dump_type_real): Use it.
9111 (dump_aggr_type): Likewise.
9112 (dump_type_prefix): Likewise.
9113 (dump_type_suffix): Likewise.
9114 (dump_function_decl): Likewise.
9115 (cv_as_string): Likewise.
9116 * gxx.gperf: Add __restrict and __restrict__.
9117 * gxxint.texi: Document `u' as used for `__restrict', and a few
9118 other previously undocumented codes.
9119 * hash.h: Regenerated.
9120 * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
9121 (build_member_call): Likewise.
9122 (build_new_1): Likewise.
9123 * lex.c (init_parse): Add entry for RID_RESTRICT.
9124 (cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
9125 (cp_type_qual_from_rid): Define.
9126 * lex.h (enum rid): Add RID_RESTRICT.
9127 * method.c (process_modifiers): Deal with `restrict'.
9128 * parse.y (primary): More CP_TYPE_QUALS conversion, etc.
9129 * parse.c: Regenerated.
9130 * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
9131 (tsubst_aggr_type): Likewise.
9132 (tsubst): Likewise.
9133 (check_cv_quals_for_unify): Likewise.
9134 (unify): Likewise.
9135 * rtti.c (init_rtti_processing): Likewise.
9136 (build_headof): Likewise.
9137 (get_tinfo_var): Likewise.
9138 (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling.
9139 (expand_class_desc): Likewise.
9140 (expand_attr_desc): Likewise.
9141 (synthesize_tinfo_fn): Likewise.
9142 * search.c (covariant_return_p): Likewise. Fix `volatile' handling.
9143 (get_matching_virtual): Likewise.
9144 (expand_upcast_fixups): Likewise.
9145 * sig.c (build_signature_pointer_or_reference_name): Take
9146 type_quals, not constp and volatilep.
9147 (build_signature_pointer_or_reference_type): Likewise.
9148 (match_method_types): More CP_TYPE_QUALS conversion, etc.
9149 (build_signature_pointer_constructor): Likewise.
9150 (build_signature_method_call): Likewise.
9151 * tree.c (build_cplus_array_type): Likewise.
9152 (cp_build_type_variant): Rename to ...
9153 (cp_build_qualified_type): New function. Deal with `__restrict'.
9154 (canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
9155 (build_exception_variant): Likewise.
9156 (mapcar): Likewise.
9157 * typeck.c (qualif_type): Likewise.
9158 (common_type): Likewise.
9159 (comptypes): Likewise.
9160 (comp_cv_target_types): Likewise.
9161 (at_least_as_qualified_p): Define.
9162 (more_qualified_p): Likewise.
9163 (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
9164 (compparms): Likewise.
9165 (inline_conversion): Likewise.
9166 (string_conv_p): Likewise.
9167 (build_component_ref): Likewise.
9168 (build_indirect_ref): Likewise.
9169 (build_array_ref): Likewise.
9170 (build_unary_op): Likewise.
9171 (build_conditional_expr): Likewise.
9172 (build_static_cast): Likewise.
9173 (build_c_cast): Likewise.
9174 (build_modify_expr): Likewise.
9175 (convert_For_assignment): Likewise.
9176 (comp_ptr_ttypes_real): Likewise.
9177 (cp_type_quals): New function.
9178
9179 1998-10-23 Jason Merrill <jason@yorick.cygnus.com>
9180
9181 * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
9182 (CP_TYPE_VOLATILE): Likewise.
9183 * decl.c (grokdeclarator): Use them.
9184 * tree.c (canonical_type_variant): Likewise.
9185
9186 1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de>
9187
9188 * parse.y (named_class_head): Push into class while parsing the
9189 base class list.
9190 * decl2.c (push_scope, pop_scope): New functions.
9191 * cp-tree.h: Declare them.
9192 * init.c (build_new_1): Delay cleanup until end of full expression.
9193
9194 1998-10-21 Jason Merrill <jason@yorick.cygnus.com>
9195
9196 * typeck.c (build_component_ref): Use of a type here is an error.
9197
9198 1998-10-19 Jason Merrill <jason@yorick.cygnus.com>
9199
9200 Revamp references to member functions.
9201 * method.c (hack_identifier): Call build_component_ref for a
9202 reference to a member function.
9203 * typeck.c (build_component_ref): Only return a single function
9204 if it's static. Otherwise, return a COMPONENT_REF.
9205 (build_x_function_call): Handle a COMPONENT_REF.
9206 (build_unary_op): Handle all unknown-type things.
9207 * decl2.c (arg_assoc): Handle COMPONENT_REF.
9208 * class.c (instantiate_type): Complain if the function we get is a
9209 nonstatic member function. Remove code for finding "compatible"
9210 functions.
9211 * pt.c (tsubst_copy): Handle NOP_EXPR.
9212 * tree.c (build_dummy_object): New fn.
9213 (maybe_dummy_object): New fn.
9214 (is_dummy_object): New fn.
9215 * cp-tree.h: Declare them.
9216 * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
9217 * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
9218 * init.c (build_member_call): Use maybe_dummy_object and
9219 is_dummy_object.
9220 (build_offset_ref): Use maybe_dummy_object.
9221 (resolve_offset_ref): Use is_dummy_object.
9222 * typeck.c (build_x_function_call): Call build_dummy_object.
9223 (unary_complex_lvalue): Call is_dummy_object.
9224
9225 * typeck.c (build_component_addr): Make sure field is a field.
9226
9227 * call.c (build_new_op): Delete obsolete code.
9228
9229 * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
9230
9231 1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
9232
9233 * decl2.c (validate_nonmember_using_decl): Fix using-directives of
9234 std if std is ignored.
9235
9236 1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
9237
9238 * decl.c (grokvardecl): Fix thinko.
9239
9240 * decl.c (grokdeclarator): Embedded attrs bind to the right,
9241 not the left.
9242
9243 * parse.y (fn.def2): Fix 'attrs' format.
9244
9245 1998-10-18 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
9246
9247 * Makefile.in (CONFLICTS): Update.
9248 * parse.y (expr_or_declarator_intern): New rule.
9249 (expr_or_declarator, direct_notype_declarator, primary,
9250 functional_cast): Use it.
9251 (notype_declarator_intern): New rule.
9252 (notype_declarator, complex_notype_declarator): Use it.
9253
9254 1998-10-17 Jason Merrill <jason@yorick.cygnus.com>
9255
9256 * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate.
9257 (grokvardecl): Likewise.
9258
9259 Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9260
9261 * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR).
9262 (add_method): Likewise for arguments 1 & 2 of `bcopy'.
9263
9264 * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN.
9265
9266 * pt.c (process_partial_specialization): Cast 1st argument of
9267 `bzero' to (PTR).
9268
9269 * tree.c (build_base_fields): Cast `base_align' to (int) when
9270 comparing against one.
9271
9272 1998-10-16 Mark Mitchell <mark@markmitchell.com>
9273
9274 * decl.c (lookup_name_real): Handle template parameters for member
9275 templates where said parameters have the same name as the
9276 surrounding class.
9277
9278 * decl.c (expand_static_init): Build cleanups before entering the
9279 anonymous function used to do them to avoid access-checking
9280 confusion.
9281
9282 * decl.c (grokfndecl): Add back call to cplus_decl_attributes
9283 accidentally removed by previous change, and make DECL_RTL here.
9284 * class.c (add_method): Don't make DECL_RTL here.
9285
9286 * pt.c (for_each_template_parm): Don't examine uninstantiated
9287 default arguments.
9288
9289 1998-10-16 Dave Brolley <brolley@cygnus.com>
9290
9291 * lex.c (real_yylex): Fix unaligned access of wchar_t.
9292
9293 1998-10-16 Mark Mitchell <mark@markmitchell.com>
9294
9295 * class.c (add_method): Fix documentation to reflect previous
9296 changes. Check for duplicate method declarations here.
9297 * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL
9298 correctly; such things never match.
9299 (grokfndecl): Don't look for duplicate methods here.
9300 * decl2.c (check_classfn): Don't assume names are mangled.
9301 Don't add bogus member function declarations to a class before the
9302 class type is complete.
9303 (grokfield): Reformat error message.
9304 * method.c (set_mangled_name_for_decl): Don't mangle names while
9305 processing_template_decl.
9306
9307 1998-10-16 Jason Merrill <jason@yorick.cygnus.com>
9308
9309 * typeck.c (build_indirect_ref): Complain about a pointer to data
9310 member, too.
9311 * typeck2.c (build_m_component_ref): Don't indirect a pointer to
9312 data member.
9313 * init.c (resolve_offset_ref): Don't undo the above.
9314
9315 * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros.
9316 (struct lang_decl_flags): Add `bitfield'.
9317 * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of
9318 DECL_BIT_FIELD.
9319 * decl2.c (grokbitfield, grok_alignof): Likewise.
9320 * init.c (build_offset_ref): Likewise.
9321 * typeck.c (build_component_addr, expr_sizeof): Likewise.
9322 * cvt.c (build_up_reference): Don't crash if taking the address
9323 returns error_mark_node.
9324
9325 * decl.c (grokfndecl): Also check ctype when checking for ::main().
9326
9327 1998-10-15 Jason Merrill <jason@yorick.cygnus.com>
9328
9329 * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
9330 Do mangling here.
9331 (grokdeclarator): Instead of here.
9332 * friend.c (do_friend): Lose special handling of ::main and
9333 __builtin_*.
9334 * cp-tree.h (DECL_MAIN_P): Check for C linkage.
9335
9336 * spew.c (yylex): Clear looking_for_typename if we got
9337 'enum { ... };'.
9338
9339 1998-10-15 Mark Mitchell <mark@markmitchell.com>
9340
9341 * class.c (maybe_warn_about_overly_private_class): Improve error
9342 messages for class with only private constructors.
9343
9344 * cp-tree.def (TYPENAME_TYPE): Add to documentation.
9345 * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
9346 (build_typename_type): New function.
9347 * decl.c (build_typename_type): Broken out from ...
9348 (make_typename_type): Use it.
9349 * search.c (lookup_field): Likewise.
9350
9351 1998-10-14 Benjamin Kosnik <bkoz@rhino.cygnus.com>
9352
9353 * pt.c (convert_nontype_argument): Check against type_referred_to.
9354 * decl.c (grokvardecl): Check for declarator name before building
9355 DECL_ASSEMBLER_NAME.
9356
9357 1998-10-14 Mark Mitchell <mark@markmitchell.com>
9358
9359 * pt.c (lookup_template_class): Add comment.
9360 (instantiate_class_template): Don't mark the _TYPE node for
9361 member class templates as an instantiation.
9362
9363 1998-10-14 Jason Merrill <jason@yorick.cygnus.com>
9364
9365 * decl.c (grokfndecl): Fix my thinko.
9366
9367 1998-10-13 Jason Merrill <jason@yorick.cygnus.com>
9368
9369 * tinfo2.cc (fast_compare): Remove.
9370 (before): Just use strcmp.
9371 * tinfo.cc (operator==): Just use strcmp.
9372
9373 1998-10-13 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
9374
9375 * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
9376 declarations.
9377
9378 1998-10-13 Mark Mitchell <mark@markmitchell.com>
9379
9380 * cp-tree.h (specializations_of_same_template_p): Remove.
9381 * search.c (get_template_base): Don't use it.
9382 (get_template_base_recursive): Likewise.
9383 * pt.c (specializations_of_same_template_p): Remove.
9384 (unify): Don't use it.
9385 (lookup_template_class): Find the correct parent when setting
9386 CLASSTYPE_TI_TEMPLATE.
9387
9388 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
9389
9390 * tinfo.cc (operator==): Always compare names.
9391
9392 1998-10-12 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
9393
9394 * decl.c (start_function): Fix cut-and-paste error.
9395
9396 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
9397
9398 * inc/typeinfo: Add #pragma interface.
9399 (operator!=): Just call operator==.
9400 * tinfo.cc: Add #pragma implementation.
9401 (operator==): Move from inc/typeinfo and tinfo2.cc.
9402 Check __COMMON_UNRELIABLE instead of _WIN32.
9403
9404 * typeck2.c (my_friendly_abort): Add URL.
9405
9406 1998-10-12 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
9407
9408 * decl.c (start_method): Added extra parameter for attributes.
9409 * cp-tree.h (start_method): Update prototype.
9410 * parse.y (fn.def2): Update start_method parameter list.
9411
9412 1998-10-11 Mark Mitchell <mark@markmitchell.com>
9413
9414 * cp-tree.h (specializations_of_same_template_p): Declare.
9415 * pt.c (specializations_of_same_template_p): New function.
9416 (unify): Use it.
9417 * search.c (get_template_base): Use it.
9418 (get_template_base_recursive): Likewise.
9419
9420 1998-10-10 Manfred Hollstein <manfred@s-direktnet.de>
9421
9422 * decl2.c (start_objects): Add new variable `joiner' and
9423 initialize it properly.
9424
9425 1998-10-09 Mark Mitchell <mark@markmitchell.com>
9426
9427 * search.c (expand_upcast_fixups): Tweak to match 1998-10-07
9428 change to vtable types.
9429
9430 * cvt.c (ocp_convert): Avoid infinite recursion caused by
9431 1998-10-03 change.
9432
9433 1998-10-08 Jason Merrill <jason@yorick.cygnus.com>
9434
9435 * pt.c (resolve_overloaded_unification): New fn.
9436 (try_one_overload): Likewise.
9437 (unify): Don't fail on unknown type.
9438 (type_unification_real): Likewise. Use resolve_overloaded_unification
9439 to handle an overloaded argument.
9440 (template_args_equal): Split out...
9441 (comp_template_args): From here.
9442 (determine_specialization): Also allow a template with more
9443 parms than were explicitly specified.
9444 * cp-tree.h: Add template_args_equal.
9445 * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code.
9446
9447 Thu Oct 8 15:58:30 1998 Anthony Green <green@cygnus.com>
9448
9449 * semantics.c (finish_asm_stmt): Revert my 1998-09-28
9450 change.
9451
9452 Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com)
9453
9454 * typeck.c (unsigned_type): Only return TItype nodes when
9455 HOST_BITS_PER_WIDE_INT is >= 64 bits.
9456 (signed_type): Likewise.
9457 * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
9458 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
9459 (init_decl_processing): Only create TItype nodes when
9460 HOST_BITS_PER_WIDE_INT is >= 64 bits.
9461 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare
9462 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
9463
9464 Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9465
9466 * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
9467 (gxx.gperf): Update comments describing invocation flags.
9468 (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
9469
9470 1998-10-07 Mark Mitchell <mark@markmitchell.com>
9471
9472 * class.c (finish_struct_1): Add commentary on previous change.
9473
9474 * cp-tree.h (vtbl_ptr_type_node): New variable.
9475 * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
9476 already of the right type.
9477 (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
9478 Simplify code to grow vtable.
9479 * decl.c (vtbl_ptr_type_node): Define.
9480 (init_decl_processing): Initialize it.
9481
9482 1998-10-06 Mark Mitchell <mark@markmitchell.com>
9483
9484 * cp-tree.def (PTRMEM_CST): New tree node.
9485 * cp-tree.h (ptrmem_cst): New type.
9486 (lang_type): Remove local_typedecls.
9487 (dummy): Increase to 12 bits from 11.
9488 (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
9489 (PTRMEM_CST_CLASS): New macro.
9490 (PTRMEM_CST_MEMBER): Likewise.
9491 (current_access_specifier): New variable.
9492 (current_class_type): Remove duplicate declaration.
9493 (finish_struct): Change prototype.
9494 (unreverse_member_declarations): New function.
9495 (pushdecl_class_level): Change prototype.
9496 (grok_enum_decls): Remove.
9497 (fixup_anonymous_union): New function.
9498 (grok_x_components): Change prototype.
9499 (tsubst_chain): Remove.
9500 (finish_member_template_decl): Likewise.
9501 (check_explicit_specialization): Fix indentation.
9502 (finish_class_definition): Change prototype.
9503 (finish_member_class_template): Likewise.
9504 (finish_member_declaration): New function.
9505 (check_multiple_declarators): Likewise.
9506 * class.c (class_stack_node_t): New type.
9507 (current_class_base): Remove.
9508 (current_class_stack): Change type.
9509 (current_access_specifier): New variable.
9510 (grow_method): Remove.
9511 (check_member_decl_is_same_in_complete_scope): Break out from
9512 finish_struct.
9513 (make_method_vec): New function.
9514 (free_method_vec): Likewise.
9515 (add_implicitly_declared_members): Break out from finish_struct_1.
9516 (free_method_vecs): New variable.
9517 (add_method): Rework for direct use from parser.
9518 (handle_using_decl): Watch for NULL_TREE while iterating through
9519 CLASSTYPE_METHOD_VEC.
9520 (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
9521 just do some error-checking.
9522 (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
9523 (finish_struct_1): Simplify. Use add_implicitly_declared_members.
9524 (finish_struct): Change prototype. Simplify; fields and methods
9525 are already set up at this point.
9526 (init_class_processing): Set up current_class_stack.
9527 (pushclass): Save current_access_specifier.
9528 (popclass): Restore it.
9529 (currently_open_class): Simplify.
9530 (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
9531 * decl.c (saved_scope): Add access_specifier.
9532 (maybe_push_to_top_level): Save it.
9533 (pop_from_top_level): Restore it.
9534 (maybe_process_template_type_declaration): Use
9535 finish_member_declaration.
9536 (pushtag): Likewise.
9537 (pushdecl_class_level): Don't return a value.
9538 (fixup_anonymous_union): Break out from grok_x_components.
9539 (shadow_tag): Use it.
9540 (xref_tag): Complain about using an elaborated type specifier to
9541 reference a template type parameter or typedef name.
9542 (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
9543 (current_local_enum): Remove.
9544 (build_enumerator): Call finish_member_declaration.
9545 (grok_enum_decls): Remove.
9546 * decl2.c (grok_x_components): Simplify.
9547 (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
9548 (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
9549 (merge_functions): Add to comment.
9550 (arg_assoc_type): Prototype.
9551 (arg_assoc): Pass as many arguments as there are parameters.
9552 * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of
9553 OFFSET_REF.
9554 * expr.c (cpls_expand_expr): Remove dead code. Handle
9555 PTRMEM_CST.
9556 * friend.c (do_friend): Lookup friends when in nested classes.
9557 Change comments.
9558 * init.c (build_offset_ref): Do lookup even for classes that are
9559 only partially defined.
9560 (decl_constant_value): Remove dead code.
9561 * method.c (build_overload_value): Remove hack where by TYPE was
9562 not a TYPE. Handle PTRMEM_CST.
9563 (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
9564 should go.
9565 * parse.y (components, notype_components, component_decl,
9566 component_decl_1, component_declarator, component_declarator0):
9567 Now all are itype rather than ttype. Rework to add members to
9568 classes on the fly.
9569 (typesqpecqual_reserved): Use check_multiple_declarators.
9570 (structsp): Update class to finish_class_definition.
9571 (do_xref_defn): Unsplit into named_class_head.
9572 (access_specifier): Set current_access_specifier.
9573 * pt.c (set_current_access_from_decl): New function.
9574 (finish_member_template_decl): Don't take the parameters.
9575 (comp_template_args): Make more robust.
9576 (lookup_template_class): Don't use current_local_enum.
9577 (for_each_template_parm): Handle PTRMEM_CST.
9578 (instantiate_class_template): Use set_current_access_from_decl,
9579 finish_member_declaration and unreverse_member_declarations. Set
9580 lineno/input_filename before generating implicit member functions.
9581 (type_unification_real): Don't assume back-unification happens
9582 only for the last argument.
9583 (regenerate_decl_from_template): Call pushclass a bit earlier.
9584 (tsubst_chain): Remove.
9585 (tsubst_enum): Use set_current_access_from_decl.
9586 (set_mangled_name_for_template_decl): Fix indentation.
9587 * search.c (lookup_fnfields_1): Change iteration through
9588 CLASSTYPE_METHOD_VEC.
9589 (dfs_pushdecls): Likewise.
9590 (dfs_compress_decls): Likewise.
9591 (add_conversions): Likewise.
9592 * semantics.c (finish_class_definition): Don't take components.
9593 Change call to finish_struct.
9594 (finish_member_declaration): New function.
9595 (finish_member_class_template): Don't take template parameters.
9596 Change call to grok_x_components. Call finish_member_template_decl.
9597 (check_multiple_declarators): New function.
9598 * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
9599 a passed in fieldlist.
9600 * tree.c (search_tree): Handle PTRMEM_CST.
9601 (mapcar): Likewise.
9602 * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
9603 INTEGER_CSTs, for pointer-to-data members.
9604
9605 * call.c (resolve_args): Resolve template specializations, if
9606 possible.
9607
9608 Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9609
9610 * Makefile.in (spew.o): Depend on toplev.h.
9611
9612 * call.c (compare_ics): Initialize variables `deref_from_type2',
9613 `deref_to_type1' and `deref_to_type2'.
9614
9615 * except.c (get_eh_type): Hide prototype and definition.
9616 (process_start_catch_block_old): Remove unused static prototype.
9617
9618 * pt.c (tsubst_decl): Initialize variable `argvec'.
9619
9620 * spew.c: Include toplev.h.
9621
9622 1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
9623
9624 * pt.c (instantiate_decl): Do save and restore file position.
9625
9626 1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
9627
9628 * method.c (build_decl_overload_real): Clear
9629 numeric_output_need_bar after __.
9630
9631 1998-10-05 Nathan Sidwell <nathan@acm.org>
9632
9633 * call.c (build_new_method_call): Issue 'incomplete type' error,
9634 if class is not defined.
9635
9636 1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9637
9638 * call.c (build_object_call): Move declaration of variable
9639 `fn' into the scope where it is used. Don't access variable
9640 `fn' when it is uninitialized, instead use `fns'.
9641
9642 1998-10-04 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
9643
9644 * errfn.c (cp_thing): Print buf as a string not as a printf format
9645 to avoid problems with the operator%. Consequently, `%%' sequences
9646 in format are copied as `%' in buf.
9647
9648 1998-10-04 Jason Merrill <jason@yorick.cygnus.com>
9649
9650 * pt.c (pop_tinst_level): Call extract_interface_info.
9651 (instantiate_decl): Don't save and restore file position.
9652
9653 * decl.c (cp_finish_decl): Make statics in extern inlines and
9654 templates common, if possible and the target doesn't support weak
9655 symbols.
9656
9657 * decl.c (grokdeclarator): Remove redundant calls to
9658 build_type_variant and some duplicated code.
9659 * sig.c (build_signature_reference_type): Only take the type parm.
9660 (build_signature_pointer_type): Likewise.
9661 * tree.c (build_cplus_method_type): Adjust.
9662 * cp-tree.h: Update.
9663
9664 1998-10-04 Mark Mitchell <mark@markmitchell.com>
9665
9666 * call.c (build_over_call): Make pedwarns about dropped qualifiers
9667 into full-fledged errors.
9668 * cvt.c (convert_to_reference): Likewise.
9669 * typeck.c (convert_for_assignment): Likewise.
9670
9671 * search.c (expand_upcast_vtables): In addition to unsetting
9672 TREE_READONLY, remove top-level const type qualifier.
9673
9674 1998-10-03 Mark Mitchell <mark@markmitchell.com>
9675
9676 * class.c (current_class_ptr, current_class_ref): Clarify
9677 documentation.
9678 * cvt.c (ocp_convert): Don't expect fold to remove all trivial
9679 NOP type conversions.
9680 * decl.c (decls_match): Use comptypes directly; ignore
9681 qualifiers on the DECL.
9682 (duplicate_decls): Remove qualifier checks on DECL.
9683 (grokdeclarator): Make the type built up include top-level
9684 qualifiers.
9685 * decl2.c (do_dtors): Fix spelling error.
9686 * error.c (dump_simple_decl): Don't look at qualifiers on the decl
9687 when printing type information.
9688 * init.c (build_new_1): Add documentation. Deal with the fact
9689 that type of allocated memory now contains qualifiers.
9690 * lex.c (is_global): Improve error-recovery.
9691 * sig.c (build_member_function_pointer): Don't cast away const
9692 on fields of sigtable_entry_type.
9693 * tree.c (lvalue_type): Don't look at top-level qualifiers on
9694 expressions.
9695 * typeck.c (decay_conversion): Likewise.
9696 (build_component_ref): Make sure the type of the COMPONENT_REF
9697 contains top-level qualifiers, as appropriate. Improve
9698 error-handling.
9699 (build_indirect_ref): Simplify. Don't strip top-level qualifiers.
9700 (build_array_ref): Likewise.
9701 (build_unary_op): Improve error-recovery.
9702 (unary_complex_lvalue): Make taking the address a bound member
9703 function an error, not a sorry.
9704 (build_conditional_expr): Look at the type qualifiers, not the
9705 qualifiers on the expression itself.
9706
9707 1998-10-03 Jason Merrill <jason@yorick.cygnus.com>
9708
9709 * decl2.c (merge_functions): Remove duplicates.
9710
9711 * decl2.c: Add -f{no-,}implicit-inline-templates.
9712 (import_export_decl): Check it.
9713
9714 * decl.c (lookup_name_real): Template parms also take precedence
9715 over implicit typename. Only warn if yylex.
9716
9717 * typeck.c (build_conditional_expr): Only fold if ifexp is an
9718 INTEGER_CST.
9719
9720 * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
9721 instead of linkage.
9722
9723 1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
9724
9725 * cp-tree.h (FORMAT_VBASE_NAME): New macro.
9726 * class.c (build_vbase_pointer): Use it.
9727 * rtti.c (expand_class_desc): Likewise.
9728 * tree.c (build_vbase_pointer_fields): Likewise.
9729
9730 Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
9731
9732 * decl.c (start_decl): Add invocation of
9733 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
9734 (start_function): Add invocation of
9735 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
9736
9737 * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with
9738 HANDLE_GENERIC_PRAGMAS.
9739
9740 1998-09-28 Anthony Green <green@cygnus.com>
9741
9742 * semantics.c (finish_asm_stmt): Always permit volatile asms.
9743
9744 1998-09-28 Mark Mitchell <mark@markmitchell.com>
9745
9746 * decl.c (grokdeclarator): Tighten checks for invalid
9747 destructors. Improve error-messages and error-recovery.
9748 * decl2.c (check_classfn): Don't assume that mangled destructor
9749 names contain type information.
9750
9751 1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
9752
9753 * search.c (get_base_distance): Remove assert.
9754
9755 * decl2.c (build_anon_union_vars): Don't process a field with no
9756 name.
9757 (finish_anon_union): Also complain about local anon unions with no
9758 members.
9759
9760 1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
9761
9762 * decl.c (lookup_namespace_name): If the name is a namespace,
9763 return it immediately.
9764
9765 Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9766
9767 * cp-tree.h (define_case_label): Remove unused parameter.
9768 (check_java_method): Likewise.
9769 (grokclassfn): Likewise.
9770 (expand_aggr_init): Likewise.
9771 (build_x_delete): Likewise.
9772 (maybe_end_member_template_processing): Likewise.
9773 (unshare_base_binfos): Add prototype.
9774 (string_conv_p): Likewise.
9775 (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
9776
9777 * cvt.c (build_up_reference): Remove unused parameter
9778 `checkconst', all callers changed.
9779 (build_type_conversion): Mark parameter `code' with
9780 ATTRIBUTE_UNUSED.
9781 (build_expr_type_conversion): Initialize variable `conv'.
9782
9783 * decl.c (push_namespace): Initialize variable `d'.
9784 (define_case_label): Remove unused parameter `decl', all callers
9785 changed.
9786
9787 * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
9788 `argc' with ATTRIBUTE_UNUSED.
9789 (grokclassfn): Remove unused parameter `cname', all callers
9790 changed.
9791 (check_java_method): Likewise for parameter `ctype'.
9792 (copy_assignment_arg_p): Mark parameter `virtualp' with
9793 ATTRIBUTE_UNUSED.
9794 (finish_prevtable_vardecl): Likewise for parameter `prev'.
9795
9796 * expr.c (extract_init): Likewise for parameters `decl' and `init'.
9797
9798 * init.c (expand_aggr_init_1): Remove unused parameter
9799 `alias_this', all callers changed.
9800 (expand_aggr_init): Likewise.
9801 (expand_default_init): Likewise.
9802 (build_new_1): Initialize variable `susp'.
9803 (build_x_delete): Remove unused parameter `type', all callers
9804 changed.
9805
9806 * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
9807 ATTRIBUTE_UNUSED.
9808 (readescape): Use (unsigned) value in shift.
9809 (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when
9810 comparing to a signed quantity.
9811
9812 * pt.c (maybe_end_member_template_processing): Remove unused
9813 parameter `decl', all callers changed.
9814 (check_explicit_specialization): Add braces around empty body in
9815 an else-statement.
9816 (current_template_args): Initialize variable `args'.
9817 (lookup_template_class): Likewise for variable `prev_local_enum'.
9818 (tsubst_decl): Likewise for variable `r'.
9819 (set_mangled_name_for_template_decl): Initialize variable
9820 `context'.
9821
9822 * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
9823 Likewise for variable `i'.
9824 (yylex): Initialize variable `trrr'.
9825
9826 * typeck.c (compparms): Mark variable `strict' with
9827 ATTRIBUTE_UNUSED.
9828
9829 * xref.c (simplify_type): Cast argument of ctype function to
9830 `unsigned char'.
9831
9832 1998-09-24 Mark Mitchell <mark@markmitchell.com>
9833
9834 * cp-tree.h (language_lvalue_valid): Remove.
9835 * decl.c (grokdeclarator): Don't disallow references to functions.
9836 * tree.c (lvalue_p_1): New function, combining duplicated
9837 code from ...
9838 (lvalue_p): Use it.
9839 (real_lvalue_p): Likewise.
9840 * typeck.c (language_lvalue_valid): Remove.
9841 (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
9842 they don't have TREE_READONLY set.
9843 * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
9844
9845 1998-09-24 Benjamin Kosnik <bkoz@loony.cygnus.com>
9846
9847 * spew.c (yylex): Give diagnostic.
9848 * hash.h (is_reserved_word): Add export.
9849 * gxx.gperf: Likewise.
9850 * lex.h (rid): Add RID_EXPORT.
9851 * lex.c (init_parse): Likewise.
9852
9853 Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
9854
9855 * friend.c (do_friend): Make warning a full sentence.
9856
9857 1998-09-22 Mark Mitchell <mark@markmitchell.com>
9858
9859 * parse.y (component_decl_list): Improve error-recovery.
9860
9861 1998-09-22 Benjamin Kosnik <bkoz@loony.cygnus.com>
9862
9863 * decl.c (make_typename_type): Move error to point where name
9864 variable can be used by dump_type.
9865
9866 1998-09-22 Mark Mitchell <mark@markmitchell.com>
9867
9868 * decl.c (grokfndecl): Improve error-recovery.
9869 * decl2.c (grokfield): Likewise.
9870 * pt.c (finish_member_template_decl): Likewise.
9871
9872 1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de>
9873
9874 * method.c (hack_identifier): Finding multiple members is always
9875 an error.
9876
9877 1998-09-21 Per Bothner <bothner@cygnus.com>
9878
9879 * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o.
9880
9881 Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
9882
9883 * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
9884
9885 1998-09-20 Mark Mitchell <mark@markmitchell.com>
9886
9887 * class.c (maybe_warn_about_overly_private_class): Reformat.
9888
9889 1998-09-17 Andrew MacLeod <amacleod@cygnus.com>
9890
9891 * exception.cc (__cplus_type_matcher): Realign some code.
9892
9893 1998-09-16 Mark Mitchell <mark@markmitchell.com>
9894
9895 * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
9896 (tinfo2.o): Likewise.
9897 (exception.o): Likewise.
9898 (new.o): Likewise.
9899 (opnew.o): Likewise.
9900 (opnewnt.o): Likewise.
9901 (opvnew.o): Likewise.
9902 (opvnewnt.o): Likewise.
9903 (opdel.o): Likewise.
9904 (opdelnt.o): Likewise.
9905 (opvdel.o): Likewise.
9906 (opvdelnt.o): Likewise.
9907
9908 1998-09-16 Richard Henderson <rth@cygnus.com>
9909
9910 * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
9911
9912 1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
9913
9914 * call.c (build_field_call): Handle static data members too.
9915
9916 * typeck.c (comptypes): When comparing pointer types, check
9917 whether referred types match even in strictest modes.
9918
9919 1998-09-15 Mark Mitchell <mark@markmitchell.com>
9920
9921 * cp-tree.h: Revert previous change.
9922 (finish_struct_methods): Remove declaration.
9923 * class.c: Revert previous change.
9924 (maybe_warn_about_overly_private_class): New function.
9925 (finish_struct_methods): Declare here, and make static. Remove
9926 unnecessary parameters. Tidy slightly. Use
9927 maybe_warn_about_overly_private_class.
9928 (finish_struct_1): Adjust. Remove check for private constructors,
9929 now done elsewhere.
9930 (finish_struct): Adjust.
9931
9932 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
9933
9934 * except.c (expand_start_catch_block): No need to check for new
9935 exception model.
9936 (process_start_catch_block_old): Deleted.
9937 (process_start_catch_block): Add call to start_decl_1().
9938 (expand_end_catch_block): Add call to end_catch_handler().
9939 * exception.cc (__cplus_type_matcher): Only check the exception
9940 language if there is an exception table.
9941
9942 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
9943
9944 * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
9945 as used to prevent conflicts with virtual function tables.
9946
9947 1998-09-14 Mark Mitchell <mark@markmitchell.com>
9948
9949 * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
9950 (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
9951 * class.c (maybe_class_too_private_p): New function.
9952 (finish_struct_methods): Use it.
9953 (finish_struct_1): Likewise.
9954 (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
9955 appropriate.
9956
9957 * pt.c (check_specialization_scope): Fix spelling error.
9958 (check_explicit_specialization): Remove code to handle explicit
9959 specializations in class scope; they are now correctly diagnosed
9960 as errors.
9961
9962 1998-09-10 Mark Mitchell <mark@markmitchell.com>
9963
9964 * decl.c (pushdecl): Don't copy types if the
9965 DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
9966 type.
9967
9968 1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
9969
9970 * class.c (get_enclosing_class): New function.
9971 (is_base_of_enclosing_class): Likewise.
9972 * cp-tree.h (get_enclosing_class): Declare.
9973 (is_base_of_enclosing_class): Likewise.
9974 * pt.c (coerce_template_parms): Use them.
9975
9976 1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
9977
9978 * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
9979 null to decide whether to use it.
9980
9981 * error.c (dump_type_real): Handle NAMESPACE_DECL.
9982 * parse.y (base_class.1): Avoid crash on error.
9983
9984 1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
9985
9986 * decl.c (make_typename_type): If context is a namespace, the code
9987 is in error.
9988
9989 1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
9990
9991 * parse.y (nomods_initdcl0): Set up the parser stack correctly.
9992
9993 1998-09-08 Mark Mitchell <mark@markmitchell.com>
9994
9995 * cp-tree.h (anonymous_namespace_name): Declare.
9996 * decl.c: Define it.
9997 (push_namespace): Use anonymous_namespace_name, rather than local
9998 static anon_name.
9999 * error.c (dump_decl): If a namespace is named
10000 anonymous_namespace_name, call it {anonymous}.
10001
10002 * decl.c (grokparms): Distinguish between references and pointers
10003 in error message.
10004
10005 1998-09-08 Richard Henderson <rth@cygnus.com>
10006 Mark Mitchell <mark@markmitchell.com>
10007
10008 * pt.c (process_partial_specialization): Consistently allocate
10009 and zero tpd.parms based on ntparms. Use tpd2.parms, not
10010 tpd.parms, where appropriate.
10011
10012 Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
10013
10014 * Makefile.in (INCLUDES): Update after recent toplevel gcc
10015 reorganizations.
10016
10017 1998-09-05 Mark Mitchell <mark@markmitchell.com>
10018
10019 * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
10020 * class.c (finish_struct): Remove hackery to deal with explicit
10021 specializations in class scope.
10022 * decl.c (grokfndecl): Improve error-recovery.
10023 * decl2.c (grokfield): Likewise.
10024 * pt.c (check_specialization_scope): New function.
10025 (begin_specialization): Call it.
10026 (process_partial_specialization): New function, split out from
10027 push_template_decl. Check partial specializations more
10028 stringently.
10029 (push_template_decl): Call it.
10030 (check_explicit_specialization): Don't attempt to handle explicit
10031 specializations in class scope.
10032 (template_parm_data): Document. Add current_arg and
10033 arg_uses_template_parms.
10034 (mark_template_parm): Set it.
10035 (tsubst_arg_types): Remove unused variable.
10036 * semantics.c (begin_class_definition): Tweak.
10037
10038 1998-09-04 Mark Mitchell <mark@markmitchell.com>
10039
10040 * inc/typeinfo (type_info::type_info(const char*)): Make
10041 `explicit'.
10042
10043 * cp-tree.h (hash_tree_cons_simple): New macro.
10044 * pt.c (tsubst_arg_types): New function. Use hash_tree_cons.
10045 (coerce_template_parms): Use make_temp_vec, instead of
10046 make_tree_vec. Document this behavior.
10047 (lookup_template_class): Likewise.
10048 (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
10049 Remove dead code (and add assertion to check its deadness). Fix
10050 bug w.r.t. exception specifications.
10051
10052 1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
10053
10054 * decl2.c (import_export_vtable): Always make artificials comdat.
10055 (import_export_decl): Likewise.
10056 * pt.c (mark_decl_instantiated): Likewise.
10057
10058 1998-09-03 Mark Mitchell <mark@markmitchell.com>
10059
10060 * cp-tree.h (finish_globally_qualified_member_call_expr):
10061 Rename to ...
10062 (finish_qualified_call_expr).
10063 * semantics.c: Likewise.
10064 * parse.y (primary): Use it.
10065 * method.c (hack_identifier): Remove redundant code.
10066
10067 * init.c (resolve_offset_ref): Call convert_from_reference to
10068 handle members of reference type. Improve error recovery.
10069
10070 1998-09-03 Benjamin Kosnik <bkoz@cygnus.com>
10071
10072 * cp-tree.h: Declare warn_nontemplate_friend.
10073 * decl2.c (lang_decode_option): Set.
10074 * lang-options.h: Add -Wnon-template-friend.
10075 * friend.c (do_friend): Use to toggle non-template function warning.
10076
10077 1998-09-03 Mark Mitchell <mark@markmitchell.com>
10078
10079 * decl.c (finish_enum): Don't resolve CONST_DECLs to their
10080 corresponding INTEGER_CSTs when processing_template_decl.
10081 * pt.c (tsubst_enum): Tweak accordingly.
10082
10083 1998-09-03 Benjamin Kosnik <bkoz@rhino.cygnus.com>
10084
10085 * decl.c (pushdecl_class_level): Add warning here.
10086 (pushdecl): Tweak.
10087
10088 1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
10089
10090 * cvt.c (convert_pointer_to_real): Tidy.
10091 * search.c (get_base_distance_recursive): Simplify.
10092 (get_base_distance): Likewise.
10093
10094 * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
10095 parms.
10096
10097 Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
10098
10099 * lex.c (check_newline): Call HANDLE_PRAGMA before
10100 HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
10101 if unknown pragmas are encountered.
10102 (handle_sysv_pragma): Interpret return code from
10103 handle_pragma_token (). Return success/failure indication rather
10104 than next unprocessed character.
10105 (pragma_getc): New function: retrieves characters from the
10106 input stream. Defined when HANDLE_PRAGMA is defined.
10107 (pragma_ungetc): New function: replaces characters back into the
10108 input stream. Defined when HANDLE_PRAGMA is defined.
10109
10110 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
10111
10112 * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
10113 * class.c (build_vtable_entry_ref): Likewise.
10114
10115 1998-09-01 Mark Mitchell <mark@markmitchell.com>
10116
10117 * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
10118 * decl2.c (import_export_decl): Likewise.
10119 * pt.c (instantiate_decl): Use it.
10120
10121 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
10122
10123 * decl.c (lookup_name_real): Also do implicit typename thing for
10124 artificial TYPE_DECLs.
10125 * search.c (lookup_field): Likewise.
10126 (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
10127 * semantics.c (begin_constructor_declarator): Use enter_scope_of.
10128 (enter_scope_of): Extract type from implicit typename.
10129 (begin_class_definition): Likewise.
10130 * lex.c (identifier_type): Handle implicit typename when checking
10131 for SELFNAME.
10132
10133 * cp-tree.h: Declare flag_strict_prototype.
10134 * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
10135 -fstrict-prototype.
10136 * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
10137 specified, set it to the value of pedantic.
10138
10139 1998-09-01 Mark Mitchell <mark@markmitchell.com>
10140
10141 * decl2.c (arg_assoc): Handle template-id expressions as arguments.
10142
10143 1998-08-31 Mark Mitchell <mark@markmitchell.com>
10144
10145 * decl.c (finish_enum): Handle member enums of classes declared in
10146 template functions.
10147
10148 * decl2.c (grok_x_components): Strip attributes before calling
10149 groktypename.
10150
10151 1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
10152
10153 * cp-tree.h, decl2.c: Remove support for -fall-virtual,
10154 -fenum-int-equivalence and -fno-nonnull-objects.
10155 * class.c (check_for_override): Remove support for -fall-virtual.
10156 (finish_struct_1): Likewise.
10157 * call.c (build_new_op): Remove support for -fenum-int-equivalence.
10158 * typeck.c (build_binary_op_nodefault): Likewise.
10159 * cvt.c (ocp_convert): Likewise.
10160 * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
10161 * class.c (build_vbase_path): Likewise.
10162
10163 Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
10164
10165 * Makefile.in (INTERFACE): New, set to 1.
10166
10167 1998-08-30 Mark Mitchell <mark@markmitchell.com>
10168
10169 * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
10170 comparing with global_namespace.
10171 (dump_aggr_type): Likewise.
10172
10173 * decl.c (grokfndecl): Issue error on declaration of friend
10174 templates with explicit template arguments.
10175
10176 * pt.c (convert_template_argument): New function, split out
10177 from...
10178 (coerce_template_parms): Here.
10179 (tsubst): Attempt better error-recovery.
10180
10181 1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com>
10182
10183 * pt.c (decl_template_parm_p): Add checks for
10184 TEMPLATE_TEMPLATE_PARM.
10185
10186 1998-08-28 Mark Mitchell <mark@markmitchell.com>
10187
10188 * lex.c (do_identifier): Fix thinko in previous change.
10189
10190 1998-08-28 Jason Merrill <jason@yorick.cygnus.com>
10191
10192 * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
10193 * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
10194
10195 1998-08-28 Richard Henderson <rth@cygnus.com>
10196
10197 Add support for discarding unused virtual functions.
10198 * lang-options.h: Add -fvtable-gc.
10199 * cp-tree.h: Add flag_vtable_gc.
10200 * decl2.c (output_vtable_inherit): New fn.
10201 (finish_vtable_vardecl): Call it.
10202 * class.c (build_vtable_entry_ref): New fn.
10203 (build_vtbl_ref): Call it.
10204
10205 1998-08-28 Mark Mitchell <mark@markmitchell.com>
10206
10207 * cp-tree.h (build_enumerator): Take the enumeration type as a
10208 parameter.
10209 * decl.c (finish_enum): Don't set the TREE_TYPE for the
10210 enumeration constant values if we're processing_template_decls.
10211 Don't set the type for the CONST_DECLs either; that's done in
10212 build_enumerator.
10213 (build_enumerator): Take the enumeration type as a
10214 parameter.
10215 * lex.c (do_identifier): Don't resolve enumeration constants while
10216 processing template declarations, even if they happen to be
10217 TEMPLATE_PARM_INDEXs.
10218
10219 * parse.y (current_enum_type): New variable.
10220 (primary): Don't allow statement-expression in local classes just
10221 as we don't in global classes.
10222 (structsp): Use current_enum_type.
10223 (enum_list): Likewise.
10224 * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
10225 finish_enum; they no longer occur.
10226
10227 * cp-tree.h (finish_base_specifier): New function.
10228 * parse.y (base_class): Use it.
10229 * semantics.c (finish_base_specifier): Define it.
10230
10231 * parse.y (structsp): Warn on use of typename outside of template
10232 declarations.
10233
10234 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
10235
10236 * lex.c (handle_cp_pragma): Remove #pragma vtable.
10237 * lang-options.h: Remove +e options.
10238 * decl2.c (lang_decode_option): Likewise.
10239 (import_export_vtable): Don't check write_virtuals.
10240 (finish_vtable_vardecl, finish_file): Likewise.
10241 * search.c (dfs_debug_mark): Likewise.
10242 * semantics.c (begin_class_definition): Likewise.
10243 * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
10244
10245 * call.c (build_over_call): Check flag_elide_constructors.
10246 * decl2.c: flag_elide_constructors defaults to 1.
10247 * typeck.c (convert_arguments): Remove return_loc parm.
10248 (build_function_call_real): Adjust.
10249
10250 * search.c: Tear out all mi_matrix and memoize code.
10251 (lookup_field, lookup_fnfields): Use scratch_tree_cons.
10252 * lang-options.h: Remove documentation for -fhandle-exceptions,
10253 -fmemoize-lookups and -fsave-memoized.
10254 * cp-tree.h: Lose mi_matrix and memoize support.
10255 * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
10256 * class.c: Lose struct class_level.
10257 (pushclass, popclass): Lose memoize support.
10258 * init.c (build_offset_ref): Likewise.
10259
10260 Never change BINFO_INHERITANCE_CHAIN.
10261 * init.c (emit_base_init): Change modification of
10262 BINFO_INHERITANCE_CHAIN to an assert.
10263 * search.c (get_base_distance_recursive): Likewise.
10264 (get_base_distance): Likewise.
10265 (lookup_member): Likewise.
10266 (convert_pointer_to_single_level): Likewise.
10267 (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs.
10268 (lookup_fnfields): Likewise.
10269 * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
10270 (unshare_base_binfos): Don't call propagate_binfo_offsets.
10271 (layout_basetypes): Call propagate_binfo_offsets instead of
10272 unshare_base_binfos.
10273 * decl.c (xref_basetypes): Call unshare_base_binfos.
10274 * pt.c (instantiate_class_template): Likewise.
10275 * tree.c (reverse_path): Remove 'copy' parm; always make a
10276 temporary copy.
10277 * class.c (build_vbase_path): Just call it.
10278 * search.c (compute_access): Likewise. Don't re-reverse.
10279
10280 1998-08-27 Mark Mitchell <mark@markmitchell.com>
10281
10282 * class.c (build_vbase_path): Use reverse_path.
10283 (finish_base_struct): Move warnings for inaccessible bases to
10284 layout_basetypes.
10285 (modify_one_vtable): Remove check of TREE_USED (binfo).
10286 (fixup_vtable_deltas1): Likewise.
10287 * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
10288 (xref_tag): Remove binfos parameter.
10289 (make_binfo): Remove chain parameter.
10290 (reverse_path): Add copy parameter.
10291 * decl.c (init_decl_processing): Change calls to xref_tag.
10292 (xref_tag): Remove binfos parameter.
10293 (xref_basetypes): Change calls to make_binfo.
10294 * decl2.c (grok_x_components): Change calls to xref_tag.
10295 (handle_class_head): Likewise.
10296 * friend.c (do_friend): Likewise.
10297 * lex.c (make_lang_type): Change calls to make_binfo.
10298 * parse.y (structsp): Change calls to xref_tag.
10299 (named_complex_class_head_sans_basetype): Likewise.
10300 (named_class_head): Likewise.
10301 * rtti.c (init_rtti_processing): Likewise.
10302 * search.c (compute_access): Change calls to reverse_path.
10303 (dfs_get_vbase_types): Change calls to make_binfo.
10304 (get_vbase_types): Remove dead code.
10305 * tree.c (unshare_base_binfos): Change calls to make_binfo.
10306 (layout_basetypes): Warn here about inaccessible bases.
10307 (make_binfo): Remove chain parameter.
10308 (reverse_path): Add copy parameter.
10309
10310 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
10311
10312 * class.c: #if 0 complete_type_p.
10313 * init.c (build_java_class_ref, build_new_1): Remove unused locals.
10314 * method.c (process_overload_item): Likewise.
10315 * typeck.c (comp_target_types): Likewise.
10316
10317 Stop sharing binfos for indirect virtual bases.
10318 * tree.c (propagate_binfo_offsets): Unshare vbases, too.
10319 (layout_basetypes): Likewise.
10320 (unshare_base_binfos): Copy vbases, too.
10321 * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
10322 BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
10323 (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
10324 CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
10325 * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
10326 reference to BINFO_VIA_PUBLIC.
10327 (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
10328 (push_class_decls): Use them.
10329 (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
10330 (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
10331
10332 1998-08-27 Mark Mitchell <mark@markmitchell.com>
10333
10334 * decl.c (build_enumerator): Set DECL_CONTEXT for the
10335 CONST_DECLs.
10336
10337 1998-08-26 Mark Mitchell <mark@markmitchell.com>
10338
10339 * cp-tree.h (finish_enum): Change prototype.
10340 * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
10341 VALUES parameter. Don't try to compute mins/maxs if
10342 processing_template_decl.
10343 * parse.y (structsp): Use new calling sequence for finish_enum.
10344 * pt.c (tsubst_enum): Likewise. Take the new type as input.
10345 (lookup_template_class): Remove unused variables. Tweak.
10346 Register enums on instantiation list before substituting
10347 enumeration constants.
10348 (tsubst_decl): Remove unused variables.
10349 (regenerate_decl_from_template): Likewise.
10350
10351 * decl.c (duplicate_decls): Don't obliterate the
10352 DECL_TEMPLATE_INFO for a template if we're not replacing it with
10353 anything.
10354
10355 * lex.c (do_identifier): Fix typo in comment.
10356
10357 Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10358
10359 * errfn.c: Remove stdarg.h/varargs.h.
10360 * tree.c: Likewise.
10361
10362 1998-08-25 Brendan Kehoe <brendan@cygnus.com>
10363
10364 * pt.c (tsubst_copy): Only do typename overloading on an
10365 IDENTIFIER_NODE that happens to look like a typename if it actually
10366 has a type for us to use.
10367
10368 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
10369
10370 * typeck.c (comp_cv_target_types): Split out...
10371 (comp_target_types): From here. Don't allow cv-qual changes under
10372 a pointer if nptrs == 0. Fix OFFSET_TYPE handling.
10373 (build_ptrmemfunc): Pass 1 to nptrs.
10374 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
10375
10376 1998-08-25 Mark Mitchell <mark@markmitchell.com>
10377
10378 * search.c (dependent_base_p): Don't compare a binfo to
10379 current_class_type; use the TREE_TYPE of the binfo instead.
10380
10381 * cp-tree.h (CLASS_TYPE_P): Revise definition.
10382
10383 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
10384
10385 * decl.c (duplicate_decls): Don't complain about different
10386 exceptions from an internal decl even if pedantic.
10387
10388 * typeck.c (convert_for_assignment): Converting from pm of vbase
10389 to derived is an error, not a sorry.
10390
10391 * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
10392 * class.c (fixed_type_or_null): Rename from
10393 resolves_to_fixed_type_p. Return the dynamic type of the
10394 expression, if fixed, or null.
10395 (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type
10396 does not match the static type.
10397 (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use
10398 resolves_to_fixed_type_p again.
10399
10400 1998-08-24 Mark Mitchell <mark@markmitchell.com>
10401
10402 * pt.c (tsubst_decl): Move special case code for dealing with
10403 tricky friend templates here from ...
10404 (regenerate_decl_from_template): Here.
10405
10406 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
10407
10408 * decl.c (start_decl): Remove redundant linkage check.
10409
10410 1998-08-24 Gavin Romig-Koch <gavin@cygnus.com>
10411
10412 * typeck.c (c_expand_return): Handle the case that valtype
10413 is wider than the functions return type.
10414
10415 1998-08-24 Mark Mitchell <mark@markmitchell.com>
10416
10417 * cp-tree.h (CLASS_TYPE_P): New macro.
10418 * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
10419 * pt.c (process_template_parm): Undo previous change.
10420
10421 1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
10422
10423 * cp-tree.h: Declare.
10424 * pt.c (decl_template_parm_p): New function.
10425 * decl.c (pushdecl): Check decls for redeclaring template parms.
10426 (xref_tag): Make redeclaration an error, print decl.
10427 * decl2.c (grokfield): Check field_decls for redeclaration as well.
10428
10429 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
10430
10431 * parse.y (primary): Fix up the type of string constants.
10432
10433 1998-08-24 Mark Mitchell <mark@markmitchell.com>
10434
10435 * typeck.c (convert_for_initialization): Move check for odd uses
10436 of NULL to avoid duplicate warnings.
10437
10438 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
10439
10440 * tree.c (lvalue_type): Fix for arrays.
10441 * typeck.c (string_conv_p): New fn.
10442 (convert_for_assignment): Use it.
10443 (build_unary_op): Use lvalue_type.
10444 * call.c (standard_conversion, convert_like): Use string_conv_p.
10445 (add_function_candidate): Use lvalue_type.
10446 * cvt.c (convert_to_reference): Likewise.
10447 * decl2.c (lang_decode_option): Ignore -traditional.
10448 * decl.c (init_decl_processing): flag_writable_strings inhibits
10449 flag_const_strings.
10450
10451 1998-08-24 Andrew MacLeod <amacleod@cygnus.com>
10452
10453 * lang-options.h (lang_options): Add fconst-strings to the list
10454 of valid options.
10455 * decl2.c (lang_f_options, lang_decode_option): Likewise.
10456
10457 1998-08-24 Nathan Sidwell <nathan@acm.org>
10458
10459 * lex.c (real_yylex): Don't warn about long long constants if
10460 we're allowing long long.
10461
10462 1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
10463
10464 * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
10465 accessing bindings directly.
10466
10467 * search.c (my_tree_cons): Reimplement.
10468
10469 * lang-specs.h: Remove __HONOR_STD.
10470 * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
10471
10472 1998-08-23 Mark Mitchell <mark@markmitchell.com>
10473
10474 * decl.c (grokdeclarator): Complain about in-class initialization
10475 of aggregates and/or references.
10476 * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
10477 TEMPLATE_TYPE_PARMs.
10478
10479 * decl2.c (grok_array_decl): Add comment.
10480 (mark_used): Don't instantiate an explicit instantiation.
10481 * friend.c (make_friend_class): Remove bogus comment. Fix check
10482 for partial specializations.
10483 * pt.c (check_explicit_specialization): Don't
10484 SET_DECL_EXPLICIT_INSTANTIATION here.
10485 (mark_decl_instantiated): Or here.
10486 (do_decl_instantiation): Do it here, instead. Add checks for
10487 duplicate explicit instantiations, etc. Tidy.
10488 (do_type_instantiation): Likewise.
10489 (instantiate_decl): Improve comments. Complain about explicit
10490 instantiations where no definition is available.
10491
10492 * cp-tree.h (ansi_null_node): Remove.
10493 * call.c (build_over_call): Warn about converting NULL to an
10494 arithmetic type.
10495 * cvt.c (build_expr_type_conversion): Likewise. Use
10496 null_ptr_cst_p instead of expanding it inline.
10497 * decl.c (ansi_null_node): Remove.
10498 (init_decl_processing): Make null_node always have integral type.
10499 * except.c (build_throw): Warn about converting NULL to an
10500 arithmetic type.
10501 * lex.c (init_parse): Remove handling of ansi_null_node.
10502 * pt.c (type_unification_real): Don't convert NULL to void* type.
10503 * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
10504 (convert_for_assignment): Warn about converting NULL to an
10505 arithmetic type.
10506 (convert_for_initialization): Likewise.
10507
10508 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
10509
10510 * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
10511 * pt.c (coerce_template_parms): Use no_linkage_check.
10512 * decl.c (grokvardecl): Likewise.
10513 (grokfndecl): Likewise. Members of anonymous types have no linkage.
10514
10515 * method.c (process_overload_item): Remove useless code.
10516
10517 1998-08-20 Per Bothner <bothner@cygnus.com>
10518
10519 Handle new'ing of Java classes.
10520 * init.c (build_class_classref): New function.
10521 (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject;
10522 constructor does not return this; don't need to exception-protect.
10523
10524 * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag.
10525 * decl2.c (acceptable_java_type): Handle template-derived types.
10526
10527 1998-08-20 Per Bothner <bothner@cygnus.com>
10528
10529 * decl2.c (import_export_vtable): Suppress vtables for Java classes.
10530
10531 1998-08-20 Mark Mitchell <mark@markmitchell.com>
10532
10533 * decl.c (duplicate_decls): Always merge the old and new patterns
10534 for templates, regardless of whether or not the new one has
10535 DECL_INITIAL. Don't throw away specializations. Merge
10536 DECL_SAVED_TREE.
10537 * pt.c (tsubst_decl): Use the right pattern when calculating the
10538 complete args for a new template instance.
10539 (do_decl_instantiation): Fix typo in comment.
10540 (regenerate_decl_from_template): Deal with tricky friend template
10541 case.
10542 (instantiate_decl): Likewise.
10543
10544 Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com)
10545
10546 * init.c (build_builtin_delete_call): Add missing assemble_external
10547 call.
10548
10549 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
10550
10551 * parse.y (notype_unqualified_id): Also accept ~A<int>.
10552
10553 1998-08-19 Mark Mitchell <mark@markmitchell.com>
10554
10555 * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
10556 arithmetic.
10557 * except.c (build_throw): Warn when NULL is thrown, even with
10558 -ansi. Use ansi_null_node, rather than integer_zero_node, in the
10559 thrown expression.
10560
10561 * cp-tree.h (ansi_null_node): New variable.
10562 * decl.c (ansi_null_node): New variable.
10563 (init_decl_processing): Initialize its type.
10564 * lex.c (init_parse): Initialize its value. Use ansi_null_node
10565 for null_node in non-ANSI mode.
10566 * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
10567 place of null_node to avoid spurious errors.
10568
10569 1998-08-17 Mark Mitchell <mark@markmitchell.com>
10570
10571 * cp-tree.h (enter_scope_of): New function.
10572 * parse.y (complex_direct_notype_declarator): Use it.
10573 * semantics.c (enter_scope_of): New function.
10574
10575 1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
10576
10577 * decl.c (grokparms): No, here.
10578
10579 * decl.c (grokdeclarator): Catch parm with pointer to array of
10580 unknown bound here...
10581 * method.c (process_overload_item): ...not here.
10582
10583 * gxxint.texi: Remove obsolete documentation of overloading code.
10584
10585 * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
10586 * class.c (finish_struct_bits): Likewise.
10587
10588 * tree.c (lvalue_type): Fix for arrays.
10589 * typeck.c (build_unary_op): Use lvalue_type.
10590 * call.c (add_function_candidate): Likewise.
10591 * cvt.c (convert_to_reference): Likewise.
10592
10593 * decl2.c (lang_decode_option): Ignore -traditional.
10594
10595 * init.c (build_offset_ref): Don't mess with error_mark_node.
10596 * lex.c (do_scoped_id): Use cp_error.
10597
10598 * rtti.c (get_tinfo_fn): Don't mess with the context for now.
10599
10600 1998-08-17 Benjamin Kosnik <bkoz@loony.cygnus.com>
10601
10602 * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
10603
10604 Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com)
10605
10606 * cp-tree.h (set_identifier_local_value): Provide prototype.
10607
10608 * decl2.c (do_namespace_alias): Remove unused variables `binding'
10609 and `old'.
10610
10611 Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com>
10612
10613 * Makefile.in: Rename BBISON to BISON so that it can be properly
10614 inherited from the parent makefile.
10615
10616 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
10617
10618 * lang-options.h: Add -finit-priority.
10619 * decl2.c: Likewise. Check flag_init_priority instead of
10620 USE_INIT_PRIORITY.
10621
10622 * decl2.c (setup_initp): New fn.
10623 (start_objects, finish_objects, do_ctors): Handle init_priority.
10624 (do_dtors, finish_file): Likewise.
10625
10626 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
10627
10628 * pt.c (tsubst_copy): Hush warning.
10629
10630 * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
10631
10632 1998-08-12 Mark Mitchell <mark@markmitchell.com>
10633
10634 * pt.c (print_template_context): Don't abort when instantiating a
10635 synthesized method.
10636
10637 * decl.c (grokdeclarator): Issue errors on namespace qualified
10638 declarators in parameter lists or in class scope.
10639
10640 1998-08-09 Mark Mitchell <mark@markmitchell.com>
10641
10642 * pt.c (check_explicit_specialization): Don't abort on bogus
10643 explicit instantiations.
10644
10645 1998-08-07 Mark Mitchell <mark@markmitchell.com>
10646
10647 * typeck.c (require_complete_type): Use complete_type_or_else.
10648 (complete_type_or_else): Always return NULL_TREE on failure, as
10649 documented.
10650
10651 * pt.c (tsubst_aggr_type): Prototype.
10652 (tsubst_decl): New function, split out from tsubst. Set
10653 input_filename and lineno as appropriate.
10654 (pop_tinst_level): Restore the file and line number saved in
10655 push_tinst_level.
10656 (instantiate_class_template): Set input_filename and lineno as
10657 appropriate.
10658 (tsubst): Move _DECL processing to tsubst_decl. Make sure the
10659 context for a TYPENAME_TYPE is complete.
10660
10661 * decl2.c (grokbitfield): Issue errors on bitfields declared with
10662 function type.
10663 (do_dtors): As in do_ctors, pretend to be a member of the same
10664 class as a static data member while generating a call to its
10665 destructor.
10666
10667 * cvt.c (cp_convert_to_pointer): Handle NULL pointer
10668 conversions, even in complex virtual base class hierarchies.
10669
10670 1998-08-06 Mark Mitchell <mark@markmitchell.com>
10671
10672 * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
10673 (TYPE_TEMPLATE_INFO): Likewise.
10674 (SET_TYPE_TEMPLATE_INFO): Likewise.
10675 (ENUM_TI_TEMPLATE): Likewise.
10676 (ENUM_TI_ARGS): Likewise.
10677 (lookup_nested_type_by_name): Remove.
10678 * decl.c (maybe_process_template_type_declaration): Handle enums.
10679 (start_enum): Don't check for primary-template enum declarations
10680 here.
10681 (finish_enum): Clean up, document. Make sure template enum
10682 constants get the correct type.
10683 (build_enumerator): Copy initializers for template enumerations,
10684 too.
10685 (grok_enum_decls): Document.
10686 * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
10687 better. Build LOOKUP_EXPRs for local variables, even if they are
10688 TREE_PERMANENT.
10689 * pt.c (tsubst_enum): Remove field_chain parameter.
10690 (template_class_depth): Include the depth of surrounding function
10691 contexts.
10692 (push_template_decl): Check for primary-template enum declarations
10693 here. Deal with enumeration templates.
10694 (lookup_template_class): Likewise.
10695 (for_each_template_parm): Likewise.
10696 (instantiate_class_template): Don't call tsubst_enum directly,
10697 call tsubst instead, to instantiate enums. Deal with all
10698 field_chain issues here, not in tsubst_enum.
10699 (lookup_nested_type_by_name): Remove.
10700 (tsubst_aggr_type): Revise handling of enumeration types.
10701 (tsubst): Likewise.
10702 (tsubst_copy): Likewise.
10703 (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
10704
10705 1998-08-04 Mark Mitchell <mark@markmitchell.com>
10706
10707 * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
10708 uses template parameters.
10709 * method.c (build_template_parm_names): Use the full set of
10710 template arguments for tsubst'ing.
10711 (build_overload_identifier): Pass the full set of template
10712 arguments to build_template_parm_names, not just the
10713 innermost_args.
10714 * pt.c (TMPL_ARGS_DEPTH): Define using
10715 TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
10716 (NUM_TMPL_ARGS): New macro.
10717 (add_outermost_template_args): Deal with the case where the outer
10718 args will be completely discarded.
10719 (coerce_template_parms): Use the full set of template arguments
10720 for tsubst'ing. Simplify. Add some asserts. Improve
10721 error messages.
10722 (lookup_template_class): Pass the full set of template arguments
10723 to coerce_template_parms.
10724 (tsubst): Add assertion.
10725 (do_type_instantiation): Don't instantiate member template
10726 classes.
10727
10728 * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
10729 name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
10730
10731 1998-08-03 Jason Merrill <jason@yorick.cygnus.com>
10732
10733 * method.c (set_mangled_name_for_decl): Change return type to void.
10734
10735 * decl.c (lookup_name_real): A namespace-level decl takes priority
10736 over implicit typename. Avoid doing the same lookup twice.
10737
10738 * search.c (dependent_base_p): New fn.
10739 (dfs_pushdecls, dfs_compress_decls): Use it.
10740
10741 * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
10742 virtual functions if the type doesn't have any.
10743
10744 1998-08-03 Mark Mitchell <mark@markmitchell.com>
10745
10746 * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
10747 uses template parameters.
10748
10749 1998-08-02 Mark Mitchell <mark@markmitchell.com>
10750
10751 * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument.
10752 * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
10753 * lex.c (do_identifier): Don't use a second argument, or a type,
10754 when building LOOKUP_EXPRs.
10755 (do_identifier): Likewise.
10756 (do_scoped_id): Likewise.
10757 * method.c (hack_identifier): Improve error message.
10758 * pt.c (lookup_template_function): Don't needlessly call
10759 copy_to_permanent or build_min.
10760 (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if
10761 necessary.
10762 (do_decl_instantiation): Improve error message.
10763 * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
10764 (build_min): Copy the type to the permanent obstack, too.
10765
10766 1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
10767
10768 * init.c (init_init_processing): Remove BI* handling.
10769 (build_builtin_call): Remove.
10770 (build_builtin_delete_call): New fn.
10771 (build_delete): Use it.
10772
10773 1998-07-31 Mark Mitchell <mark@markmitchell.com>
10774
10775 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
10776 (maybe_check_template_type): New function.
10777 * decl.c (maybe_process_template_type_declaration): New function,
10778 split out from pushtag Call maybe_check_template_type.
10779 (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P.
10780 (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
10781 * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
10782 * pt.c (template_class_depth_real): Generalization of ...
10783 (template_class_depth): Use it.
10784 (register_specialization): Use duplicate_decls for duplicate
10785 declarations of specializations.
10786 (maybe_check_template_type): New function.
10787 (push_template_decl_real): Fix comment.
10788 (convert_nontype_argument): Likewise.
10789 (lookup_template_class): Likewise. Avoid an infinite loop on
10790 erroneous code.
10791 (tsubst_friend_function): Fix comment.
10792 (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
10793 an IDENTIFIER_NODE.
10794 * semantics.c (begin_function_definition): Use
10795 reset_specialization to note that template headers don't apply
10796 directly to declarations after the opening curly for a function.
10797
10798 1998-07-29 Jason Merrill <jason@yorick.cygnus.com>
10799
10800 * decl.c (push_overloaded_decl): Use current_namespace instead of
10801 DECL_CONTEXT (decl) to determine where we go.
10802
10803 * decl.c (lookup_name_real): Fix typo.
10804
10805 1998-07-28 Mark Mitchell <mark@markmitchell.com>
10806
10807 * friend.c (is_friend): Be lenient with member functions to deal
10808 with nested friends.
10809
10810 1998-07-28 Jason Merrill <jason@yorick.cygnus.com>
10811
10812 * class.c (finish_struct_1): Convert integer_zero_node to
10813 ssizetype before passing it to set_rtti_entry.
10814 * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
10815 of any size to a pointer.
10816
10817 1998-07-27 Mark Mitchell <mark@markmitchell.com>
10818
10819 * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
10820 (build_template_decl_overload): Remove.
10821 (set_mangled_name_for_decl): New function.
10822 (innermost_args): Remove is_spec parameter.
10823 (most_specialized, most_specialized_class): Remove declarations.
10824 (lookup_template_class): Add entering_scope parameter.
10825 (maybe_process_partial_specialization): New function.
10826 (finish_template_decl): Likewise.
10827 (finish_template_type): Likewise.
10828 * class.c (finish_struct): Clean up processing of member template
10829 specializations.
10830 * decl.c (pushtag): Fix formatting.
10831 (lookup_tag): Improve handling of pseudo-global levels.
10832 (make_typename_type): Adjust call to lookup_template_class.
10833 (shadow_tag): Use maybe_process_partial_specialization.
10834 (xref_tag): Improve handling of member friends.
10835 (start_function): Call push_nested_class before
10836 push_template_decl. Don't call push_template_decl for
10837 specializations.
10838 * decl2.c (grok_x_components): Don't call xref_tag for
10839 template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
10840 (grokclassfn): Use set_mangled_name_for_decl.
10841 (arg_assoc_class): Adjust call to innermost_args.
10842 (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
10843 * error.c (dump_function_name): Improve printing of template
10844 function names.
10845 * friend.c (is_friend): Don't compare types of decls to determine
10846 friendship, unless flag_guiding_decls.
10847 (make_friend_class): Partial specializations cannot be friends.
10848 (do_friend): Use set_mangled_name_for_decl. Call
10849 push_template_decl_real instead of push_template_decl.
10850 * method.c (build_decl_overload_real): Remove prototype. Give it
10851 external linkage.
10852 (build_overload_identififer): Adjust call to innermost_args.
10853 (build_template_decl_overload): Remove.
10854 (set_mangled_name_for_decl): New function.
10855 * parse.y (.finish_template_type): New non-terminal.
10856 (template_def): Use finish_template_decl. Use template_extdef
10857 instead of extdef.
10858 (template_extdef, template_datadef): New non-terminals, containing
10859 only those rules for things which can be templates.
10860 (datadef): Tidy.
10861 (template_type, self_template_type): Use .finish_template_type.
10862 (named_class_head): Use maybe_process_partial_specialization.
10863 * pt.c (mangle_class_name_for_template): Remove context parameter.
10864 (get_class_bindings): Remove outer_args parameter.
10865 (complete_template_args): Remove.
10866 (add_outermost_template_args): New function.
10867 (register_specialization): Return the specialization.
10868 (unregister_specialization): New function.
10869 (tsubst_template_parms): Likewise.
10870 (most_specialized, most_specialized_class): Prototype here as
10871 static.
10872 (original_template): Rename to most_general_template.
10873 (tsubst_template_parms): New function.
10874 (set_mangled_name_for_template_decl): Likewise.
10875 (TMPL_ARGS_DEPTH): New macro.
10876 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
10877 (TMPL_ARGS_LEVEL): New macro.
10878 (SET_TMPL_ARGS_LEVEL): Likewise.
10879 (TMPL_ARG): Likewise.
10880 (SET_TMPL_ARG): Likewise.
10881 (TMPL_ARGS_DEPTH): Likewise.
10882 (finish_member_template_decl): Use finish_template_decl.
10883 (maybe_process_partial_specialization): New function, split out
10884 from tsubst.
10885 (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
10886 (maybe_begin_member_template_processing): Use new macros.
10887 (is_member_template): Likewise.
10888 (is_member_template_class): Likewise.
10889 (add_to_template_args): Likewise. Deal with multiple levels of
10890 args.
10891 (maybe_process_partial_specialization): New function.
10892 (retrieve_specialization): Add consistency check.
10893 (determine_specialization): Return full argument list.
10894 (check_explicit_specialization): Tweak friend handling. Use full
10895 argument lists. Simplify.
10896 (current_template_args): Use new macros.
10897 (push_template_decl_real): Change ill-named mainargs to specargs.
10898 Check that a partial specialization actually specializes at least
10899 one parameter. Improve friend handling. Modify for full
10900 template arguments.
10901 (classtype_mangled_name): Don't mangle the names of
10902 specializations.
10903 (lookup_template_class): Add entering_scope parameter. Use it to
10904 avoid finding a template type when an instantiation is required.
10905 Simplify. Use full template arguments.
10906 (tsubst_friend_function): Use unregister_specialization. Use new
10907 macros. Use full template arguments.
10908 (tsubst_friend_class): Substitute, using tsubst_template_parms,
10909 into the template parameters before passing them to
10910 redeclare_class_template.
10911 (instantiate_class_template): Simplify. Use full template
10912 arguments. Adjust calls to get_class_bindings. Use
10913 SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
10914 (innermost_args): Use new macros.
10915 (tsubst_aggr_type): New function, split out from tsubst.
10916 (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
10917 conventions for lookup_template_class. Refine handling of partial
10918 instantiations. Remove calls to complete_template_args.
10919 Simplify. Add consistency checks. Use set_mangled_name_for_decl
10920 and set_mangled_name_for_template_decl.
10921 (tsubst_copy): Use tsubst_aggr_type.
10922 (instantiate_template): Use full template arguments.
10923 (more_specialized): Improve formatting.
10924 (more_specialized_class): Adjust calls to get_class_bindings.
10925 (get_bindings_real): Don't call complete_template_args.
10926 (most_specialized): Don't overwrite input; create a new list.
10927 (most_specialized_class): Use most_general_template.
10928 (regenerate_decl_from_template): Use unregister_specialization.
10929 Use full template arguments.
10930 (instantiate_decl): Use full template arguments.
10931 (set_mangled_name_for_template_decl): New function.
10932 * semantics.c (begin_class_definition): Use
10933 maybe_process_partial_specialization.
10934 (finish_member_class_template): New function.
10935 (finish_template_decl): Likewise.
10936 (finish_template_type): Likewise.
10937 (typeck.c): Don't crash after issuing a compiler_error.
10938 * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
10939
10940 1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
10941
10942 * typeck2.c (build_functional_cast): Handle default-initialization.
10943
10944 * call.c (build_over_call): Pass 1 to popclass.
10945
10946 * parse.y (direct_notype_declarator): Add precedence declaration
10947 to notype_unqualified_id case.
10948 * Makefile.in (EXPECT): Adjust.
10949
10950 * tree.c (ovl_member): Fix for single function in OVL.
10951
10952 1998-07-27 Dave Brolley <brolley@cygnus.com>
10953
10954 * c-lex.c (yylex): Fix boundary conditions in character literal and
10955 string literal loops.
10956
10957 1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
10958
10959 * decl.c (lookup_name_real): OK, do return the from_obj value
10960 unless got_object depends on template parms.
10961
10962 * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
10963
10964 * pt.c (coerce_template_parms): Also complain about local enums.
10965
10966 * cp-tree.h: Add prototype for set_identifier_local_value.
10967 * decl.c (set_identifier_local_value_with_scope): Make static,
10968 prototype.
10969 * search.c (covariant_return_p): Likewise.
10970 * except.c (build_terminate_handler, alloc_eh_object): Likewise.
10971
10972 * call.c (build_method_call): Only pull out the type of a destructor
10973 if it's a template type parm.
10974 * decl.c (lookup_name_real): Never return the from_obj value.
10975
10976 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
10977
10978 * except.c (process_start_catch_block_old): Call start_decl_1 for
10979 catch parm.
10980 * decl.c (start_decl_1): Avoid duplicate error.
10981
10982 * init.c (expand_default_init): Only perform the initialization if
10983 it will do something.
10984
10985 1998-07-23 H.J. Lu (hjl@gnu.org)
10986
10987 * parse.y (base_class): Check for invalid base class.
10988
10989 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
10990
10991 * decl2.c (import_export_template): Fold in...
10992 (import_export_class): ...to here. Handle dllimport/export.
10993
10994 * class.c (build_vtable): Pass at_eof to import_export_vtable.
10995 (prepare_fresh_vtable): Likewise.
10996 * decl2.c (import_export_class): Split out...
10997 (finish_prevtable_vardecl): From here.
10998 * class.c (finish_struct_1): Call import_export_class if at_eof.
10999
11000 * decl.c (start_function): #if 0 mysterious code I wrote and have
11001 forgotten why.
11002 * rtti.c (get_tinfo_fn): If this is for a class type, set
11003 DECL_CONTEXT.
11004
11005 1998-07-22 Jason Merrill <jason@yorick.cygnus.com>
11006
11007 * inc/exception: Change terminate and unexpected to ().
11008
11009 * parse.y (named_class_head_sans_basetype_defn): A
11010 named_class_head_sans_basetype followed by '{' or ':' is a defn.
11011
11012 1998-07-21 Jason Merrill <jason@yorick.cygnus.com>
11013
11014 * tree.c (canonical_type_variant): New fn to handle arrays.
11015 * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
11016 * pt.c (unify, default case): Also fold arg. Fix array bounds case.
11017 * method.c (process_overload_item): Use build_overload_value for
11018 arrays.
11019
11020 1998-07-20 Dave Brolley <brolley@cygnus.com>
11021
11022 * lex.c (mbchar.h): #include it.
11023 (GET_ENVIRONMENT): New macro.
11024 (init_parse): Set character set based on LANG environment variable.
11025 (real_yylex): Handle multibyte characters in character literals.
11026 (real_yylex): Handle multibyte characters in string literals.
11027
11028 1998-07-19 Jason Merrill <jason@yorick.cygnus.com>
11029
11030 * lex.c (do_identifier): Look for class value even if we don't
11031 have a global value. Do implicit declaration if parsing is 2.
11032 * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
11033 lookup.
11034
11035 1998-07-19 Mark Mitchell <mark@markmitchell.com>
11036
11037 * decl.c (pushtag): Revert previous change.
11038 * pt.c (lookup_template_class): Don't put out debugging
11039 information for types that use template parameters.
11040
11041 * decl.c (pushtag): Don't put out debugging information for
11042 compiler-generated typedefs.
11043
11044 * error.c (dump_type_real): Don't crash when presented with
11045 intQI_type_node or the like.
11046
11047 * semantics.c (finish_translation_unit): Fix spelling error in
11048 comment.
11049
11050 1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
11051
11052 * decl.c (lookup_name_real): Pull out single function here.
11053 (select_decl): Not here.
11054 (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
11055
11056 * decl.c (qualify_lookup): Tweak again.
11057
11058 * pt.c (lookup_template_class): Don't mess with the context of the
11059 instantiation.
11060 * decl2.c (current_decl_namespace): Remove special handling for
11061 templates.
11062
11063 * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
11064 a member template specialization.
11065
11066 * tree.c (ovl_member): Use decls_match to compare functions.
11067 * decl.c (decls_match): Check the context of a function.
11068
11069 * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
11070 in Koenig lookup support rules.
11071 * semantics.c (finish_call_expr): Handle the new cases.
11072
11073 * typeck.c (build_x_function_call): Handle overloaded methods.
11074
11075 * decl.c (grokvardecl): Don't call build_static_name for extern "C".
11076
11077 1998-07-16 Mark Mitchell <mark@markmitchell.com>
11078
11079 * semantics.c (finish_object_call_expr): Revert previous change.
11080 * call.c (build_new_method_call): Likewise. Instead, convert
11081 TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
11082
11083 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
11084
11085 * decl.c (qualify_lookup): Handle templates.
11086
11087 * decl2.c (do_using_directive): Don't pass ancestor.
11088 * decl.c (push_using_directive): Calculate ancestor.
11089
11090 * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
11091 * decl.c (pushdecl): Move type shadowing handling from here...
11092 (duplicate_decls): ...to here.
11093 * decl.c (set_identifier_local_value_with_scope): New fn.
11094 (pushdecl): Use it.
11095 (set_identifier_local_value, lookup_type_current_level): New fns.
11096 * decl2.c (do_local_using_decl): Handle types and binding level
11097 stuff properly.
11098
11099 * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
11100 * decl.c (select_decl): Extract a lone function from an OVERLOAD.
11101 (lookup_namespace_name): Likewise.
11102 * typeck.c (build_unary_op): Not here anymore.
11103
11104 * decl2.c (do_class_using_decl): Make sure we get an identifier.
11105 * class.c (handle_using_decl): Ignore TYPE_DECLs.
11106
11107 * decl.c (qualify_lookup): New fn.
11108 (lookup_name_real): Use it.
11109
11110 1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de>
11111
11112 * decl2.c (add_using_namespace): When directly using a namespace
11113 that was indirect before, promote it.
11114
11115 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
11116 LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
11117 LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
11118 * decl.c (select_decl): Replace two flag parameters by one.
11119 (unqualified_namespace_lookup): Likewise, pass flag.
11120 (lookup_flags): New function.
11121 (lookup_name_real): Compute flags, pass them.
11122 (lookup_namespace_name): Call with zero-flag.
11123 * decl2.c (ambiguous_decl): Add flag parameter, complain only
11124 according to flags.
11125 (lookup_using_namespace, qualified_lookup_using_namespace):
11126 Add flag parameter, pass them through.
11127 * lex.c (do_scoped_id): Call with zero-flag.
11128
11129 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
11130
11131 * typeck.c (convert_for_assignment): Use comptypes.
11132
11133 1998-07-16 Mark Mitchell <mark@markmitchell.com>
11134
11135 * semantics.c (finish_object_call_expr): Move test for the
11136 function called being a TYPE_DECL to ...
11137 * call.c (build_new_method_call): Here.
11138
11139 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
11140
11141 * decl2.c (arg_assoc_class): Also look at template arguments, if any.
11142 (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
11143
11144 * lex.c (looking_for_typename): Don't initialize.
11145
11146 * decl2.c (ambiguous_decl): Clarify error message.
11147
11148 * decl.c (push_using_directive): Iterate over namespaces used
11149 indirectly.
11150
11151 1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de>
11152
11153 * decl2.c (add_using_namespace): Iterate over namespaces used
11154 indirectly.
11155
11156 * decl.c (lookup_name_real): Accept namespace aliases as locals.
11157 (cat_namespace_levels): Ignore aliases.
11158 (duplicate_decls): Ignore duplicate aliases.
11159 * decl2.c (do_namespace_alias): Process block level namespace
11160 aliases. Store alias with pushdecl. Remove odr errors.
11161 * parse.y (namespace_alias): New non-terminal.
11162 (extdef): Use it.
11163
11164 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
11165
11166 * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
11167 Handle TEMPLATE_TYPE_PARM.
11168 (arg_assoc): Rewrite.
11169
11170 * pt.c (complete_template_args): Don't look at the context unless
11171 we have to.
11172
11173 * method.c (build_decl_overload_real): Fix namespace handling.
11174
11175 * typeck.c (build_unary_op): Extract a lone function from an
11176 OVERLOAD.
11177
11178 * call.c (build_scoped_method_call): Handle getting a namespace
11179 for basetype in a destructor call.
11180 (check_dtor_name): Handle enums.
11181
11182 * parse.y (using_directive): New nonterminal.
11183 (extdef, simple_stmt): Use it.
11184
11185 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
11186
11187 * decl2.c (add_function): Move error message ...
11188 (arg_assoc_namespace): ... from here.
11189
11190 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
11191
11192 * parse.y (namespace_qualifier): Fix multiple level handling.
11193 * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
11194 (arg_assoc): Don't skip the first argument of a function.
11195
11196 Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com)
11197
11198 * search.c (my_tree_cons): Clean up.
11199
11200 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
11201
11202 * call.c (joust): Don't warn about "confusing" conversions to the
11203 same type.
11204
11205 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
11206
11207 * class.c (push_nested_class): Complain about namespaces.
11208 * decl.c (start_decl): Enter the object's namespace.
11209 (cp_finish_decl): Leave it.
11210 (grokdeclarator): Likewise.
11211 * decl2.c (check_decl_namespace): New function.
11212 (finish_file): Call it.
11213 * parse.y (complex_direct_notype_declarator): Set complexity
11214 of namespace-qualified ids to -1, enter the namespace.
11215
11216 * method.c (build_template_decl_overload): Expect _DECL as first
11217 parameter. Put context temporarily into current_namespace.
11218 * pt.c (check_explicit_specialization): Change caller.
11219 (tsubst): Likewise.
11220
11221 * init.c (build_offset_ref): Call mark_used and
11222 convert_from_reference for namespace members.
11223
11224 Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
11225
11226 * search.c (my_tree_cons): The bitfield is at index 2.
11227
11228 Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com>
11229
11230 * lang-options.h: Format changed to work with new --help support
11231 in gcc/toplev.c
11232
11233 1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
11234
11235 * decl2.c (build_expr_from_tree): Change calls of do_identifier.
11236 Do Koenig lookup in CALL_EXPR.
11237 (arg_assoc): Handle error_mark.
11238 * lex.c (is_global): New function.
11239 (do_identifier): Expect arguments for Koenig lookup.
11240 * parse.y (primary): Add rules for calls of unqualified function calls.
11241 (do_id): Change call of do_identifier.
11242 * pt.c (finish_stmt_expr): Likewise.
11243 * semantics.c (finish_id_expr): Likewise.
11244 (finish_call_expr): Add integer parameter to indicate
11245 argument-dependent lookup.
11246
11247 * decl.c (struct binding_level): New field using_directives.
11248 (push_using_decl): Not sorry anymore.
11249 (push_using_directive): New function.
11250 (lookup_tag): Use CP_DECL_CONTEXT to iterate.
11251 (unqualified_namespace_lookup): New function, code from ...
11252 (lookup_name_real): ... here.
11253 * decl2.c (lookup_using_namespace): Pass using list instead of
11254 initial scope.
11255 (validate_nonmember_using_decl): New function.
11256 (do_nonmember_using_decl): New function.
11257 (do_toplevel_using_decl): Use them.
11258 (do_local_using_decl): New function.
11259 (do_using_directive): Support block-level directives.
11260 * parse.y (simple_stmt): Support using declarations and
11261 directives.
11262 (namespace_qualifier, namespace_using_decl): New non-terminals.
11263
11264 * xref.c (classname): New function.
11265 (GNU_xref_hier): Change class and base parameters to tree.
11266 * decl.c (xref_baseypes): Change caller.
11267 * friend.c (make_friend_class): Likewise.
11268
11269 1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
11270
11271 * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
11272 comparison.
11273
11274 * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
11275 template template parameter, record its use.
11276 (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
11277 its template arguments if exists.
11278
11279 * pt.c (coerce_template_template_parms): New function equivalent
11280 to coerce_template_parms when IS_TMPL_PARM is true.
11281 (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter,
11282 all callers changed.
11283
11284 (coerce_template_parms): Access ARGLIST properly when creating a
11285 new vector. Only accept implicit TYPE_DECL as valid argument for
11286 a template template parameter when it is a base class of
11287 current_class_type. Don't display error message when COMPLAIN is
11288 false.
11289
11290 1998-07-12 Klaus Kaempf (kkaempf@progis.de)
11291
11292 * repo.c (get_base_filename): Use file_name_nondirectory.
11293 (open_repo_file): Likewise.
11294 * cp-tree.h (file_name_nondirectory): Add prototype.
11295
11296 1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
11297
11298 * friend.c (do_friend): Pull the identifier out of declarator.
11299 Use cp_error and friends.
11300 * decl2.c (qualified_lookup_using_namespace): Fix call to
11301 purpose_member.
11302 * decl.c (lookup_name_real): Don't call complete_type on a namespace.
11303 (grokvardecl): Use DECL_CLASS_SCOPE_P.
11304 * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
11305 * class.c (warn_hidden): Fix for OVERLOAD.
11306 From grahams@rcp.co.uk:
11307 * cp-tree.h (DEFARG_NODE_CHECK): New macro.
11308 (DEFARG_LENGTH, DEFARG_POINTER): Use it.
11309
11310 Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com)
11311
11312 * g++.1 (-traditional): Remove duplicated documentation.
11313
11314 1998-07-11 Mark Mitchell <mark@markmitchell.com>
11315
11316 * method.c (flush_repeats): Add nrepeats parameter.
11317 (issue_nrepeats): Likewise.
11318 (is_back_referenceable_type): New function. Don't back-reference
11319 TEMPLATE_TYPE_PARMs as well as simple types like integers.
11320 (build_mangled_name_for_type): Likewise.
11321 (build_mangled_name_for_type_with_Gcode): Likewise.
11322 (lasttype): Remove.
11323 (nrepeats): Likewise.
11324 (Nrepeats): Likewise.
11325 (start_squangling): Don't clear the variables removed above.
11326 (end_squangling): Likewise.
11327 (flush_repeats): Tidy. Use nrepeats parameter rather than
11328 Nrepeats global.
11329 (issue_nrepeats): Likewise, but with nrepeats global. Use
11330 is_backreferenceable_type.
11331 (build_overload_nested_name): Tidy. Add comment. Use
11332 build_mangled_name_for_type.
11333 (build_underscore_int): Comment.
11334 (build_overload_scope_ref): Use build_mangled_name_for_type.
11335 (build_overload_int): Likewise.
11336 (build_template_template_parm_names): Tidy.
11337 (build_template_parm_names): Use build_mangled_name_for_type.
11338 (build_overload_identifier): Add comments.
11339 (build_mangled_name_for_type_with_Gcode): Split out from
11340 build_mangled_name.
11341 (build_mangled_name_for_type): Use it.
11342 (build_mangled_name): Rework to use build_mangled_name_for_type
11343 and to not use global nrepeats/Nrepeats. Tidy.
11344 (process_modifiers): Tidy.
11345 (check_btype): Use is_backreferenceable_type. Add comment.
11346 Rename `node' to `type'.
11347 (process_overload_item): Set numeric_output_need_bar here.
11348 Use build_mangled_name_for_type. Tidy.
11349 (build_decl_overload_real): Tidy. Don't use Nrepeats. Use
11350 build_mangled_name_for_type.
11351
11352 * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
11353 for TYPE_DECLs.
11354
11355 1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com>
11356
11357 * cp-tree.h (warn_long_long): Define.
11358 * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
11359 warning "ANSI C++ does not support `long long'".
11360 * decl2.c (warn_long_long): Define.
11361 (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
11362
11363 1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
11364
11365 * decl.c (xref_tag): Handle attributes between 'class' and name.
11366 * parse.y (aggr): Likewise.
11367 * semantics.c (finish_class_definition): Likewise.
11368 * Makefile.in (EXPECTED): Adjust.
11369
11370 * cp-tree.h: Declare flag_optional_diags and warn_multichar.
11371 * decl2.c: Define them.
11372 (lang_decode_option): Handle them.
11373 * lang-options.h: Add -foptional-diags.
11374 * class.c (finish_struct): Don't complain about multiple meanings of
11375 name if -fno-optional-diags.
11376 * decl.c (pushdecl_class_level): Likewise.
11377 * lex.c (real_yylex): Check warn_multichar.
11378
11379 1998-07-06 Jason Merrill <jason@yorick.cygnus.com>
11380
11381 * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
11382
11383 * tree.c (make_binfo): Fix length.
11384
11385 1998-06-30 Benjamin Kosnik <bkoz@bliss.nabi.net>
11386
11387 * decl2.c (lang_decode_option): Remove warn_template_debugging.
11388 * lang-options.h: Likewise.
11389
11390 Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11391
11392 * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
11393 (process_start_catch_block): Likewise for variables
11394 `false_label_rtx', `call_rtx' and `return_value_rtx'.
11395
11396 1998-06-29 Brendan Kehoe <brendan@cygnus.com>
11397
11398 * tree.c (build_srcloc): Make sure we allocate this node on the
11399 permanent obstack.
11400
11401 Sat Jun 27 23:34:18 1998 Fred Fish <fnf@ninemoons.com>
11402
11403 * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
11404 (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
11405 (lang_specific_driver): Only add -lm automatically if need_math is
11406 nonzero.
11407
11408 Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com)
11409
11410 * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o
11411
11412 Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11413
11414 * Makefile.in (EXPR_H): New dependency variable.
11415 (decl2.o): Depend on $(EXPR_H).
11416 (typeck.o): Likewise.
11417 (init.o): Likewise.
11418 (expr.o): Likewise.
11419
11420 1998-06-25 Benjamin Kosnik <bkoz@lisa.cygnus.com>
11421
11422 * decl.c (start_enum): Put local enums on permanent_obstack.
11423
11424 1998-06-25 Mark Mitchell <mark@markmitchell.com>
11425
11426 * cp-tree.h (c_get_alias_set): Declare.
11427 * decl.c (init_decl_processing): Set lang_get_alias_set.
11428
11429 1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
11430
11431 * cp-tree.h (mark_all_runtime_matches): Add function prototype.
11432 * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
11433 flag for all function decls which are in the exception table.
11434 * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
11435 * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
11436 code is emitted for any referenced rtti function.
11437
11438 1998-06-25 Dave Brolley <brolley@cygnus.com>
11439
11440 * lang-specs.h: Use new | syntax to eliminate
11441 string concatenation.
11442
11443 1998-06-25 Jason Merrill <jason@yorick.cygnus.com>
11444
11445 * cp-tree.h (CP_DECL_CONTEXT): New macro.
11446 * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
11447 * method.c (build_overload_nested_name): Likewise.
11448 * sig.c (build_signature_pointer_or_reference_type): Don't set
11449 DECL_CONTEXT.
11450
11451 1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
11452
11453 Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
11454 * cp-tree.h (FROB_CONTEXT): New macro.
11455 (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
11456 * decl.c (namespace_binding): Replace NULL_TREE with
11457 global_namespace.
11458 (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
11459 * decl2.c (is_namespace_ancestor, lookup_using_namespace):
11460 Likewise.
11461 * decl.c (pushtag): Use FROB_CONTEXT.
11462 (pushdecl, make_typename_type, define_function, grokdeclarator):
11463 Likewise.
11464 * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
11465 * pt.c (push_template_decl_real, lookup_template_class, tsubst):
11466 Likewise.
11467 * decl2.c (decl_namespace): Return global_namespace if no context.
11468 * method.c (build_overload_nested_name): Expect null as context.
11469 * pt.c (mangle_class_name_for_template): Do nothing for null
11470 contexts.
11471 (lookup_template_class): Allow for null id_context.
11472
11473 1998-06-25 Richard Henderson <rth@cygnus.com>
11474
11475 * method.c (emit_thunk): Set current_function_is_thunk for the
11476 ASM_OUTPUT_MI_THUNK case as well.
11477
11478 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
11479
11480 * exception.cc (__cplus_type_matcher): Get a match_info pointer
11481 instead of an exception table entry as a parameter.
11482
11483 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
11484
11485 * parse.y (function_try_block): Don't call start_catch_handler.
11486 * except.c (call_eh_info): Remove coerced field from declaration.
11487 (build_eh_type_type_ref): New function to create an address of a
11488 rtti function for the new style exception tables.
11489 (expand_start_catch_block): Split function, this contains the
11490 common part.
11491 (process_start_catch_block_old): New function to perform the rest
11492 of expand_start_catch_block under old style exceptions.
11493 (process_start_catch_block_old): New function to perform the rest
11494 of expand_start_catch_block under new style exceptions.
11495 (expand_end_catch_block): Only pop the false label off the stack under
11496 the old style of exceptions.
11497 * semantics.c (finish_try_block): Don't call start_catch_handler.
11498 * exception.cc (struct cp_eh_info): Add original_value field.
11499 (__cplus_type_matcher): Perform type matching on the original exception
11500 value, and if we have a match, set the current value.
11501 (__cp_push_exception): Set the original exception value.
11502
11503 1998-06-23 Jason Merrill <jason@yorick.cygnus.com>
11504
11505 * call.c (joust): Fix confusing conversion warning.
11506
11507 * call.c (build_op_delete_call): Add placement parm. Check
11508 LOOKUP_SPECULATIVELY.
11509 * cp-tree.h, decl2.c, init.c: Adjust.
11510 * decl.c (finish_function): Use it.
11511
11512 * pt.c (tsubst): Diagnose creating void fields or variables.
11513
11514 Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11515
11516 * call.c (build_scoped_method_call): Remove unused variable `tmp'.
11517
11518 * cp-tree.h (check_dtor_name): Add prototype.
11519
11520 * init.c (expand_member_init): Remove unused variables
11521 `ptr_type_node', `parm' and `rval'.
11522
11523 * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
11524 in call to fprintf.
11525 (lang_print_xnode): Likewise.
11526
11527 * typeck2.c (enum_name_string): Cast argument to sprintf to long
11528 and use %ld specifier.
11529
11530 * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
11531 specifier in call to fprintf.
11532 (GNU_xref_member): Cast argument to sprintf to int.
11533
11534 Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
11535
11536 * typeck2.c (pop_init_level): Warn about implicit zero initialization
11537 of struct members.
11538
11539 Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11540
11541 * cp-tree.h: Prototype function `check_java_method'.
11542
11543 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
11544
11545 * class.c (finish_struct): Make conflicting use of id a pedwarn.
11546 * decl.c (pushdecl_class_level): Likewise.
11547
11548 1998-06-17 Mark Mitchell <mark@markmitchell.com>
11549
11550 * pt.c (convert_nontype_argument): Issue an error when presented
11551 with an integer (real) constant that cannot be simplified to an
11552 INT_CST (REAL_CST).
11553
11554 * cp-tree.h (c_get_alias_set): Remove declaration added in
11555 1998-06-13 change that should never have been checked in.
11556
11557 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
11558
11559 * typeck.c (build_binary_op_nodefault): Change % in format strings
11560 to %%.
11561
11562 * decl.c (grokvardecl): Don't build_static_name for decls that
11563 aren't at namespace scope.
11564
11565 * init.c (perform_member_init): Catch default-initialization of
11566 references.
11567
11568 1998-06-17 Mark Mitchell <mark@markmitchell.com>
11569
11570 * errfn.c (cp_thing): Handle the `%%' formatting sequence.
11571
11572 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
11573
11574 * method.c (hack_identifier): Complain about getting a namespace
11575 or class template.
11576 * typeck.c (decay_conversion): Remove check for namespaces.
11577 * typeck2.c (incomplete_type_error): Likewise.
11578 * parse.y (template_arg): Add PTYPENAME expansion.
11579
11580 1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
11581
11582 * decl.c (grokvardecl): Don't build external assembler names for
11583 TYPENAMEs in other namespaces as there is no declarator.
11584 * error.c (cp_file_of, cp_line_of): Don't extract file or line number
11585 info from DECL_CONTEXT if it is NULL.
11586
11587 1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
11588
11589 * call.c (check_dtor_name): Split out.
11590 (build_scoped_method_call): Use it.
11591 (build_method_call): Use it.
11592 * init.c (build_offset_ref): Use it.
11593
11594 * typeck.c (build_static_cast): Fix handling of pointers to members.
11595
11596 * decl.c (finish_function): Just return nothing from a constructor.
11597 * typeck.c (c_expand_return): Complain about returning a void
11598 expression from a destructor.
11599
11600 1998-06-13 Mark Mitchell <mark@markmitchell.com>
11601
11602 * class.c (alter_access): Accept a BINFO explaining how to get
11603 from the entity whose accessed is being altered to the type doing
11604 the altering.
11605 (handle_using_decl): New function containing code split out from ...
11606 (finish_struct_1): Here.
11607
11608 * cp-tree.h (complete_type_or_else): Declare.
11609 * init.c (build_new_1, build_delete): Use it.
11610 * typeck.c (require_complete_type): Use complete_type, rather than
11611 expanding it inline.
11612 (complete_type_or_else): New function.
11613 (build_component_ref): Use it.
11614 (pointer_int_sum): Make sure the type pointed to is complete.
11615 (pointer_diff): Likewise.
11616
11617 * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
11618 types.
11619
11620 * search.c (get_matching_virtual): Note that member templates
11621 cannot override virtual functions.
11622
11623 1998-06-12 Brendan Kehoe <brendan@cygnus.com>
11624
11625 * pt.c (check_explicit_specialization): If DECLARATOR turned into
11626 an error_mark_node from lookup_template_function, return the same.
11627 (determine_specialization): Also make sure TEMPLATE_ID isn't an
11628 error_mark_node, before we try to read its operands.
11629 * decl.c (grokdeclarator): If we got an error_mark_node from
11630 check_explicit_specialization, just return it right back.
11631
11632 1998-06-12 Mark Mitchell <mark@markmitchell.com>
11633
11634 * class.c (instantiate_type): Don't treat template-ids that don't
11635 specify any template arguments as equivalent to ordinary
11636 identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to
11637 pointer-to-members for member templates. Tidy slightly.
11638 * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
11639 * init.c (build_offset_ref): Handle template-ids like ordinary
11640 identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
11641 offset part of the OFFSET_REF.
11642 * typeck.c (build_unary_op): Change check for unknown types to
11643 look for OFFSET_REFs, not SCOPE_REFs.
11644
11645 1998-06-11 Mark Mitchell <mark@markmitchell.com>
11646
11647 * pt.c (is_member_template_class): New function.
11648 (push_template_decl_real): Use it.
11649
11650 1998-06-11 Benjamin Kosnik <bkoz@elmo.cygnus.com>
11651
11652 * friend.c (do_friend): Add support for nested classes using
11653 member functions of the enclosing class as friends.
11654
11655 1998-06-10 Mark Mitchell <mark@markmitchell.com>
11656
11657 * call.c (convert_default_arg): Make global, not static.
11658 (convert_arg_for_ellipsis): Split out from ...
11659 (build_over_call): Here.
11660 * cp-tree.h (convert_default_arg); Declare.
11661 (convert_arg_to_ellipsis): Likewise.
11662 (do_member_init): Remove.
11663 * init.c (do_member_init): Remove; this code is dead.
11664 (expand_member_init): Remove much of this code; it is dead.
11665 * typeck.c (convert_arguments): Use convert_default_arg and
11666 convert_arg_for_ellipsis, rather than duplicating here.
11667
11668 * call.c (convert_like): Don't fail silently if
11669 build_user_type_conversion fails. Always return error_mark_node
11670 for failure.
11671
11672 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
11673
11674 * search.c (covariant_return_p): Complain about ambiguous base.
11675
11676 * typeck.c (build_component_ref): Diagnose ref to nested type.
11677
11678 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
11679
11680 * decl.c (grokparms): Check that INIT isn't an error_mark_node
11681 before giving error about invalid type for default arg.
11682
11683 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
11684
11685 * call.c (build_method_call): Fix thinko.
11686
11687 1998-06-10 Dave Brolley <brolley@cygnus.com>
11688
11689 * decl2.c (lang_decode_option): New argc/argv interface.
11690 * cp-tree.h (lang_decode_option): New argc/argv interface.
11691 * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
11692 specified for cpplib-enabled compilers.
11693 * lex.c (lang_init): Don't check_newline for cpplib.
11694 (init_parse): Don't initialize cpplib here.
11695
11696 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
11697
11698 * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
11699 piece before checking DECL_MUTABLE_P.
11700
11701 1998-06-10 John Carr <jfc@mit.edu>
11702
11703 * tree.c (debug_binfo): Make printf format match arguments.
11704
11705 * error.c (OB_PUTI): Make printf format match arguments.
11706
11707 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
11708
11709 * init.c (perform_member_init): Handle default-initialization.
11710
11711 * except.c (build_throw): Handle throwing NULL.
11712
11713 * typeck.c (build_x_function_call): Use resolve_offset_ref.
11714
11715 * search.c (compute_access): Only strip an anonymous union
11716 for a FIELD_DECL.
11717
11718 * call.c (add_builtin_candidates): Tweak.
11719
11720 * cvt.c (build_expr_type_conversion): Restore code for conversion
11721 from class types.
11722 * decl2.c (delete_sanity): Use it. Clean up.
11723
11724 * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
11725
11726 1998-06-10 Branko Cibej <branko.cibej@hermes.si>
11727
11728 * typeck.c (c_expand_return): Don't warn about void expressions on
11729 return statements in functions returning void.
11730
11731 1998-06-09 Mark Mitchell <mark@markmitchell.com>
11732
11733 * pt.c (fn_type_unification): Revise documentation. Tidy.
11734 (type_unification): Likewise.
11735
11736 1998-06-09 Andrew MacLeod <amacleod@cygnus.com>
11737
11738 * semantics.c (finish_try_block): Rename expand_start_catch, and delete
11739 expand_end_catch.
11740 * parse.y (function_try_block): Rename expand_start_catch, and delete
11741 expand_end_catch.
11742 * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
11743 expand_end_catch.
11744
11745 1998-06-09 Jason Merrill <jason@yorick.cygnus.com>
11746
11747 * search.c (lookup_member): New fn.
11748 * class.c (finish_struct_1): Use it.
11749 * decl.c (lookup_name_real): Use it.
11750
11751 Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11752
11753 * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
11754
11755 * cp-tree.h: Add prototype for `maybe_print_template_context' and
11756 `maybe_make_one_only'.
11757
11758 * decl.c (auto_function): Remove unused variable `decl'.
11759
11760 * decl2.c: Include dwarf2out.h and dwarfout.h.
11761
11762 * lex.c: Remove redundant declarations of `set_float_handler' and
11763 `asm_out_file'.
11764
11765 1998-06-08 Andrew MacLeod <amacleod@cygnus.com>
11766
11767 * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
11768 time flag. Call __cp_eh_info instead of __cp_exception_info.
11769 * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
11770 (__cp_exception_info): Return offset into cp_eh_info structure to
11771 match what use to be the start of this structure.
11772 (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
11773 (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
11774 compile time flag.
11775 (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
11776 __cp_eh_info instead of __cp_exception_info.
11777
11778 1998-06-08 Jason Merrill <jason@yorick.cygnus.com>
11779
11780 * decl.c (cp_finish_decl): Disable inlining of extern inlines
11781 with static variables.
11782
11783 1998-06-08 Mark Mitchell <mark@markmitchell.com>
11784
11785 * init.c (build_offset_ref): Correct previous change to use build,
11786 not build_min.
11787
11788 1998-06-07 Mark Mitchell <mark@markmitchell.com>
11789
11790 * class.c (instantiate_type): Handle pointer-to-members where the
11791 member is a template.
11792 * init.c (build_offset_ref): Likewise.
11793 * typeck.c (build_unary_op): Likewise.
11794
11795 1998-06-07 Richard Henderson <rth@cygnus.com>
11796
11797 * lex.c (lang_init_options): New function.
11798 (lang_init): Remove flag_exceptions == 2 hack.
11799
11800 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
11801
11802 * search.c (envelope_add_decl): Tweak for implicit typename.
11803
11804 * call.c (joust): Also warn about confusing conversion op/constructor
11805 overload resolution.
11806
11807 * spew.c (yylex): Also return the TYPE_DECL if got_object.
11808 Don't clear got_object after '~'.
11809 * call.c (build_scoped_method_call): Tweak destructor handling.
11810 (build_method_call): Likewise.
11811 * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
11812 TYPE_MAIN_VARIANT for destructors.
11813 * semantics.c (finish_object_call_expr): Complain about calling a
11814 TYPE_DECL.
11815
11816 1998-06-05 Per Bothner <bothner@cygnus.com>
11817
11818 * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
11819 Define - update needed by gcc.c change.
11820
11821 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
11822
11823 * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
11824
11825 1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de>
11826
11827 * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
11828 * decl.c (lookup_name_real): Add namespaces_only parameter.
11829 If set, return only NAMESPACE_DECLs.
11830 (select_decl): Likewise.
11831 (identifier_type_value): Give additional parameter.
11832 (lookup_name_nonclass): Likewise.
11833 (lookup_name): Likewise.
11834 (find_binding): Skip namespace aliases.
11835 (binding_for_name): Likewise.
11836 (push_namespace): Check for namespace aliases.
11837 (lookup_name_namespace_only): New function.
11838 (begin_only_namespace_names, end_only_namespace_names): New functions.
11839 * decl2.c (set_decl_namespace): Skip namespace aliases.
11840 (do_using_directive): Likewise.
11841 (do_namespace_alias): Produce namespace aliases, fix alias
11842 redeclaration.
11843 * error.c (dump_decl): Support SCOPE_REF.
11844 * parse.y (extdef): Wrap lookup with namespace_only for namespace
11845 aliases and using declarations.
11846
11847 1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
11848
11849 * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
11850
11851 * error.c (dump_expr): Clean up NEW_EXPR case.
11852
11853 1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
11854
11855 Suggested by Brendan Kehoe
11856 * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
11857 treat it as using ::decl.
11858
11859 * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
11860
11861 * tree.c (mapcar): Support NEW_EXPR.
11862
11863 * error.c (dump_expr): Support NEW_EXPR.
11864
11865 1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
11866
11867 * method.c (make_thunk): Use overload machinery to make name.
11868 * search.c (covariant_return_p): New fn.
11869 (get_matching_virtual): Use it.
11870
11871 * init.c (build_new_1): Fix check for void.
11872
11873 1998-06-01 Per Bothner <bothner@cygnus.com>
11874
11875 * cp-tree.h (TYPE_FOR_JAVA): New macro.
11876 * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
11877 java_int_type_node, java_long_type_node, java_float_type_node,
11878 java_double_type_node, java_char_type_node, java_boolean_type_node):
11879 New "primitive" types, with predefined names __java_byte etc.
11880 (record_builtin_java_type): New function.
11881 (init_decl_processing): Make Java types with record_builtin_java_type.
11882 (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
11883 (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
11884 (grokfndecl): Call check_java_method for Java classes.
11885 * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
11886 (process_overload_item): Match types against specific
11887 java_XX_type_node types, rather than using is_java_type.
11888 * class.c (finish_struct_1): Don't add default copy constructor
11889 or operator= if TYPE_FOR_JAVA.
11890 (pop_lang_conext): Restore strict_prototyp proper if Java.
11891 * decl2.c (acceptable_java_type, check_java_method): New functions.
11892 * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
11893 (tsubst): Move common statement after if statement.
11894 * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
11895
11896 1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
11897
11898 * pt.c (for_each_template_parm): Use first_rtl_op.
11899
11900 * tree.c (build_cplus_array_type_1): Also check index_type for
11901 template parms.
11902
11903 1998-05-31 Jason Merrill <jason@yorick.cygnus.com>
11904
11905 * pt.c (tsubst): Always copy BINFO_BASETYPES.
11906
11907 1998-05-29 scott snyder <snyder@d0sgif.fnal.gov>
11908
11909 * tree.c (layout_basetypes): If we change TYPE_SIZE, change
11910 TYPE_SIZE_UNIT too.
11911
11912 1998-05-29 Mark Mitchell <mark@markmitchell.com>
11913
11914 * decl.c (grokdeclarator): Don't complain about in-class
11915 initialization of static consts if we don't really know the type
11916 of the variable.
11917
11918 1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
11919
11920 * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
11921 * method.c (build_destructor_name): New fn.
11922 * decl2.c (maybe_retrofit_in_chrg): Split out...
11923 (grokclassfn): From here. Reorganize.
11924 * decl.c (grok_ctor_properties): Make sure ctors for types with
11925 vbases have the in_chrg parm.
11926 * pt.c (instantiate_class_template): Update
11927 TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call
11928 grok_*_properties.
11929 (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
11930
11931 1998-05-28 Mark Mitchell <mark@markmitchell.com>
11932
11933 * pt.c (instantiate_decl): Make test for whether or not static
11934 variables should be instantiated early match its comment.
11935
11936 1998-05-28 Jason Merrill <jason@yorick.cygnus.com>
11937
11938 * decl.c (start_decl): Always pedwarn about vacuously redeclaring
11939 a member.
11940 (start_function): Call check_default_args.
11941 * decl2.c (grokfield): Don't call check_default_args.
11942 (check_default_args): Use cp_error_at.
11943 * lex.c (do_pending_defargs): Call check_default_args.
11944
11945 1998-05-27 Brendan Kehoe <brendan@cygnus.com>
11946
11947 * call.c (build_method_call): Make sure get_type_value returns
11948 something before we try to use its TYPE_MAIN_VARIANT.
11949 (build_scoped_method_call): Likewise.
11950
11951 1998-05-27 Jason Merrill <jason@yorick.cygnus.com>
11952
11953 * typeck2.c (digest_init): Complain about getting a TREE_LIST to
11954 initialize an array.
11955
11956 * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
11957 DECL_VIRTUAL_P.
11958
11959 * friend.c (do_friend): Clarify template warning.
11960
11961 1998-05-27 Mark Mitchell <mark@markmitchell.com>
11962
11963 * decl.c (shadow_label): Don't treat decls as identifiers.
11964 (maybe_push_to_top_level): Clear shadowed_labels.
11965
11966 * pt.c (instantiate_decl): Reset lineno and filename after calling
11967 regenerate_decl_from_template.
11968
11969 * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
11970 error_mark_node.
11971
11972 1998-05-27 Kevin Buhr <buhr@stat.wisc.edu>
11973
11974 * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
11975
11976 1998-05-26 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11977
11978 * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
11979 (convert_nontype_argument): Handle cases when nontype template
11980 parameters become classes after substitution.
11981
11982 1998-05-26 Mark Mitchell <mark@markmitchell.com>
11983
11984 * friend.c (is_friend): Use comptypes, rather than == to compare
11985 types. Modify for new representation of template friends.
11986 (make_friend_class): Likewise.
11987 * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak.
11988 (instantiate_class_template): Deal with template friends.
11989
11990 * decl.c (store_parm_decls): Remove redundant call to
11991 expand_main_function.
11992
11993 1998-05-26 Benjamin Kosnik <bkoz@loony.cygnus.com>
11994
11995 * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
11996 DECL_USE_TEMPLATE.
11997
11998 1998-05-26 Per Bothner <bothner@cygnus.com>
11999
12000 * language_as_string: Handle lang_java.
12001
12002 1998-05-26 Jason Merrill <jason@yorick.cygnus.com>
12003
12004 * decl.c (pushdecl): Don't copy the type_decl.
12005
12006 1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de>
12007
12008 * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
12009 current_class_type.
12010 * decl.c (grokdeclarator): Put typedefs on the type's obstack.
12011
12012 * parse.y (complex_direct_notype_declarator): Use $1 to access
12013 scope of notype_qualified_id.
12014
12015 1998-05-26 Dave Brolley <brolley@cygnus.com>
12016
12017 * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
12018 (init_parse): Initialize cpplib interface.
12019
12020 * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
12021 empty continuation.
12022
12023 1998-05-26 Mark Mitchell <mark@markmitchell.com>
12024
12025 * decl.c (pushtag): Avoid crashing on erroneous input.
12026
12027 1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de>
12028
12029 * decl.c (push_namespace): Only produce one unique name for
12030 anonymous namespaces.
12031 (get_unique_name): Remove.
12032
12033 1998-05-25 Mark Mitchell <mark@markmitchell.com>
12034
12035 * call.c (tourney): Don't do any extra comparisons.
12036
12037 * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
12038
12039 * cp-tree.h (processing_template_parmlist): Declare.
12040 * decl.c (pushtag): Don't call push_template_decl when we
12041 shouldn't.
12042 * pt.c (processing_template_parmlist): New variable.
12043 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
12044 (complete_template_args): Use it.
12045 (add_to_template_args): Likewise.
12046 (innermost_args): Likewise.
12047 (tsubst): Likewise.
12048 (begin_template_parm_list): Use processing_template_parmlist.
12049 (end_template_parm_list): Likewise.
12050
12051 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
12052 * decl.c (grokdeclarator): Use it.
12053 * decl2.c (grok_x_components): Likewise.
12054 * init.c (initializing_context): Likewise.
12055 * method.c (do_build_copy_constructor): Likewise.
12056 (do_build_assign_ref): Likewise.
12057 * search.c (compute_access): Likewise.
12058 * typeck.c (build_component_ref): Likewise.
12059
12060 * decl.c (grokdeclarator): Don't give a cv-qualified version of an
12061 unnamed type a typedef name "for linkage purposes".
12062
12063 * pt.c (lookup_template_class): Don't look at
12064 IDENTIFIER_CLASS_VALUE when there's no current_class_type.
12065
12066 * method.c (build_overload_int): Handle error cases gracefully.
12067
12068 * pt.c (instantiate_decl): Handle static member variables
12069 correctly.
12070
12071 * pt.c (tsubst): Use the tsubst'd type when producing new
12072 TEMPLATE_PARM_INDEX nodes.
12073
12074 1998-05-24 Mark Mitchell <mark@markmitchell.com>
12075
12076 * tree.c (cp_tree_equal): Handle pointers to member functions.
12077
12078 * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make
12079 sure the type of the REF_BIND is a reference type.
12080 (maybe_handle_ref_bind, compare_ics): Rename reference_type to
12081 target_type for clarity.
12082
12083 * parse.y (xcond): Move call to condition_conversion ...
12084 * semantics.c (finish_for_cond): Here.
12085 * parse.c: Regenerated.
12086
12087 1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
12088
12089 * decl.c (push_namespace): Namespaces have type void.
12090 * typeck2.c (incomplete_type_error): Complain about namespace
12091 used as expression.
12092 * typeck.c (decay_conversion): Likewise.
12093
12094 1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
12095
12096 * error.c (dump_expr): Support namespaces.
12097
12098 1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
12099
12100 * cp-tree.def: Add SRCLOC.
12101 * cp-tree.h: Add struct tree_srcloc and accessor macros.
12102 * tree.c (build_srcloc, build_srcloc_here): New fns.
12103 * pt.c (add_pending_template): Use build_srcloc_here.
12104 (push_tinst_level): Update last_template_error_tick before erroring.
12105 (instantiate_decl): Restore lineno and input_filename before
12106 calling add_pending_template.
12107 * decl2.c (finish_file): Set up lineno and input_filename for
12108 pending templates.
12109
12110 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
12111
12112 * decl.c (lang_print_error_function): New fn.
12113 (init_decl_processing): Set print_error_function to use it.
12114 * errfn.c (cp_thing): Don't call maybe_print_template_context here.
12115
12116 * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
12117 ICS_BAD_FLAG.
12118
12119 * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
12120 copy-initialization.
12121
12122 * class.c (build_vtable_entry): Use int_fits_type_p.
12123 (build_vtable): Pass a signed offset to build_vtable_entry.
12124 (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
12125 set_rtti_entry): Likewise.
12126
12127 1998-05-22 Per Bothner <bothner@cygnus.com>
12128
12129 * cp-tree.h: Add comments documenting which LANG_FLAGS are used.
12130 (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used.
12131
12132 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
12133
12134 * pt.c (print_template_context): Use fprintf instead of cp_error.
12135
12136 * pt.c (determine_specialization): Just return an error_mark_node.
12137 Also print the decl we want in error messages. If we complain,
12138 return error_mark_node.
12139 (tsubst_friend_function): Set lineno and input_filename so
12140 error messages will be useful.
12141 (instantiate_template): Just return an error_mark_node.
12142 (check_explicit_specialization): Don't mess with a returned
12143 error_mark_node.
12144
12145 * pt.c (print_template_context): Add new argument.
12146 (maybe_print_template_context): New fn.
12147 (push_tinst_level): Increment tinst_level_tick.
12148 (pop_tinst_level): Likewise.
12149 * errfn.c (cp_thing): Call maybe_print_template_context. Use
12150 xrealloc instead of xmalloc.
12151
12152 * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
12153
12154 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
12155
12156 * pt.c (tsubst_friend_class): Don't call redeclare_class_template
12157 if the template we looked up is the same as the one we already
12158 have.
12159
12160 Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
12161
12162 * lex.c: (handle_sysv_pragma): FILE* parameter not used.
12163 (cpp_reader,parse_in): Add for cpplib.
12164 (check_newline): Call handle_sysv_pragma with new interface.
12165 (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
12166
12167 * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
12168 (sub_getch): Call GETC for cpplib.
12169
12170 * cp-tree.h: (get_directive_line): Different prototype for cpplib.
12171 (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
12172
12173 * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib.
12174
12175 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
12176
12177 * decl2.c (maybe_make_one_only): New fn.
12178 (import_export_vtable): Use it.
12179 (import_export_decl): Likewise.
12180 * pt.c (mark_decl_instantiated): Likewise.
12181
12182 1998-05-21 Mark Mitchell <mmitchell@usa.net>
12183
12184 * decl2.c (find_representative_member): Rename to ...
12185 (build_anon_union_vars): New function.
12186 (finish_anon_union): Fix stupidity of previous change.
12187
12188 1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
12189
12190 * decl.c (grokfndecl): Handle definition of specialization in
12191 friend declaration.
12192
12193 * error.c (dump_decl): Fix LOOKUP_EXPR handling.
12194
12195 1998-05-20 Mark Mitchell <mmitchell@usa.net>
12196
12197 * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
12198 to look for type declarations.
12199 (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
12200 * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
12201 (finish_member_class_template): Declare.
12202 * decl.c (pushtag): Put member class templates on the
12203 CLASSTYPE_TAGS list, just as for ordinary member classes.
12204 (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
12205 (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
12206 IDENTIFIER_NAMESPACE_VALUEs.
12207 * parse.y (component_decl): Move code to ...
12208 * semantics.c (finish_member_class_template): New function.
12209 Don't put member class templates on the list of components for a
12210 class.
12211 * parse.c: Regenerated.
12212 * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
12213 In fact, don't use DECL_CONTEXT at all here.
12214
12215 1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
12216
12217 * decl.c (record_unknown_type): New function.
12218 (init_decl_processing): Call it for the unknown and global type
12219 nodes.
12220
12221 1998-05-20 Mark Mitchell <mmitchell@usa.net>
12222
12223 * decl2.c (find_representative_member): New function.
12224 (finish_anon_union): Use it.
12225
12226 * cp-tree.h (MAIN_NAME_P): New macro.
12227 (DECL_MAIN_P): Likwise.
12228 * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
12229 (grokfndecl): Use the new macros.
12230 (grokdeclarator): Likewise.
12231 (start_function): Likewise.
12232 (store_parm_decls): Likewise.
12233 (finsh_function): Likewise.
12234 * friend.c (do_friend): Likewise.
12235 * typeck.c (build_function_call_real): Likewise.
12236 (build_unary_op): Likewise.
12237
12238 Wed May 20 02:16:01 1998 Jason Merrill <jason@yorick.cygnus.com>
12239
12240 * decl2.c (start_objects, finish_objects, do_dtors,
12241 do_ctors): Split out from...
12242 (finish_file): ...here.
12243
12244 Tue May 19 20:36:23 1998 Jason Merrill <jason@yorick.cygnus.com>
12245
12246 * tree.c (is_overloaded_fn): Don't abort on placeholders from
12247 push_class_decls.
12248
12249 Tue May 19 15:16:22 1998 Brendan Kehoe <brendan@cygnus.com>
12250
12251 * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
12252
12253 * error.c (dump_expr): Handle an ARROW_EXPR.
12254
12255 Tue May 19 15:13:39 1998 Mark Mitchell <mmitchell@usa.net>
12256
12257 * decl.c (saveable_obstack): Declare.
12258 (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
12259 declare, if necessary.
12260
12261 Tue May 19 14:50:27 1998 Mark Mitchell <mmitchell@usa.net>
12262
12263 * call.c (compare_qual): Remove.
12264 (is_subseq): Tweak.
12265 (is_properly_derived_from): New function.
12266 (maybe_handle_ref_bind): Likewise.
12267 (maybe_handle_implicit_object): Likewise.
12268 (compare_ics): Modify substantially to bring into conformance with
12269 the standard.
12270 * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
12271 (comp_cv_qualification): Declare.
12272 (comp_cv_qual_signature): Likewise.
12273 * typeck.c (comp_cv_qualification): Likewise.
12274 (comp_cv_qual_signature): Likewise.
12275
12276 Tue May 19 10:05:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12277
12278 * Makefile.in (parse.o): Depend on toplev.h.
12279
12280 * class.c (typecode_p): Remove prototype and definition.
12281
12282 * cp-tree.h (currently_open_class, is_empty_class, member_p):
12283 Add prototype.
12284
12285 * decl.c (push_overloaded_decl_top_level): Remove prototype and
12286 definition.
12287
12288 * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
12289 in call to `cp_thing'.
12290 (cp_warning): Likewise for function pointer `warning'.
12291
12292 * except.c (do_function_call): Remove prototype and definition.
12293 (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
12294
12295 * method.c (is_java_type): Add prototype and make it static.
12296
12297 * parse.y: Include toplev.h.
12298
12299 * pt.c (type_unification): Remove unused variable `arg'.
12300 (instantiate_decl): Likewise for `save_ti'.
12301
12302 * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
12303
12304 Tue May 19 02:43:25 1998 Jason Merrill <jason@yorick.cygnus.com>
12305
12306 * init.c (build_member_call): Handle template_ids.
12307 * parse.y (primary): Add global_scope template_id.
12308
12309 Mon May 18 23:22:52 1998 Jason Merrill <jason@yorick.cygnus.com>
12310
12311 * decl2.c (get_sentry): Use end_temporary_allocation.
12312 Don't declare permanent_obstack.
12313
12314 Mon May 18 12:28:44 1998 Mark Mitchell <mmitchell@usa.net>
12315
12316 * parse.y (.finish_new_placement): New non-terminal.
12317 (unary_expr, new_type_id): Use it.
12318 * parse.c: Regenerated.
12319
12320 Mon May 18 12:20:27 1998 Brendan Kehoe <brendan@cygnus.com>
12321
12322 * pt.c (redeclare_class_template): Say where the original definition
12323 of the template-parameter's default argument appeared.
12324
12325 Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com>
12326
12327 * call.c (build_over_call): Tweak empty class handling.
12328
12329 * decl.c (make_typename_type): Use currently_open_class.
12330
12331 * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
12332
12333 Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
12334
12335 * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
12336 for a type unless it is one.
12337
12338 * class.c (finish_struct_1): Use OVL_CURRENT in error message.
12339
12340 Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com)
12341
12342 * Makefile.in (program_transform_name, objdir): Define.
12343
12344 * Makefile.in (BISON): Use bison from the build tree if it exists.
12345 (FLEX): Likewise.
12346
12347 Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
12348
12349 * typeck.c (type_unknown_p): Return true for TREE_LIST also.
12350
12351 * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
12352
12353 Sun May 17 14:51:41 1998 Jason Merrill <jason@yorick.cygnus.com>
12354
12355 * call.c (build_scoped_method_call): Likewise.
12356
12357 Sun May 17 13:53:48 1998 Mark Mitchell <mmitchell@usa.net>
12358
12359 * init.c (build_new_1): Call suspend_momentary around the creation
12360 of values that must be saved for exception handling.
12361 * parse.y (.build_new_placement): New non-terminal.
12362 (unary_expr, new_placement): Use it.
12363 * parse.c: Regenerated.
12364
12365 Sun May 17 12:32:08 1998 Jason Merrill <jason@yorick.cygnus.com>
12366
12367 * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
12368 old and new types.
12369
12370 * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
12371 canonical type.
12372
12373 * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
12374
12375 Fri May 15 20:28:00 1998 Jason Merrill <jason@yorick.cygnus.com>
12376
12377 * decl.c (start_decl): Revert problem change.
12378
12379 * Makefile.in (CONFLICTS): Fix.
12380
12381 Fri May 15 15:34:02 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
12382
12383 * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
12384
12385 Fri May 15 00:46:05 1998 Jason Merrill <jason@yorick.cygnus.com>
12386
12387 * class.c (finish_struct_1): Use BINFO_SIZE.
12388
12389 * decl.c (start_decl): Use 'tem'.
12390
12391 Thu May 14 16:30:47 1998 Andrew MacLeod <amacleod@cygnus.com>
12392
12393 * exception.cc: Include eh-common.h.
12394 (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL.
12395 (__cplus_type_matcher): First stab at new C++ runtime type matcher.
12396 (__cp_push_exception): Initialize eh_info struct as well.
12397 * except.c: Remove local structs and include eh-common.h.
12398 (init_exception_processing): Set language and version codes.
12399 (call_eh_info): Add presence of eh_info to runtime description of
12400 struct cp_eh_info.
12401 (expand_end_eh_spec): Call start_catch_block() and end_catch_block().
12402 * semantics.c (finish_try_block): Call start_catch_block() and
12403 end_catch_block().
12404 * parse.y (function_try_block): Call start_catch_block() and
12405 end_catch_block().
12406
12407 Thu May 14 12:27:34 1998 Brendan Kehoe <brendan@cygnus.com>
12408
12409 * typeck.c (original_type): New function.
12410 (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
12411 to see if they're actually the same.
12412 * cp-tree.h (original_type): Declare.
12413
12414 Wed May 13 12:54:30 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12415
12416 * Makefile.in (lex.o): Depend on output.h.
12417
12418 * call.c (add_function_candidate): Remove unused variable `cand'.
12419 (add_conv_candidate): Likewise.
12420 (build_builtin_candidate): Likewise.
12421
12422 * cp-tree.h: Add prototype for `types_overlap_p'.
12423
12424 * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
12425
12426 * decl2.c (merge_functions): Remove unused variables `tmp' and
12427 `tempn'.
12428
12429 * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
12430 (code_as_string): Likewise.
12431 (language_as_string): Likewise.
12432 (parm_as_string): Likewise.
12433 (op_as_string): Likewise.
12434 (assop_as_string): Likewise.
12435 (cv_as_string): Likewise.
12436
12437 * lex.c: Include output.h.
12438
12439 * pt.c (type_unification): Cast first argument of `bzero' to a char*.
12440
12441 * search.c (dfs_no_overlap_yet): Mark parameter `t' with
12442 ATTRIBUTE_UNUSED.
12443
12444 * tinfo.cc (__class_type_info::dcast): Change the type of variable
12445 `i' from int to size_t.
12446
12447 * typeck.c (language_lvalue_valid): Mark parameter `exp' with
12448 ATTRIBUTE_UNUSED.
12449
12450 Tue May 12 21:37:49 1998 Jason Merrill <jason@yorick.cygnus.com>
12451
12452 * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
12453 DECL_NAMESPACE_SCOPE_P.
12454 (lang_decl_name): Likewise.
12455 * pt.c (tsubst_friend_function, tsubst): Likewise.
12456 * decl.c (pushdecl, redeclaration_error_message, start_decl,
12457 cp_finish_decl, start_function): Likewise.
12458 * class.c (finish_struct_1): Likewise.
12459 * call.c (build_over_call): Likewise.
12460 (compare_ics): Use DERIVED_FROM_P.
12461
12462 Tue May 12 07:24:18 1998 Mark Mitchell <mmitchell@usa.net>
12463
12464 * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
12465 * method.c (build_mangled_name): Use it.
12466 (build_decl_overload_real): Likewise.
12467
12468 * error.c (dump_simple_decl): New function, broken out from ...
12469 (dump_decl): Use it.
12470
12471 Mon May 11 11:38:07 1998 Mark Mitchell <mmitchell@usa.net>
12472
12473 * ptree.c (lang_print_xnode): Add missing `break'.
12474
12475 * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
12476
12477 * call.c (add_template_candidate): Adjust for changes to
12478 fn_type_unification.
12479 (add_template_candidate_real): Likewise.
12480 (add_template_conv_candidate): Likewise.
12481 (build_user_type_conversion_1): Likewise.
12482 (build_new_function_call): Likewise.
12483 (build_object_call): Likewise.
12484 (build_new_op): Likewise.
12485 (build_new_method_call): Likewise.
12486 * class.c (instantiate_type): Likewise.
12487 * cp-tree.h (unification_kind_t): New type.
12488 (fn_type_unification): Adjust prototype.
12489 (type_unificaiton): Likewise.
12490 * pt.c (UNIFY_ALLOW_NONE): New macro.
12491 (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
12492 (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
12493 (UNIFY_ALLOW_DERIVED): Likewise.
12494 (unify): Change prototype.
12495 (maybe_adjust_types_for_deduction): New function.
12496 (check_cv_quals_for_unify): Likewise.
12497 (determine_specialization): Adjust.
12498 (fn_type_unification): Likewise.
12499 (type_unification): Likewise.
12500 (type_unification_real): Likewise. Use
12501 maybe_adjust_types_for_deduction. Fix mishandling of
12502 back-unification of template functions passed as arguments. Pass
12503 appropriate combination of UNIFY_ALLOW_* to unify.
12504 (unify): Remove unused NTPARMS parameter. Use
12505 check_cv_quals_for_unify. Remove bogus code that allowed
12506 too-generous unification in order to adhere more closely to standard.
12507 (get_bindings_real): Adjust.
12508 (get_class_bindings): Likewise.
12509
12510 * method.c (build_overload_identifier): Only use the innermost
12511 template arguments when mangling.
12512 * pt.c (tsubst_template_argument_vector): New function.
12513 (complete_template_args): Deal with the situation where the
12514 extra_args contain more than one level of arguments.
12515 (lookup_template_class): Deal with member template classes, which
12516 may have more than one level of arguments.
12517 (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
12518 Improve handling of member template classes. Use
12519 DECL_PRIMARY_TEMPLATE instead of inline expansion. Use
12520 tsubst_template_argument_vector where appropriate.
12521 (regenerate_decl_from_template): Break out from ...
12522 (instantiate_decl): Here.
12523
12524 * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
12525 * parse.h: Regenerated.
12526 * parse.c: Really regenerated.
12527
12528 * cp-tree.h (finish_unary_op_expr): New function.
12529 (finish_id_expr): Likewise.
12530 (begin_new_placement): Likewise.
12531 (finish_new_placement): Likewise.
12532 (finish_declarator): Likewise.
12533 (finish_translation_unit): Likewise.
12534 (finish_parmlist): Likewise.
12535 (begin_class_definition): Likewise.
12536 (finish_class_definition): Likewise.
12537 (finish_default_args): Likewise.
12538 (finish_inline_definitions): Likewise.
12539 * parse.y (GCC_ASM_KEYWORD): Remove.
12540 (TYPENAME_ELLIPSIS): Likewise.
12541 * parse.c: Regenerated.
12542 Use new functions in semantics.c in the actions for many rules.
12543 * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
12544 * hash.h: Regenerated.
12545 * semantics.c (finish_expr_stmt): Allow NULL expr.
12546 (finish_unary_op_expr): New function, containing
12547 code previously in parse.y.
12548 (finish_id_expr): Likewise.
12549 (begin_new_placement): Likewise.
12550 (finish_new_placement): Likewise.
12551 (finish_declarator): Likewise.
12552 (finish_translation_unit): Likewise.
12553 (finish_parmlist): Likewise.
12554 (begin_class_definition): Likewise.
12555 (finish_class_definition): Likewise.
12556 (finish_default_args): Likewise.
12557 (finish_inline_definitions): Likewise.
12558
12559 Sun May 10 23:43:13 1998 Mark Mitchell <mmitchell@usa.net>
12560
12561 * typeck.c (build_c_cast): Don't decay arrays and functions to
12562 pointer type when converting to a class type.
12563
12564 Sun May 10 22:53:56 1998 Jason Merrill <jason@yorick.cygnus.com>
12565
12566 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
12567 (DECL_CLASS_SCOPE_P): Likewise.
12568
12569 Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org)
12570
12571 * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
12572 * decl2.c (constructor_name_full): Likewise.
12573
12574 Sun May 10 22:48:12 1998 Mike Stump <mrs@wrs.com>
12575
12576 * tree.c (mapcar): Add OVERLOAD support.
12577
12578 * init.c (resolve_offset_ref): We must use basetype_path before we
12579 destroy it with a call to convert_pointer_to.
12580
12581 Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12582
12583 * class.c (currently_open_class): New fn.
12584 * decl.c (lookup_name_real): Use it.
12585 * search.c (lookup_field): Likewise.
12586
12587 Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
12588
12589 * cp-tree.def (OVERLOAD): New node.
12590 * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
12591 SET_IDENTIFIER_NAMESPACE_VALUE): Define.
12592 (NAMESPACE_BINDING): Remove.
12593 (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
12594 namespace_binding.
12595 (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
12596 Define.
12597 (tree_overload): New struct.
12598 (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
12599 (REAL_IDENTIFIER_TYPE_VALUE): Define.
12600 (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
12601 (lang_decl_flags): Remove in_namespace.
12602 (lang_decl): Remove chain.
12603 (DECL_CHAIN, DECL_NAMESPACE): Remove.
12604 (flag_honor_std): Declare extern.
12605 (identifier_type_value, pushdecl_namespace_level, push_using_decl,
12606 namespace_binding, set_namespace_binding,
12607 lookup_function_nonclass, cat_namespace_levels,
12608 set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
12609 scratch_ovl_cons, ovl_member, build_overload): Declare.
12610 (decl_list_length, get_namespace_id, current_namespace_id,
12611 overloaded_globals_p): Remove.
12612 (lookup_using_namespace, qualified_lookup_using_namespace): Change
12613 return type.
12614 (push_scratch_obstack): New macro.
12615 * call.c (add_function_candidate): Special-case type of OVERLOAD node.
12616 (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
12617 convs, fns.
12618 (build_new_function_call): Iterate using OVL_CHAIN.
12619 Print DECL_NAME in when reporting ambiguities.
12620 (build_object_call): Iterate using OVL_NEXT for fns, convs.
12621 (build_new_op): Call lookup_function_nonclass.
12622 Iterate using OVL_NEXT.
12623 (build_op_delete_call): Change detection of members.
12624 Do not wrap TREE_LIST around fields and single global functions.
12625 (build_over_call): Don't push a class level if the context is a
12626 namespace.
12627 (build_new_method_call): Iterate using OVL_NEXT.
12628 * class.c (add_method): Chain overloaded members using
12629 build_overload. Remove copying of method.
12630 (grow_method): When iterating through the obstack, expect OVERLOAD
12631 nodes. Chain overload members.
12632 (finish_struct_methods): Chain overload members. Unpack OVERLOAD
12633 nodes in call to get_baselinks.
12634 (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
12635 (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle
12636 fdecls that are OVERLOAD nodes.
12637 (validate_lhs): New function.
12638 (instantiate_type): Do not copy OVERLOAD nodes. Remove dead
12639 code. Use DECL_NAME in error messages. Split code between global
12640 and member function processing.
12641 * decl.c (global_type_node): New static variable.
12642 (in_std): New global.
12643 (struct binding_level): New field usings.
12644 (resume_binding_level): Assert that we are not in a class.
12645 (toplevel_bindings_p): Just check for namespace_p or
12646 pseudo_global.
12647 (resume_level): Remove.
12648 (find_binding): New function.
12649 (binding_for_name): Call it.
12650 (namespace_binding, set_namespace_binding): New functions.
12651 (push_namespace): Associate binding level with new namespace,
12652 resume_binding_level for existing namespace. Remove old code.
12653 Fake std by counting.
12654 (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
12655 (maybe_push_to_top_level): Save current namespace.
12656 (pop_from_top_level): Restore saved namespace.
12657 (pop_namespace): Call suspend_binding_level. Remove old code.
12658 (cat_namespace_levels): New function.
12659 (set_identifier_type_value_with_scope): For namespace bindings,
12660 set BINDING_TYPE, and use global_type_node.
12661 Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
12662 (identifier_type_value): New function.
12663 (pushtag): If no context, use current_namespace.
12664 (duplicate_decls): Don't process DECL_CHAIN.
12665 (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
12666 already set. Never reset it to NULL_TREE. Lookup global variables
12667 in their namespace. Push overloaded templates if they are on
12668 namespace level.
12669 (pushdecl_namespace_level): New function.
12670 (pushdecl_top_level): Implement using pushdecl_namespace_level.
12671 (pushdecl_using_decl): New function.
12672 (overloaded_globals_p): Remove.
12673 (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
12674 them. Use namespace_binding and set_namespace_value.
12675 (redeclaration_error_message): Complain if the declarations come
12676 from different namespaces.
12677 (lookup_tag): On namespace level, look in the BINDING_TYPE.
12678 (lookup_namespace_name): Pass tree_bindings from stack. Remove
12679 old code.
12680 (select_decl): New function.
12681 (lookup_name_real): Call it for qualified and unqualified lookup.
12682 Pass tree_bindings from the stack.
12683 If prefer_type is 1, also accept namespaces.
12684 (lookup_function_nonclass): New function.
12685 (init_decl_processing): Set the binding level of the global
12686 namespace to global_binding_level.
12687 Build a proper type list for __builtin_apply.
12688 Initialize std_node to "fake std" if flag_honor_std is set.
12689 Initialize global_type_node.
12690 Allocated bad_alloc in namespace std if flag_honor_std.
12691 (define_function): Set the DECL_CONTEXT to the current_namespace.
12692 (start_decl): A namespace is not considered as a context here. If
12693 the DECL_CONTEXT is a namespace, push the decl.
12694 (cp_finish_decl): Check for namespaces used as initializers.
12695 (grokfndecl): Add namespace parameter. Remove processing of
12696 DECL_CHAIN.
12697 (grokvardecl): Add namespace parameter.
12698 (grokdeclarator): Process SCOPEs that are namespaces. For
12699 mangling, temporarily set the DECL_CONTEXT on anonymous structs.
12700 (start_function): Check for contexts that are namespaces.
12701 Set context for declarations that have not been pushed.
12702 (store_parm_decls): Check for ::main only.
12703 (finish_function): Likewise.
12704 (start_method): Check for contexts that are namespaces.
12705 (start_method): Remove DECL_CHAIN processing.
12706 * decl2.c (flag_honor_std): Declare.
12707 (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
12708 (decl_namespace_list): New static global.
12709 (grok_x_components): Ignore namespaces as type contexts.
12710 (check_classfn): Expect OVERLOAD nodes.
12711 (grokfield): Remove DECL_CHAIN processing.
12712 (finish_file): Call cat_namespace_levels.
12713 (merge_functions): New function.
12714 (ambiguous_decl): Rewrite.
12715 (lookup_using_namespace): Produce tree_bindings.
12716 (qualified_lookup_using_namespace): Likewise.
12717 (set_decl_namespace, decl_namespace, current_decl_namespace,
12718 push_decl_namespace, pop_decl_namespace): New functions.
12719 (arg_lookup): New struct.
12720 (add_function, arg_assoc_namespace, arg_assoc_class,
12721 arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
12722 New functions.
12723 (get_namespace_id, current_namespace_id): Remove.
12724 (do_toplevel_using_decl): Rewrite.
12725 (do_class_using_decl): Complain about namespace qualifiers.
12726 (do_using_directive): Sorry if not on namespace level. Complain
12727 about unknown namespaces.
12728 * error.c (dump_aggr_type): Check for namespace contexts.
12729 * except.c (init_exception_processing): Push terminate into std.
12730 * friend.c (is_friend): A namespace is not a context, here.
12731 * init.c (expand_member_init): Remove DECL_CHAIN processing.
12732 (build_offset_ref): Process OVERLOAD nodes.
12733 * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
12734 * lex.c (identifier_type): Loop using OVL_CHAIN.
12735 (see_typename): Set looking_for_typename to 2.
12736 (real_yylex): Likewise.
12737 (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
12738 (do_scoped_id): Expect OVERLOAD nodes.
12739 Change calling convention for qualified_lookup_using_namespace.
12740 (build_lang_decl): Don't set in_namespace anymore.
12741 * method.c (typevec_size): New global.
12742 (build_overload_nested_name): Return if global_namespace.
12743 Otherwise, always expect a declaration context.
12744 (build_qualified_name): Likewise.
12745 Make sure we don't write beyond typevec_size.
12746 (build_decl_overload_real): Likewise.
12747 Allocate one extra slot for the namespace.
12748 (hack_identifier): Mark code dead.
12749 Process OVERLOAD and NAMESPACE_DECL nodes.
12750 * parse.y (program): Pop namespaces until in global namespace.
12751 (extdef): In a using-declaration, don't discard the identifier if
12752 there is no declaration.
12753 (left_curly): Ignore type contexts which are namespaces.
12754 (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
12755 used as scope.
12756 * pt.c (template_class_depth): Expect types to be namespaces.
12757 (determine_specialization): Simplify by expecting OVERLOAD nodes.
12758 (push_template_decl): Push into namespace level.
12759 Reset ctx if it is a namespace.
12760 Set DECL_CONTEXT to current_namespace if not set already.
12761 Ignore real contexts that are namespaces.
12762 (mangle_class_name_for_template): Skip global_namespace.
12763 Mangle other namespaces as declarations.
12764 (lookup_template_function): Set type of OVERLOAD nodes to unknown.
12765 (lookup_template_class): Push into namespace of context.
12766 If the context is a namespace, set it to global_namespace.
12767 Use id_context for mangling.
12768 (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
12769 (tsubst_friend_function): Ignore namespace contexts.
12770 Push into namespace level.
12771 (tsubst): Handle NAMESPACE_DECL nodes.
12772 Remove DECL_CHAIN processing.
12773 (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
12774 * ptree.c (print_lang_identifier): Print bindings.
12775 (lang_print_xnode): Print OVERLOAD nodes.
12776 * rtti.c (init_rtti_processing): Push type_info into std.
12777 * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
12778 (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
12779 dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
12780 lookup_fnfields_here): Likewise.
12781 Process all nodes, instead of going through TREE_CHAIN.
12782 * sig.c (build_signature_pointer_or_reference_type): Set context
12783 to global_namespace.
12784 (build_signature_table_constructor): Expect OVERLOAD nodes.
12785 * spew.c (yylex): Save old setting of looking_for_typename.
12786 * tree.c (decl_list_length): Remove.
12787 (binding_init): New function.
12788 (count_functions): Rewrite.
12789 (is_overloaded_fn): Expect OVERLOAD nodes.
12790 (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
12791 (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
12792 ovl_member): New functions.
12793 * typeck.c (require_complete_type): Expect OVERLOAD nodes.
12794 (type_unknown_p): Likewise.
12795 (require_instantiated_type): Likewise.
12796 (build_component_ref): Declare code dead.
12797 (build_x_function_call): Create and expect OVERLOAD nodes.
12798 (build_function_call_real): Check for ::main only.
12799 (build_unary_op): Likewise. Expect OVERLOAD nodes.
12800 (convert_for_assignment): Check for TREE_LIST before accessing
12801 TREE_VALUE.
12802 * decl.c (duplicate_decls): Check for namespace bindings instead
12803 of global bindings.
12804 (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
12805 lookup_name_current_level, start_decl, xref_tag,
12806 finish_enum): Likewise.
12807 * init.c (build_offset_ref): Likewise.
12808 * search.c (lookup_field): Likewise.
12809 (lookup_fnfields): Likewise.
12810 (dfs_debug_mark): Likewise.
12811 * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
12812 (poplevel_class, pop_from_top_level): Likewise.
12813 * decl2.c (finish_method): Likewise.
12814 * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
12815 * decl.c (record_builtin_type): Likewise.
12816 (init_decl_processing, grokfndecl): Likewise.
12817 * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
12818 (make_lang_type): Likewise.
12819 * parse.y (make_thunk): Likewise.
12820 * pt.c (tsubst): Likewise.
12821 * tree.c (debug_binfo): Likewise.
12822 * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
12823 tinfo2.cc, inc/new.h: Add std qualifications.
12824 * inc/new: Wrap with namespace std if __HONOR_STD.
12825 * inc/typeinfo: Likewise.
12826
12827 Fri May 8 00:43:50 1998 Jason Merrill <jason@yorick.cygnus.com>
12828
12829 * call.c (build_user_type_conversion_1): Handle second_conv
12830 properly for templates.
12831
12832 Thu May 7 17:09:25 1998 Andrew MacLeod <amacleod@cygnus.com>
12833
12834 * method.c (build_decl_overload_real): Set TREE_USED flag to
12835 zero for build_type_variants nodes as well.
12836
12837 Wed May 6 19:27:09 1998 Jason Merrill <jason@yorick.cygnus.com>
12838
12839 * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE.
12840
12841 Wed May 6 16:49:48 1998 Jim Wilson <wilson@cygnus.com>
12842
12843 * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o,
12844 except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o,
12845 rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o,
12846 xref.o): Add toplev.h dependencies.
12847
12848 Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com)
12849
12850 * errfn.c (cp_error, cp_warning): Remove declarations for
12851 error and warning respectively.
12852
12853 Wed May 6 14:28:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12854
12855 * error.c: Convert to using ctype macros defined in system.h.
12856 * method.c: Likewise.
12857 * xref.c: Likewise.
12858 * lex.c: Likewise. Also remove redundant system header stuff.
12859
12860 Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
12861
12862 * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
12863 expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c,
12864 search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c,
12865 xref.c: Add include of toplev.h.
12866
12867 Wed May 6 02:33:39 1998 Jason Merrill <jason@yorick.cygnus.com>
12868
12869 * tree.c (perm_manip): Also regenerate the RTL of an extern.
12870 (copy_to_permanent): Use end_temporary_allocation.
12871
12872 Tue May 5 23:54:04 1998 Jason Merrill <jason@yorick.cygnus.com>
12873
12874 * init.c (expand_vec_init): The initialization of each array
12875 element is a full-expression.
12876
12877 Tue May 5 18:24:13 1998 Andrew MacLeod <amacleod@cygnus.com>
12878
12879 * method.c (build_mangled_name): Add a call to build_type_variant
12880 to get the right type.
12881
12882 Tue May 5 01:25:03 1998 Jason Merrill <jason@yorick.cygnus.com>
12883
12884 * Makefile.in: Add .SUFFIXES.
12885
12886 * cp-tree.def: Remove NAMESPACE_DECL.
12887
12888 Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
12889
12890 * call.c (build_over_call): Do evaluate arg even if it has empty
12891 class type.
12892 * decl.c (start_function): Don't push a member function.
12893
12894 Thu Apr 30 18:59:23 1998 Jim Wilson <wilson@cygnus.com>
12895
12896 * Makefile.in (g++FAQ.info): Put -o option before input file.
12897
12898 Thu Apr 30 13:05:33 1998 Andrew MacLeod <amacleod@cygnus.com>
12899
12900 * gxxint.texi: Add info for squangling codes K and B.
12901
12902 Tue Apr 28 13:22:01 1998 Mark Mitchell <mmitchell@usa.net>
12903
12904 * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
12905 the expression in templates.
12906 (finish_stmt_expr): Likewise.
12907
12908 1998-04-28 Brendan Kehoe <brendan@cygnus.com>
12909
12910 * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int.
12911
12912 Mon Apr 27 13:58:10 1998 Mark Mitchell <mmitchell@usa.net>
12913
12914 * decl.c (maybe_push_to_top_level): Always clear
12915 current_template_parms and processing_template_decl.
12916 (pushtag): Remove check of current_class_type and some comments,
12917 since maybe_push_to_top_level no longer creates confusion.
12918
12919 Sun Apr 26 12:10:18 1998 Mark Mitchell <mmitchell@usa.net>
12920
12921 * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
12922 (DECL_CLASS_TEMPLATE_P): Likewise.
12923 (DECL_PRIMARY_TEMPLATE): Likewise.
12924 (PRIMARY_TEMPLATE_P): Use it.
12925 (push_template_decl_real): New function.
12926 (redeclare_class_template): Take new template parameters as
12927 input.
12928 (is_specialization_of): New function.
12929 (comp_template_args): Declare.
12930 * decl.c (pushtag): Handle friend template classes.
12931 (xref_tag): Likewise. Use new calling convention for
12932 redeclare_class_template.
12933 * decl2.c (grok_x_components): Handle friend templates.
12934 * friend.c (is_friend): Use is_specialization_of where
12935 appropriate. Deal with friend class templates.
12936 (make_friend_class): Let a class template be friends with itself.
12937 * pt.c (comp_template_args): Remove declaration.
12938 (tsubst_friend_class): New function.
12939 (push_template_decl_real): New function.
12940 (push_template_decl): Use it.
12941 (redeclare_class_template): Adjust for new calling convention.
12942 (comp_template_args): Give it external linkage.
12943 (instantiate_class_type): Use tsubst_friend_class to deal
12944 with friend templates.
12945 * typeck.c (comptypes): Use comp_template_args, rather than
12946 expanding it inline.
12947 * parse.y (component_decl): Handle a nested template type
12948 like other component type declarations.
12949
12950 * pt.c (check_explicit_specialization): Handle overloaded
12951 constructors correctly.
12952
12953 * pt.c (mabybe_get_template_decl_from_type_decl): New function.
12954 (lookup_template_class): Use it.
12955
12956 Thu Apr 23 21:19:06 1998 Jason Merrill <jason@yorick.cygnus.com>
12957
12958 * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops.
12959 * cp-tree.h: Add WRAPPER support.
12960 * call.c (add_candidate): Split out from add_*_candidate fns.
12961 (build_over_call): Take the candidate instead of function and args.
12962 Enforce access control here. Emit overload warnings here.
12963 (add_warning): New fn.
12964 (joust): Add WARN parm. If not set, call add_warning instead of
12965 printing a warning. Re-enable some warnings.
12966 (tourney): Pass it.
12967 (convert_like): Adjust.
12968 (build_new_op): Adjust.
12969 (build_new_function_call): Adjust.
12970 (build_user_type_conversion_1): Adjust.
12971 (USER_CONV_FN): Adjust.
12972 * tree.c (build_expr_wrapper, build_expr_ptr_wrapper,
12973 build_int_wrapper): New fns.
12974
12975 Thu Apr 23 18:27:53 1998 Mark P. Mitchell <mmitchell@usa.net>
12976
12977 * pt.c (unify): Fix typo in previous change.
12978
12979 Thu Apr 23 09:32:58 1998 Jason Merrill <jason@yorick.cygnus.com>
12980
12981 * error.c (dump_type_real): Declare canonical_name.
12982
12983 * typeck.c (comp_target_types): Fix PMFs.
12984
12985 Wed Apr 22 13:24:48 1998 Mark Mitchell <mmitchell@usa.net>
12986
12987 * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for
12988 the DECL_RESULTs of a member TEMPLATE_DECL, not just the
12989 TEMPLATE_DECL.
12990
12991 * pt.c (tsubst): Decrease the template-level of
12992 TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a
12993 TEMPLATE_PARM_INDEX.
12994 (template_decl_level): New function.
12995 (unify): Make sure to record unifications for template
12996 parameters, even when the parameters exactly match the arguments.
12997 Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
12998 TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that
12999 aren't from the level we're currently working on.
13000
13001 Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net>
13002
13003 * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
13004
13005 * decl2.c (check_member_template): Set DECL_IGNORED for member
13006 class templates, too.
13007
13008 * decl2.c (grokfield): Remangle the name of a member TYPE_DECL.
13009
13010 Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13011
13012 * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
13013
13014 Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com)
13015
13016 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare.
13017 * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
13018 (init_decl_processing): Handle TI types.
13019 * typeck.c (unsigned_type, signed_type): Handle TI types.
13020
13021 Sat Apr 18 15:25:21 1998 Jim Wilson <wilson@cygnus.com>
13022
13023 * g++spec.c (lang_specific_driver): New argument in_added_libraries.
13024 New local added_libraries. Increment count when add library to
13025 arglist.
13026
13027 Fri Apr 17 21:25:00 1998 Mark Mitchell <mmitchell@usa.net>
13028
13029 * cp-tree.h (type_as_string_real): New function.
13030 * pt.c (mangle_class_name_for_template): Use it.
13031 * error.c (dump_aggr_type): Change prototype.
13032 (dump_type_prefix): Likewise.
13033 (dump_type_suffix): Likewise.
13034 (dump_type_real): Convert from dump_type. If desired, the
13035 "canonica" name of a typedef, i.e., the name of the underlying
13036 type, can be printed.
13037 (dump_type): Call dump_type_real.
13038
13039 Fri Apr 17 14:30:45 1998 Jason Merrill <jason@yorick.cygnus.com>
13040
13041 * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks.
13042
13043 * typeck.c (comp_target_types): Tweak pedantic case.
13044 (comp_target_parms): Tweak pedantic case. Clean up somewhat.
13045 Return -1 or 1 instead of 1 or 2.
13046 (compparms): Remove STRICT handling.
13047 (convert_for_assignment): Fix handling of pmfs.
13048
13049 Fri Apr 17 14:04:16 1998 Mark Mitchell <mmitchell@usa.net>
13050
13051 * typeck.c (comp_target_types): Handle references like pointers.
13052 (comp_target_parms): Note that return code from comp_target_types
13053 can be negative to indicate failure.
13054
13055 Fri Apr 17 09:10:52 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
13056
13057 * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG),
13058 which requires a working target compiler to build.
13059
13060 Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com)
13061
13062 * tree.c (avoid_overlap): Add prototype.
13063
13064 * spew.c (num_tokens): Add prototype.
13065 (nth_noken, add_token, consume_token, debug_yychar): Likewise.
13066
13067 * search.c (dfs_check_overlap): Add prototype.
13068 (dfs_no_overlap_yet): Likewise.
13069
13070 * pt.c (original_template): Add prototype.
13071 (inline_needs_template_parms): Likewise.
13072 (push_inline_template_parms_recursive): Likewise.
13073 (retrieve_specialization, register_specialization): Likewise.
13074 (print_candidates, reduce_template_parm_level): Likewise.
13075 (build_template_decl, mark_template_parm): Likewise.
13076 (tsubst_friend_function, get_bindings_real): Likewise.
13077
13078 * method.c (start_squangling): Add prototype.
13079 (end_squangling, check_ktype, issue_ktype): Likewise.
13080 (build_overloaded_scope_ref, check_btype): Likewise.
13081 (build_mangled_template_parm_index): Likewise.
13082
13083 * lex.c (init_cpp_parse): Add prototype.
13084 (handle_cp_pragma, handle_sysv_pragma): Likewise.
13085 (reduce_cmp, token_cmp): Likewise.
13086
13087 * except.c (call_eh_info): Add prototype.
13088 (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise.
13089 (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise.
13090
13091 * decl2.c (is_namespace_ancestor): Add prototype.
13092 (namespace_ancestor, add_using_namespace): Likewise.
13093 (ambiguous_decl): Likewise.
13094
13095 * decl.c (indent): Add prototype.
13096
13097 * call.c (add_template_candidate_real): Add prototype.
13098
13099 Fri Apr 17 01:57:12 1998 Jason Merrill <jason@yorick.cygnus.com>
13100
13101 * decl2.c (build_expr_from_tree): Just return a PMF.
13102
13103 Fri Apr 17 00:45:12 1998 Mark Mitchell <mmitchell@usa.net>
13104
13105 * typeck2.c (process_init_constructor): Don't strip cv-qualifiers
13106 when doing initializations.
13107
13108 * pt.c (unify): Use comptypes to compare type args.
13109
13110 Fri Apr 17 00:24:22 1998 Jason Merrill <jason@yorick.cygnus.com>
13111
13112 * decl.c (duplicate_decls): Fix check for when it's safe to free
13113 the new decl.
13114
13115 * pt.c (mangle_class_name_for_template): Don't pass a typedef type
13116 to type_as_string.
13117
13118 Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
13119
13120 * pt.c (build_template_parm_index): Add prototype.
13121
13122 * search.c (my_tree_cons): Don't clear words outside the
13123 newly allocated node.
13124
13125 Wed Apr 15 15:34:44 1998 Dave Brolley <brolley@cygnus.com>
13126
13127 * lex.c (init_parse): Now returns char* containing the filename.
13128
13129 Wed Apr 15 13:20:06 1998 John Carr <jfc@mit.edu>
13130 Jeff Law <law@cygnus.com>
13131
13132 * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer
13133 than a pointer.
13134
13135 Sun Apr 12 22:31:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13136
13137 * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
13138
13139 Fri Apr 10 12:16:49 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
13140
13141 * decl.c (duplicate_decls): Don't warn for redundant decls if
13142 friend: let add_friend take care of it.
13143
13144 Thu Apr 9 02:40:48 1998 Jason Merrill <jason@yorick.cygnus.com>
13145
13146 * sig.c (build_signature_pointer_constructor): Don't set
13147 TREE_HAS_CONSTRUCTOR for a signature pointer.
13148 * cvt.c (ocp_convert): Don't force a temporary for internal structs.
13149 * init.c (resolve_offset_ref): Warn about implicit & on pmfs
13150 here, too.
13151 * typeck.c (build_unary_op): Only allow taking the address of a
13152 real constructor.
13153 * typeck2.c (digest_init): Simplify.
13154 (store_init_value): Don't pedwarn about using { } for pmfs.
13155
13156 Thu Apr 9 22:16:57 1998 Per Bothner <bothner@cygnus.com>
13157
13158 * cp-tree.h (start_decl): Update prototype.
13159 * decl.c (start_decl): Like the C version, new parameters
13160 for the attributes. Call cplus_decl_attributes here,
13161 (pushdecl): Like C version, do build_type_copy if TYPE_DECL,
13162 (grokdeclarator): Pass NULL for new start_decl arguments.
13163 * pt.c (tsubst_expr): Likewise.
13164 * parse.y: Merge cplus_decl_attribute calls into start_decl calls.
13165 * typeck.c (common_type): Check TYPE_MAIN_VARIANT.
13166 * lex.c (build_lang_decl): Add lang_name_java.
13167 * class.c (push_lang_context): Add lang_name_java.
13168 * method.c (build_mangled_name): Check for is_java_type.
13169
13170 Thu Apr 9 22:16:57 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
13171
13172 * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
13173 * call.c (build_scoped_method_call): Check for TREE_CODE for
13174 VOID_TYPE instead of type == void_type_node.
13175 (build_method_call): Likewise.
13176 * decl.c (lookup_name_real): Likewise.
13177 (grokdeclarator): Likewise.
13178 (start_decl): Likewise.
13179 (grokparms): Likewise.
13180 (start_function): Likewise.
13181 (finish_function): Likewise.
13182 (start_method): Likewise.
13183
13184 Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
13185
13186 * lex.c (finput): New variable.
13187 (init_cpp_parse): Renamed from init_parse.
13188 (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished.
13189 (finish_parse): New function.
13190 * cp-tree.h (init_lex, init_parse): Remove declarations.
13191
13192 Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
13193
13194 * call.c (build_call): Still evaluate the actual argument.
13195 * class.c (is_empty_class): Update for -fnew-abi.
13196
13197 * decl2.c: -fnew-abi implies -fsquangle.
13198
13199 * method.c (do_build_assign_ref): Don't do anything to copy
13200 an empty class.
13201 (do_build_copy_constructor): Likewise.
13202 * call.c (build_over_call): Likewise.
13203
13204 Sat Apr 4 18:43:58 1998 Jason Merrill <jason@yorick.cygnus.com>
13205
13206 * tree.c (avoid_overlap): Return a value.
13207
13208 Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com)
13209
13210 * method.c (check_btype): Add missing argument to xrealloc.
13211 (check_ktype): Likewise.
13212
13213 Fri Apr 3 02:22:59 1998 Jason Merrill <jason@yorick.cygnus.com>
13214
13215 Implement empty base optimization.
13216 * class.c (finish_struct_1): Add vbase fields earlier. Set
13217 CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty.
13218 * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns.
13219 (types_overlap_p): New fn.
13220 * tree.c (avoid_overlap): New fn.
13221 (build_base_fields): Use it to avoid overlapping empty bases.
13222 * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi.
13223
13224 * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
13225
13226 Re-implement allocation of base class subobjects.
13227 * tree.c (unshare_base_binfos): New fn.
13228 (layout_basetypes): Use it. Now handles offsets of both virtual and
13229 non-virtual bases, after layout_type.
13230 (layout_vbasetypes): Remove.
13231 (build_base_fields): Generate FIELD_DECLs for each non-virtual base.
13232 (build_vbase_pointer_fields): Split out from old layout_basetypes.
13233 * class.c (finish_base_struct): Lose offset handling code.
13234 Move nonvdtor warning here. Don't mess with t_binfo anymore.
13235 (finish_struct_1): Don't mess with t_binfo anymore. Use fns above.
13236 * cp-tree.h: Adjust.
13237
13238 Thu Apr 2 14:25:13 1998 Jason Merrill <jason@yorick.cygnus.com>
13239
13240 * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff.
13241 * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise.
13242 * class.c (duplicate_tag_error): Likewise.
13243 (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN.
13244 * tree.c (layout_vbasetypes): Update from layout_record, remove
13245 var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE.
13246 (layout_basetypes): Likewise.
13247
13248 Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com)
13249
13250 * class.c, Make sure system.h is included just after config.h.
13251 Delete lingering stdio and errno references too.
13252 * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise.
13253
13254 Wed Apr 1 15:38:36 1998 Jason Merrill <jason@yorick.cygnus.com>
13255
13256 * friend.c (is_friend): Fix access control for local classes.
13257
13258 * class.c (is_empty_class): New fn.
13259 * call.c (build_call): Don't pass empty class objects to a function.
13260
13261 Wed Apr 1 14:58:35 1998 Mark Mitchell <mmitchell@usa.net>
13262
13263 * call.c (build_over_call): Do name resolution for default
13264 arguments of function templates in the scope of the templates.
13265
13266 Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com)
13267
13268 * call.c: Include system.h. Remove includes, declarations and
13269 defines provided by system.h.
13270 * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
13271 * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
13272 * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
13273 * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
13274 * typeck2.c, xref.c: Likewise.
13275 * Makefile.in: Dependencies updated as appropriate.
13276 * Make-lang.in: Likewise.
13277
13278 Mon Mar 30 12:15:00 1998 Mark Mitchell <mmitchell@usa.net>
13279
13280 * pt.c (fn_type_unification): Allow incomplete unification without
13281 an immediate error message.
13282
13283 Mon Mar 30 08:55:42 1998 Jason Merrill <jason@yorick.cygnus.com>
13284
13285 * tree.c (member_p): New fn.
13286 * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for
13287 initializing class members.
13288
13289 * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'.
13290 * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX.
13291
13292 * call.c (build_method_call): Handle non-scoped destructors, too.
13293 * pt.c (tsubst_copy): Likewise.
13294
13295 * pt.c (print_template_context): Split out...
13296 (push_tinst_level): ...from here.
13297
13298 * friend.c (is_friend): Don't pass a type to decl_function_context.
13299
13300 * typeck.c (convert_for_initialization): Always hand off
13301 conversions to class type.
13302
13303 Sun Mar 29 20:01:59 1998 Jason Merrill <jason@yorick.cygnus.com>
13304
13305 * friend.c (is_friend): Local classes have the same access as the
13306 enclosing function.
13307
13308 Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com)
13309
13310 * typeck.c (expand_target_expr): Delete dead function.
13311
13312 * search.c: Put various prototypes inside #ifdef MI_MATRIX.
13313
13314 * repo.c (save_string): Delete dead function.
13315
13316 * method.c (thunk_printable_name): Delete dead function.
13317
13318 * lex.c (yynextch): Delete dead function.
13319
13320 * expr.c (tree_extract_aggr_init): #if 0 out.
13321
13322 * except.c (do_unwind): Delete dead function.
13323 (easy_expand_asm): Likewise.
13324
13325 * cvt.c (build_conversion_type_1): Delete dead function.
13326
13327 * cp-tree.h (push_expression_obstack): Declare.
13328
13329 * call.c (source_type): #if 0 out.
13330
13331 * class.c (alter_access): Remove unused label. Add braces
13332 around empty else clause.
13333
13334 * lex.c (yyprint): Fix argument to printf.
13335
13336 Sat Mar 28 17:43:52 1998 Mark Mitchell <mmitchell@usa.net>
13337
13338 * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
13339
13340 * pt.c (instantiate_class_template): Make sure template
13341 arguments are permanent.
13342 * init.c (resolve_offset_ref): Don't go looking around in
13343 template types.
13344
13345 * semantics.c: Add routines to handle expressions, and some
13346 declaration processing.
13347 * parse.y: Use them.
13348 (current_class_depth): Move declaration to cp-tree.h.
13349 * parse.c: Regenerated.
13350 * cp-tree.h: Use them.
13351 (current_class_depth): Declare.
13352 * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr.
13353
13354 Fri Mar 27 20:23:18 1998 Mark Mitchell <mmitchell@usa.net>
13355
13356 * error.c (dump_decl): Be a bit more explicit with template
13357 type arguments, when verbose.
13358
13359 Fri Mar 27 18:16:40 1998 Jason Merrill <jason@yorick.cygnus.com>
13360
13361 * inc/exception: Reorder closing braces.
13362
13363 Fri Mar 27 13:22:18 1998 Mark Mitchell <mmitchell@usa.net>
13364
13365 * pt.c (redeclare_class_template): New function.
13366 * cp_tree.h (redeclare_class_template): Declare it.
13367 * decl.c (xref_tag): Use it.
13368
13369 Thu Mar 26 11:16:30 1998 Jason Merrill <jason@yorick.cygnus.com>
13370
13371 * call.c (build_over_call): Check IS_AGGR_TYPE, not
13372 TYPE_LANG_SPECIFIC.
13373 * typeck.c (convert_arguments): Likewise.
13374
13375 * decl.c (grokdeclarator): Remove const and volatile from type after
13376 setting constp and volatilep.
13377
13378 * class.c (finish_struct_1): Don't warn about bool bitfield larger
13379 than one bit.
13380
13381 Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
13382
13383 * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
13384
13385 Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
13386
13387 * call.c (build_object_call): Complain about ambiguous operator(),
13388 rather that crashing.
13389 (build_new_op): Likewise.
13390 (build_op_delete_call): Likewise.
13391
13392 Thu Mar 26 10:23:24 1998 Mark Mitchell <mmitchell@usa.net>
13393
13394 * cvt.c (perform_qualification_conversions): Use comp_target_types
13395 instead of comp_ptr_ttypes.
13396
13397 Wed Mar 25 16:10:50 1998 Mark Mitchell <mmitchell@usa.net>
13398
13399 * cp-tree.h (enforce_access): Declare.
13400 * call.c (enforce_access): Make it extern, not static.
13401 * class.c (alter_access): Use enforce_access; modify code for ISO
13402 compliance, rather than ARM rules.
13403
13404 Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13405
13406 * cp-tree.h: Fix typo.
13407
13408 Wed Mar 25 02:01:02 1998 Jason Merrill <jason@yorick.cygnus.com>
13409
13410 * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
13411 if (aggregate_value_p (type)).
13412
13413 * decl2.c (constructor_name_full): Handle TYPENAME_TYPE.
13414
13415 Tue Mar 24 16:12:01 1998 Mark Mitchell <mmitchell@usa.net>
13416
13417 * tree.c (mapcar): When dealing with a DECL, use it's constant
13418 value, if any.
13419 * pt.c (lookup_template_class): Don't mangle the names of template
13420 classes whose arguments are unknown.
13421
13422 * pt.c (tsubst_expr): Handle GOTO_STMT correctly.
13423
13424 Tue Mar 24 12:21:55 1998 Benjamin Kosnik <bkoz@lisa.cygnus.com>
13425
13426 * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1.
13427
13428 Tue Mar 24 12:21:48 1998 Jim Wilson <wilson@cygnus.com>
13429
13430 * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for
13431 boolean_type_node to 1.
13432
13433 Tue Mar 24 10:23:47 1998 Mark Mitchell <mmitchell@usa.net>
13434
13435 * error.c (dump_expr): Remove unused variable `l'.
13436
13437 * pt.c (for_each_template_parm): New function, created by
13438 converting uses_template_parms.
13439 (tree_fn_t): New typedef.
13440 (uses_template_parms): Use it.
13441 (mark_template_parm): New function.
13442 (push_template_decl): Check that the argument list of a partial
13443 specialization uses all the template parameters.
13444
13445 * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
13446 with it; we might want it for debugging.
13447 * cp-tree.h (type_unification): Change interface.
13448 * class.c (finish_struct_1): Skip nested template types, just like
13449 ordinary nested types.
13450 (instantiate_type): Use new interface to type_unification.
13451 * lex.c (init_lex): Add __sz as opname for sizeof.
13452 * method.c (build_overload_scope_ref): New function.
13453 (build_overload_int): Handle complex expressions. Set
13454 numeric_output_need_bar if necessary.
13455 (build_overload_value): Handle non-PARM_DECL nodes; this
13456 routine is now used by build_overload_int. Remove some
13457 assignments to numeric_output_need_bar. Use
13458 build_overload_scope_ref.
13459 (build_qualified_name): Note that some template mangled names end
13460 with digits, and set numeric_output_need_bar appropriately. Use
13461 build_underscore_int.
13462 * pt.c (unify): Change interface.
13463 (type_unification_real): Likewise.
13464 (determine_specialization): Use new interfaces.
13465 (tsubst): Deal gracefully with situations in which the argument
13466 vector is not fully filled.
13467 (fn_type_unification): Use new interfaces.
13468 (type_unification): Likewise. Remove NOP_EXPR hack.
13469 (type_unification_real): Likewise.
13470 (unify): Likewise. Deal with unification of complex expressions.
13471
13472 Mon Mar 23 12:24:37 1998 Jason Merrill <jason@yorick.cygnus.com>
13473
13474 * pt.c (complete_template_args): Initialize skip properly.
13475
13476 * decl.c (make_typename_type): Revert.
13477 (make_implicit_typename): Remove.
13478 (lookup_name_real): Don't call it. Call lookup_field if we see a
13479 TYPE_DECL from a template base.
13480 * search.c (lookup_field): Do implicit typename stuff.
13481
13482 Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
13483 Geoff Noer <noer@cygnus.com>
13484
13485 * Makefile.in: Various fixes for building cygwin32 native toolchains.
13486 * Make-lang.in: Likewise.
13487
13488 Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13489
13490 * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify.
13491
13492 Fri Mar 20 10:42:07 1998 Jason Merrill <jason@yorick.cygnus.com>
13493
13494 * decl.c (make_implicit_typename): Rewrite removed code.
13495 (make_typename_type): Call it if the type we look up comes from
13496 a base that uses template parms.
13497
13498 * pt.c (complete_template_args): Rewrite.
13499 (tsubst, FUNCTION_DECL): Use it.
13500
13501 Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org)
13502
13503 * semantics.c (finish_asm_stmt): Fix combine strings. Call
13504 c_expand_asm_operands () if output_operands, input_operands or
13505 clobbers is not NULL_TREE.
13506
13507 Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13508
13509 * pt.c (complete_template_args): New function.
13510 (get_bindings): Deal with specializations of function templates
13511 with return type containing parameters from outer class
13512 templates.
13513 (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level,
13514 substitute arguments and compose a new type.
13515
13516 Thu Mar 19 19:01:48 1998 Mark Mitchell <mmitchell@usa.net>
13517
13518 * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new
13519 FUNCTION_DECLs.
13520
13521 Thu Mar 19 11:51:58 1998 Jason Merrill <jason@yorick.cygnus.com>
13522
13523 * decl.c (make_implicit_typename): Lose useless code.
13524
13525 * call.c (standard_conversion): Handle A* -> const A* properly.
13526
13527 * pt.c (get_bindings_real): Rename from get_bindings. Add
13528 check_rettype parm.
13529 (get_bindings): Pass 1.
13530 (get_bindings_overload): Pass 0.
13531
13532 Wed Mar 19 09:08:12 1998 Mark Mitchell <mmitchell@usa.net>
13533
13534 * pt.c (check_explicit_specialization): When reverting a static
13535 member function, also remove the `this' parameter from
13536 last_function_parms.
13537
13538 Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com>
13539
13540 * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
13541 a function context.
13542
13543 * decl.c (store_bindings): Use free_binding_vecs.
13544 (pop_from_top_level): Likewise.
13545
13546 Wed Mar 18 12:41:43 1998 Jason Merrill <jason@yorick.cygnus.com>
13547
13548 * decl.c (make_implicit_typename): Only change the type of a
13549 TYPENAME_TYPE.
13550
13551 Wed Mar 18 10:09:51 1998 Mark Mitchell <mmitchell@usa.net>
13552
13553 * semantics.c: New file, containing routines to perform the
13554 semantic phase of parsing.
13555 * parse.y: Use it.
13556 * pt.c (tsubst_expr): Likewise.
13557 * cp-tree.h: Declare the various functions in semantics.c.
13558 Provide macros to access _STMT tree nodes.
13559 * cp-tree.def: Add ASM_STMT tree node.
13560 * Makefile.in, Make-lang.in: Add dependencies on and for
13561 semantics.c.
13562
13563 Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com>
13564
13565 * pt.c (push_template_decl): Only check primary templates.
13566
13567 * pt.c (check_explicit_specialization): Complain about default args
13568 in explicit specialization.
13569
13570 * parse.y (nomods_initdcl0): Also call cp_finish_decl for a
13571 constructor_declarator.
13572
13573 Tue Mar 17 14:44:54 1998 Mark Mitchell <mmitchell@usa.net>
13574
13575 * typeck2.c (build_x_arrow): Don't crash when an aggregate type
13576 has no overloaded operator ->.
13577
13578 * call.c (build_field_call): Don't crash when presented with a
13579 field that is actually a nested type.
13580
13581 * decl.c (pushtag): Deal with friend class injection in local
13582 classes.
13583
13584 * call.c (build_object_call): Don't crash if OBJ is a
13585 pointer-to-member-function.
13586
13587 Tue Mar 17 11:40:26 1998 Jason Merrill <jason@yorick.cygnus.com>
13588
13589 * pt.c (push_template_decl): Complain about template with C linkage,
13590 anonymous template class.
13591
13592 Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
13593
13594 * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
13595 * search.c: Likewise.
13596
13597 * lex.c (do_pending_defargs): Only call
13598 maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
13599
13600 * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
13601
13602 Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
13603
13604 * parse.y: Deal with CONSTRUCTORS in new_initializers.
13605
13606 Mon Mar 16 10:54:21 1998 Mark Mitchell <mmitchell@usa.net>
13607
13608 * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
13609 closely mimics the behavior in parse.y.
13610 (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing
13611 into a compound statement.
13612
13613 Sun Mar 15 02:07:26 1998 Jason Merrill <jason@yorick.cygnus.com>
13614
13615 * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro.
13616 * pt.c (inline_needs_template_parms): New fn.
13617 (original_template): New fn.
13618 (push_inline_template_parms_recursive): New fn.
13619 (maybe_begin_member_template_processing): Use them.
13620 (maybe_end_member_template_processing): Likewise.
13621 (is_member_or_friend_template): Rename to is_member_template.
13622 Member functions of local classes are never member templates.
13623
13624 Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13625
13626 * lex.c (do_identifier): Handle TEMPLATE_DECL that was
13627 added in the class scope to catch redefinition error.
13628
13629 * pt.c (reduce_template_parm_level): Also copy
13630 the DECL_TEMPLATE_PARMS field.
13631
13632 Sun Mar 15 10:54:08 1998 Mark Mitchell <mmitchell@usa.net>
13633
13634 * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a
13635 reduced-level template type parameter.
13636
13637 Sun Mar 15 12:26:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
13638
13639 * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider.
13640 (DECL_NEEDS_FINAL_OVERRIDER_P): New macro.
13641 * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P.
13642 * decl.c (duplicate_decls): Propagate it.
13643 * typeck2.c (abstract_virtuals_error): Use two loops to emit
13644 abstract virtual functions and virtual functions which need a
13645 final overrider separately.
13646
13647 Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
13648
13649 * lang-specs.h: Properly put brackets around array elements in
13650 initializer.
13651
13652 * typeck.c (build_binary_op_nodefault): Correctly place parens around
13653 && and || in expression.
13654
13655 Thu Mar 12 09:26:04 1998 Manfred Hollstein <manfred@s-direktnet.de>
13656
13657 * call.c (default_parm_conversions): Remove prototype definition.
13658 (build_method_call): Remove unused variable result.
13659
13660 * cvt.c (ocp_convert): Remove unused variable conversion.
13661
13662 * decl2.c (ambiguous_decl): Add explicit parameter definition for name.
13663
13664 * except.c (do_unwind): #if 0 definition of unused variables fcall
13665 and next_pc.
13666
13667 * expr.c (extract_scalar_init): #if 0 prototype and function
13668 definition.
13669
13670 * init.c (expand_aggr_init_1): Remove unused variable init_type.
13671 (build_new_1): Remove unused variable t.
13672
13673 * pt.c (instantiate_class_template): Remove unused variable newtag;
13674 cast called function return value to void.
13675 (do_decl_instantiation): Remove unused variables name and fn.
13676
13677 * tree.c (get_type_decl): Add default return to shut up compiler from
13678 complaining control reaches end of non-void function.
13679
13680 * typeck.c (build_x_conditional_expr): Remove unused variable rval.
13681
13682 Thu Mar 12 09:12:15 1998 Manfred Hollstein <manfred@s-direktnet.de>
13683
13684 * call.c (default_parm_conversions): Remove prototype definition.
13685 (build_method_call): Remove unused variable result.
13686 (build_over_call): Add default case in enumeration switch.
13687
13688 Thu Mar 12 08:39:13 1998 Manfred Hollstein <manfred@s-direktnet.de>
13689
13690 * decl2.c (lang_decode_option): Change j's type to size_t.
13691
13692 * tree.c (layout_vbasetypes): record_align and desired_align are of
13693 type unsigned int; const_size and nonvirtual_const_size likewise.
13694
13695 Wed Mar 11 07:25:20 1998 Mark Mitchell <mmitchell@usa.net>
13696
13697 * parse.y (new_initializer): Make sure all initializers are
13698 lists.
13699
13700 Tue Mar 10 07:32:36 1998 Mark Mitchell <mmitchell@usa.net>
13701
13702 * decl2.c (import_export_decl): Mark tinfo functions for
13703 cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN.
13704
13705 Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com)
13706
13707 * method.c: Fix typo.
13708
13709 Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13710
13711 * method.c: Include "system.h" to get stdlib.h, stdio.h,
13712 ctype.h, string.h, etc.
13713 (issue_nrepeats): Add default case in enumeration switch.
13714 (check_btype): Likewise.
13715 (process_overload_item): Likewise.
13716
13717 * Makefile.in (method.o): Depend on system.h.
13718
13719 Wed Mar 4 22:26:53 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
13720
13721 * lex.c (do_scoped_id): Fix parenthesizing.
13722
13723 Wed Mar 4 12:11:53 1998 Michael Tiemann <tiemann@axon.cygnus.com>
13724
13725 * rtti.c (get_tinfo_fn_dynamic): If this function is called an
13726 FLAG_RTTI is unset, initialize type info machinery and continue
13727 with FLAG_RTTI enabled.
13728 (get_typeid): Likewise.
13729
13730 Wed Mar 4 11:47:55 1998 Jason Merrill <jason@yorick.cygnus.com>
13731
13732 * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
13733 from B.
13734
13735 Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
13736
13737 * pt.c (finish_member_template_decl): Deal more gracefully with
13738 invalid declarations.
13739
13740 Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
13741
13742 * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c,
13743 cp-tree.h: Clean up more old overloading code, old RTTI code, and
13744 some formatting quirks.
13745
13746 * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
13747 method.c, pt.c, ptree.c, typeck.c: Remove support for
13748 -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
13749 * class.h: Remove.
13750 * Makefile.in: Adjust.
13751
13752 * pt.c (unify): Don't allow reduced cv-quals when strict.
13753
13754 * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from
13755 *type_unification* and unify.
13756
13757 Mon Mar 2 12:11:06 1998 Jason Merrill <jason@yorick.cygnus.com>
13758
13759 * parse.y (explicit_template_type): Remove TEMPLATE keyword.
13760 (nested_name_specifier): And add it before this use.
13761 (typename_sub0): And this use. Also add use without the keyword.
13762 (typename_sub1): Likewise.
13763 * pt.c (instantiate_class_template): Don't actually instantiate
13764 anything if our type uses template parms.
13765
13766 Mon Mar 2 11:04:59 1998 Jim Wilson <wilson@cygnus.com>
13767
13768 * decl.c (start_function): Don't call temporary_allocation for a
13769 nested function.
13770
13771 Sun Mar 1 21:06:37 1998 Jason Merrill <jason@yorick.cygnus.com>
13772
13773 * pt.c (instantiate_class_template): Don't mess with friends if
13774 our type uses template parms.
13775
13776 Sat Feb 28 12:06:44 1998 Jason Merrill <jason@yorick.cygnus.com>
13777
13778 * parse.y (nested_name_specifier): Use explicit_template_type.
13779 (typename_sub): Allow a template_type, an explicit_template_type,
13780 or an implicit template type at the end.
13781 * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL.
13782 * decl.c (make_typename_type): Handle template-id where the name
13783 is a TEMPLATE_DECL.
13784 * call.c (build_scoped_method_call): Handle member template
13785 destructor call.
13786 * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member
13787 destructor is represented by the type.
13788
13789 * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro.
13790 * parse.y (nested_name_specifier): Add 'template' case.
13791 (explicit_template_type): New rule.
13792 (typename_sub): Use it.
13793 * decl.c (make_typename_type): Handle getting a template-id for NAME.
13794 * pt.c (tsubst): Likewise.
13795
13796 Fri Feb 27 11:17:50 1998 Jason Merrill <jason@yorick.cygnus.com>
13797
13798 * pt.c (add_to_template_args): Fix thinko.
13799 (instantiate_class_template): Call it later.
13800
13801 * pt.c (get_class_bindings): Add outer_args parm.
13802 (most_specialized_class): Likewise.
13803 (instantiate_class_template): Pass it.
13804 (more_specialized_class): Likewise.
13805 (lookup_template_class): Get context from template if none
13806 was specified.
13807 (finish_member_template_decl): Don't do anything with a
13808 partial specialization.
13809 * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of
13810 AGGREGATE_TYPE_P.
13811 * class.c (finish_struct): Member class templates have already been
13812 checked for name clashes.
13813 * decl.c (pushdecl_with_scope): Handle pushing at class level.
13814
13815 Fri Feb 27 02:25:16 1998 Jason Merrill <jason@yorick.cygnus.com>
13816
13817 * pt.c (tsubst, TEMPLATE_DECL): Support member class templates.
13818 (tsubst, *_PARM): Support multiple levels of template classes.
13819 (instantiate_class_template): Look up the pattern from the
13820 original template.
13821 (lookup_template_class): Handle getting a template for d1.
13822 (push_template_decl): Correct setting of 'primary'.
13823 (reduce_template_parm_level): Add 'levels' parm.
13824 (finish_member_template_decl): Support member class templates.
13825 (template_class_depth): Handle multiple levels.
13826 * parse.y (component_decl_1, fn.def2): Remove member template case.
13827 (component_decl): Add member template cases.
13828 * decl2.c (check_member_template): We now handle member template
13829 classes.
13830 * decl.c (pushtag): Handle member templates.
13831 * method.c (do_inline_function_hair): Don't touch
13832 IDENTIFIER_GLOBAL_VALUE.
13833 * init.c (build_offset_ref): If name isn't an identifier, just
13834 return it.
13835 * spew.c (yylex): Handle PTYPENAME like TYPENAME.
13836
13837 * typeck.c (get_delta_difference): Do adjust for conversions to
13838 and from virtual base.
13839
13840 Wed Feb 25 09:51:29 1998 Jason Merrill <jason@yorick.cygnus.com>
13841
13842 * typeck.c (get_delta_difference): Give hard error for conversion
13843 from virtual base.
13844
13845 * cp-tree.h: Tweak formatting.
13846
13847 Wed Feb 25 00:35:33 1998 Jason Merrill <jason@yorick.cygnus.com>
13848
13849 * decl.c (push_namespace): Handle redeclaration error.
13850
13851 * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro.
13852 (IDENTIFIER_NAMESPACE_BINDINGS): New macro.
13853 (NAMESPACE_BINDING): New macro.
13854 (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING.
13855 * *.c: Use them.
13856
13857 * pt.c (push_template_decl): Use innermost_args.
13858
13859 * decl.c (get_unique_name): Tweak from earlier in the name.
13860
13861 Tue Feb 24 22:15:04 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
13862
13863 * cp-tree.def: Add CPLUS_BINDING node.
13864 * cp-tree.h (tree_binding): New struct.
13865 (BINDING_SCOPE, BINDING_VALUE): New macros.
13866 (current_namespace, global_namespace): Declare extern.
13867 (struct lang_decl_flags): New field in_namespace.
13868 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros.
13869 (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros.
13870 (TREE_INDIRECT_USING): New macro.
13871 * decl2.c (current_namespace, global_namespace): Declare. The
13872 value is a NAMESPACE_DECL now, not a TREE_LIST.
13873 (is_namespace_ancestor, namespace_ancestor): New static functions.
13874 (add_using_namespace, ambiguous_decl): Likewise.
13875 (lookup_using_namespace): New support function for lookup_name.
13876 (qualified_lookup_using_namespace): New support function for
13877 do_scoped_id and lookup_namespace_name.
13878 (get_namespace_id): Mark as obsolete.
13879 (current_namespace_id): Likewise.
13880 (do_namespace_alias): Implement.
13881 (do_using_directive): Implement as call to add_using_namespace.
13882 * decl.c (binding_for_name): New function.
13883 (push_namespace, pop_namespace): Implement.
13884 (push_decl): Don't install a FUNCTION_DECL in the global branch.
13885 (lookup_namespace_name): Implement using qualified lookup.
13886 (lookup_name_real): For global scoping, lookup in
13887 global_namespace. For namespace scoping, lookup in given
13888 namespace. For unscoped lookup, iterate over namespace,
13889 considering using directives.
13890 (init_decl_processing): Initialize global_namespace.
13891 (grokvardecl): Build assembler name as static name for globals.
13892 (grokdeclarator): Remove old namespace mangling.
13893 (xref_tag): When installing a global binding for the
13894 tag, make sure we have an identifier.
13895 * method.c (build_overload_nested_name): Mangle namespaces.
13896 (build_qualified_name): Likewise.
13897 (build_decl_overload_real): Likewise.
13898 * lex.c (build_lang_decl): Set namespace for new declaration to
13899 current_namespace.
13900 (do_scoped_id): Find global names in global or current
13901 namespace, or using qualified namespace lookup, depending on
13902 context.
13903 * init.c (build_member_call): When scope is namespace, use
13904 build_x_function_call instead.
13905 (build_offset_ref): When scope is namespace, collapse processing
13906 to lookup_namespace_name instead.
13907 * error.c (dump_decl): Support NAMESPACE_DECL.
13908 * decl.c (pushdecl): Bind globals to current namespace.
13909 (push_overloaded_decl): Likewise.
13910 (lookup_tag): Likewise.
13911 (lookup_name_current_level): Likewise.
13912 (xref_tag): Likewise.
13913 (start_function): Likewise.
13914 * lex.c (do_identifier): Likewise.
13915 (identifier_typedecl_value): Likewise.
13916 (real_yylex): Likewise.
13917 * method.c (do_inline_function_hair): Likewise.
13918 * parse.y (unscoped): Likewise.
13919 * pt.c (check_explicit_specialization): Likewise.
13920 (lookup_template_class): Likewise.
13921 * rtti.c (call_void_fn): Likewise.
13922 * sig.c (build_sigtable): Likewise.
13923 * ptree.c (lang_print_xnode): New function.
13924
13925 Tue Feb 24 01:40:24 1998 Jason Merrill <jason@yorick.cygnus.com>
13926
13927 * pt.c (instantiate_class_template): Don't instantiate if pedantic
13928 and the args use template parms.
13929
13930 * pt.c (push_tinst_level): If the instantiation uses template parms,
13931 fail silently.
13932 * decl.c (xref_basetypes): Do call complete_type for basetypes
13933 that involve template parameters.
13934
13935 Tue Feb 24 00:36:43 1998 Jason Merrill <jason@yorick.cygnus.com>
13936
13937 * typeck2.c (process_init_constructor): Fix labeled init check.
13938
13939 Mon Feb 23 05:08:55 1998 Jason Merrill <jason@yorick.cygnus.com>
13940
13941 * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS
13942 argument to tsubst and friends.
13943
13944 * pt.c (tsubst, FUNCTION_DECL): Tidy.
13945
13946 * typeck.c (build_x_function_call): Handle static member function
13947 templates like non-templates. Handle friend templates like normal
13948 function templates.
13949 * pt.c (tsubst, *_PARM): Don't use orig_level.
13950 (get_bindings): Don't call add_to_template_args.
13951 (instantiate_template): Likewise.
13952 (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
13953 * ptree.c (print_lang_type): Print index/level for template parms.
13954
13955 Mon Feb 23 02:52:29 1998 Mark Mitchell <mmitchell@usa.net>
13956
13957 * Make-lang.in (cc1plus): Note that cc1plus depends on
13958 cp/cp-tree.h and cp/cp-tree.def.
13959
13960 * cp-tree.def (TEMPLATE_CONST_PARM): Remove.
13961 (TEMPLATE_PARM_INDEX): New tree code, used to indicate a
13962 position in a template parameter list.
13963 * cp-tree.h (template_parm_index): New structure, used as the tree
13964 structure for a TEMPLATE_PARM_INDEX.
13965 (TEMPLATE_PARM_IDX): New macro.
13966 (TEMPLATE_PARM_LEVEL): Likewise.
13967 (TEMPLATE_PARM_DESCENDANTS): Likewise.
13968 (TEMPLATE_PARM_ORIG_LEVEL): Likewise.
13969 (TEMPLATE_PARM_DECL): Likewise.
13970 (TEMPLATE_TYPE_PARM_INDEX): Likewise.
13971 (TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
13972 (TEMPLATE_TYPE_DECL): Likewise.
13973 (TEMPLATE_CONST_IDX): Remove.
13974 (TEMPLATE_CONST_LEVEL): Likewise.
13975 (TEMPLATE_CONST_SET_INFO): Likewise.
13976 (TEMPLATE_TYPE_SET_INFO): Likewise.
13977 (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
13978 node.
13979 (TEMPLATE_TYPE_LEVEL): Likewise.
13980 * decl.c (decls_match): Call comp_template_parms, rather than
13981 expanding it inline.
13982 (duplicate_decls): If two template declarations are being merged,
13983 then their TEMPLATE_INFOs should be merged as well.
13984 (grokfndecl): Save template-id information when declaring a friend
13985 with explicit template arguments. Pass arguments to
13986 check_explicit_specialization via correct convention; at some
13987 point check_explicit_specialization changed, but these call-sites
13988 did not.
13989 (grokdeclarator): Tidy up slightly.
13990 * decl2.c (check_classfn): Tidy up slightly. Don't assume that
13991 two template functions with the same DECL_ASSEMBLER_NAME the same,
13992 since the names are not yet mangled.
13993 * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
13994 TEMPLATE_CONST_PARM.
13995 (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the
13996 decl for a non-type parameter, rather than printing `<tparm ...>'.
13997 * friend.c (is_friend): Handle TEMPLATE_DECL friends.
13998 (do_friend): Deal with template friends.
13999 * lex.c (do_pending_inlines): Call
14000 maybe_begin_member_template_processing, rather than
14001 conditionally calling begin_member_template_processing.
14002 (process_next_inline): Likewise. Call
14003 maybe_end_member_template_processing, rather than
14004 conditionally calling end_member_template_processing.
14005 (do_pending_defargs): Likewise.
14006 (do_identifier): Use TEMPLATE_PARM_INDEX instead of
14007 TEMPLATE_CONST_PARM.
14008 * method.c (build_mangled_template_parm_index): New function.
14009 (build_overload_value): Use it.
14010 (build_overload_name): Likewise.
14011 * pt.c (finish_member_template_decl): Allow friend declarations.
14012 (template_class_depth): New function.
14013 (is_member_template): Rename, and modify, to become...
14014 (is_member_or_friend_template): New function.
14015 (end_member_template_processing): Rename, and modify, to become...
14016 (maybe_end_member_template_processing).
14017 (build_template_parm_index): New function.
14018 (reduce_template_parm_level): New function.
14019 (process_template_parm): Modify to use build_template_parm_index.
14020 (push_template_decl): Deal with friend templates.
14021 (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
14022 TEMPLATE_CONST_PARM.
14023 (tsubst_friend_function): New function.
14024 (instantiate_class_template): Generate the DECL_FRIENDLIST
14025 for a new instantiation by using tsubst_friend_function rather
14026 than just tsubst.
14027 (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
14028 Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
14029 appropriate new macros. Use reduce_template_parm_level to
14030 generate lower-level template parameters. Handle tsubst'ing into
14031 TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget
14032 to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
14033 templates. Similarly for the template parameters for a new
14034 template.
14035 (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead
14036 of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them.
14037 (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
14038 (get_bindings): Call add_to_template_args if necessary.
14039 (instantiate_decl): Handle instantiations of friend templates.
14040 * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
14041 TEMPLATE_TYPE_PARM as a list of fields; it's not!
14042 * spew.c (yylex): Do a little manual constant propagation to
14043 clarify the code.
14044
14045 Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com)
14046
14047 * error.c: Include sys/types.h.
14048
14049 Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com)
14050
14051 * method.c (build_mangled_name): Start CPP directives in column zero.
14052
14053 Thu Feb 19 10:36:48 1998 Jason Merrill <jason@yorick.cygnus.com>
14054
14055 * typeck2.c (process_init_constructor): Sorry about non-trivial
14056 labeled initializers.
14057 * parse.y (initlist): Re-enable labeled initializers.
14058
14059 Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
14060
14061 * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm,
14062 all callers changed. Rely on the new parameter instead of arg
14063 being a TREE_LIST when determine whether we are working inside
14064 template template parameter. Clean up is_type test.
14065
14066 Thu Feb 19 10:04:12 1998 Jason Merrill <jason@yorick.cygnus.com>
14067
14068 * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT.
14069 * typeck2.c (initializer_constant_valid_p): Allow conversions
14070 between pointers and references.
14071
14072 1998-02-19 Brendan Kehoe <brendan@cygnus.com>
14073
14074 * typeck.c (build_unary_op): Only warn about incr/decr a pointer
14075 if pedantic || warn_pointer_arith.
14076
14077 Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
14078
14079 * pt.c (unify): Handle TEMPLATE_DECL.
14080
14081 1998-02-18 Brendan Kehoe <brendan@cygnus.com>
14082
14083 * cp-tree.h (strip_attrs): Remove decl.
14084
14085 1998-02-18 Doug Evans <devans@cygnus.com>
14086
14087 * decl.c (duplicate_decls): Call merge_machine_decl_attributes.
14088 Update olddecl's attributes too.
14089 (strip_attrs): Remove function.
14090 * typeck.c (common_type): Call merge_machine_type_attributes.
14091
14092 Tue Feb 17 14:07:52 1998 Mark Mitchell <mmitchell@usa.net>
14093
14094 * parse.y (initdcl0_innards): New grammar symbol.
14095 (nomods_initdecls, nomods_initdcl0): Change type from itype to
14096 none, since the resulting value is never used.
14097 (parse_decl): New function.
14098 (datadef): Remove redundant actions.
14099 (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards.
14100 * parse.c: Regenerated.
14101
14102 Tue Feb 17 11:54:16 1998 Jason Merrill <jason@yorick.cygnus.com>
14103
14104 * parse.y (simple_stmt): Use getdecls() to check for decl.
14105
14106 Sat Feb 14 11:50:51 1998 Manfred Hollstein <manfred@s-direktnet.de>
14107
14108 * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
14109 macros.
14110 (c++.install-common): Install c++filt properly as native or as cross
14111 variant.
14112 (c++.uninstall): Add c++filt.
14113
14114 Fri Feb 13 14:55:37 1998 Jason Merrill <jason@yorick.cygnus.com>
14115
14116 * call.c (standard_conversion): Fix multi-level ptr conversions.
14117
14118 Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com>
14119
14120 * init.c (build_new): Propagate error_mark_node up.
14121
14122 Fri Feb 13 13:24:32 1998 Jason Merrill <jason@yorick.cygnus.com>
14123
14124 * parse.y (simple_stmt): If the condition isn't a declaration,
14125 start the controlled block after the test.
14126
14127 Fri Feb 13 02:26:10 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14128
14129 * call.c (build_over_call): Convert builtin abs, labs and fabs to
14130 tree-codes.
14131 * decl.c (init_decl_processing): Re-enable abs, labs and fabs as
14132 builtins.
14133
14134 Fri Feb 13 01:36:42 1998 Jason Merrill <jason@yorick.cygnus.com>
14135
14136 * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV.
14137
14138 Fri Feb 13 00:21:59 1998 Jason Merrill <jason@yorick.cygnus.com>
14139
14140 * cp-tree.h: Add access_protected_virtual_node.
14141 * class.c (init_class_processing): Initialize it.
14142 * decl.c (xref_basetypes): Use it.
14143 * parse.y (base_class_access_list): Likewise.
14144
14145 * Make-lang.in (DEMANGLER_PROG): Add $(exeext).
14146 (c++.install-common): Install c++filt.
14147
14148 Thu Feb 12 12:46:51 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14149
14150 * decl.c (shadow_tag): Give error for typedef-ing built-in types.
14151
14152 Wed Feb 11 23:28:05 1998 Mark Mitchell <mmitchell@usa.net>
14153
14154 * call.c (reference_binding): Use comptypes when comparing
14155 TYPE_MAIN_VARIANTS to handle non-canonical array/index types.
14156
14157 Wed Feb 11 16:42:04 1998 Mark Mitchell <mmitchell@usa.net>
14158
14159 * tree.c (is_overloaded_fn): Use really_overloaded_fn.
14160 (really_overloaded_fn): Move check here from is_overloaded_fn.
14161 (get_first_fn): Use really_overloaded_fn and is_overloaded_fn.
14162
14163 Wed Feb 11 15:54:18 1998 Mark Mitchell <mmitchell@usa.net>
14164
14165 * typeck.c (build_ptrmemfunc): Type-check pointer-to-member
14166 conversions.
14167
14168 Mon Feb 9 22:23:31 1998 Mark Mitchell <mmitchell@usa.net>
14169
14170 * cp-tree.h (push_template_decl): Return the decl passed in, or an
14171 equivalent duplicate.
14172 * decl.c (pushtag): Use the return value from push_template_decl.
14173 (duplicate_decls): When duplicating a template declaration, merge
14174 the DECL_TEMPLATE_RESULTs as well.
14175 (make_implicit_typename): Don't try to dive into typename types to
14176 find a context for making a new implicit typename.
14177 (start_decl): Use the return value from push_template_decl.
14178 (grokdeclarator): Complain about declarations list `const operator
14179 int'. Since we don't correctly handle in-class initializations of
14180 non-static data members, complain about this (now illegal)
14181 practice. Issue an error for initializations of non-const statics
14182 since that is illegal as well, and since we don't handle that case
14183 correctly either.
14184 (start_function): Use the return value from push_template_decl.
14185 (start_method): Likewise.
14186 * decl2.c (grokfield): Likewise. Since the change to
14187 grokdeclarator ensures that all initialized fields are in fact
14188 static, remove a redundant test for TREE_PUBLIC.
14189 * parse.y (initlist): Disable labeled initializers since they do
14190 not work as per the documentation, and since they do not use the
14191 same syntax as the C front end.
14192 * pt.c (push_template_decl): Return the decl passed in, or an
14193 equivalent duplicate.
14194 (lookup_template_class): When searching in a nested context,
14195 use the right arguments.
14196 (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL.
14197 * typeck.c (build_component_ref): Assign the correct type to the
14198 result of build_vfn_ref.
14199
14200 Tue Feb 10 23:56:46 1998 Jason Merrill <jason@yorick.cygnus.com>
14201
14202 * pt.c (convert_nontype_argument): Fix typo.
14203 (check_explicit_specialization): Allow old-style specialization
14204 of class template members.
14205
14206 Tue Feb 10 20:36:52 1998 Jason Merrill <jason@yorick.cygnus.com>
14207 Manfred Hollstein <manfred@s-direktnet.de>
14208
14209 * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead
14210 when deciding to override DECL_ASSEMBLER_NAME.
14211
14212 Tue Feb 10 15:30:55 1998 Andrew MacLeod <amacleod@torpedo.to.cygnus.com>
14213
14214 * decl2.c (lang_f_options): Add -fsquangle to option processing list.
14215 * cp-tree.h (flag_do_squangling): Add declaration.
14216 * lang-options.h: Add -fsquangle and -fno-squangle.
14217 * method.c: Add macros and static variables for squangling.
14218 (build_overload_name): Rename to build_mangled_name, add logic for B
14219 compression, and split into process_modifiers and
14220 process_overload_item.
14221 (process_modifiers): New function, to handle constant, reference,
14222 and pointer types.
14223 (process_overload_item): New function, handles issue of type codes.
14224 (build_overload_name): New function, start squangling and call
14225 build_mangled_name.
14226 (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline.
14227 (start_squangling): New function to initialize squangling structs.
14228 (end_squangling): New function to destroy squangling structs.
14229 (nrepeats): Rename variable to Nrepeats.
14230 (issue_nrepeats): New function for issuing 'n' type repeats.
14231 (check_ktype): New function to check for type K name compression.
14232 (build_overload_nested_name): Add a check for K name compression.
14233 (build_qualified_name): Add a check for K name compression and don't
14234 use DECL_ASSEMBLER_NAME when squangling is on.
14235 (check_btype): New function, checks for B type compression.
14236 (build_static_name, build_decl_overload_real): Initiate squangling.
14237 (build_typename_overload, build_overload_with_type): Initiate
14238 squangling
14239
14240 Sun Feb 8 23:47:38 1998 scott snyder <sss@d0linux01.fnal.gov>
14241
14242 * method.c (make_thunk): Avoid name buffer overflow.
14243
14244 Sat Feb 7 16:48:54 1998 Jason Merrill <jason@yorick.cygnus.com>
14245
14246 * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we
14247 don't define them yet.
14248
14249 * parse.y (nomods_initdcl0): Add constructor_declarator case.
14250
14251 Fri Feb 6 21:32:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
14252
14253 * config-lang.in (diff_excludes): Use basename only.
14254
14255 Thu Feb 5 19:10:40 1998 Jason Merrill <jason@yorick.cygnus.com>
14256
14257 * tinfo2.cc: Add tinfo for signed char.
14258
14259 Thu Feb 5 14:38:23 1998 Mike Stump <mrs@wrs.com>
14260
14261 * search.c (compute_access): Handle protected constructors in derived
14262 classes as accessible.
14263
14264 Wed Feb 4 01:26:49 1998 Jason Merrill <jason@yorick.cygnus.com>
14265
14266 * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
14267 Call convert_from_reference sooner.
14268
14269 Tue Feb 3 23:50:52 1998 Mark Mitchell <mmitchell@usa.net>
14270
14271 * cvt.c (ocp_convert): Obtain the constant values from constant
14272 decls even if the destination type is the same as the type of the
14273 decl.
14274
14275 * decl2.c (finish_file): Make sure that static inlines with
14276 definitions are not marked DECL_EXTERNAL before returning.
14277
14278 Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
14279
14280 * decl.c: Lose arg_looking_for_template.
14281 (lookup_name_real): Likewise.
14282 * parse.y: Lose processing_template_arg, template_arg1.
14283 (primary): Likewise.
14284 * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
14285
14286 Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
14287
14288 * error.c (dump_decl): Fix type of default arguments for template
14289 template parameters and nontype template parameters.
14290 * parse.y (template_parm): Handle invalid default template
14291 template arguments here.
14292
14293 * parse.y (template_parm): Use template_arg instead of PTYPENAME
14294 for default template template argument.
14295 * pt.c (coerce_template_parms): Merge default template argument
14296 codes. Can treat RECORD_TYPE as template name if it is implicitly
14297 created. Fix argument index in error message.
14298 * typeck.c (comptypes): Merge template argument comparison codes in
14299 TEMPLATE_TEMPLATE_PARM and RECORD_TYPE.
14300
14301 Tue Jan 6 01:42:44 1998 Mumit Khan <khan@xraylith.wisc.edu>
14302
14303 * lex.c (file_name_nondirectory): Also check for '/'.
14304
14305 Mon Feb 2 11:24:22 1998 Mark Mitchell <mmitchell@usa.net>
14306
14307 * parse.y (primary): Deal with statement-expressions in
14308 templates.
14309 * pt.c (tsubst_copy): Handle BIND_EXPR.
14310 * tree.c (mapcar): Likewise.
14311
14312 * call.c (add_template_candidate_real): Pass extra parameter to
14313 fn_type_unification.
14314 * cp-tree.h (fn_type_unification): Add parameter.
14315 * pt.c (fn_type_unification): Add additional parameter to deal with
14316 static member functions.
14317 (get_bindings): Deal with static member functions.
14318
14319 * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro.
14320 (revert_static_member_fn): Declare.
14321 * decl.c (revert_static_member_fn): Remove declaration. Change
14322 linkage from internal to external.
14323 (cp_finish_decl): Deal with virtual functions in classes local to
14324 template functions.
14325 * decl2.c (finish_file): Don't forget to emit increment/decrement
14326 expressions in initializers for file-scope variables.
14327 * parse.y (typename_sub2): If the typename doesn't names a
14328 template, rather than a type, issue an error message.
14329 * pt.c (check_explicit_specialization): Handle specializations of
14330 static member functions.
14331 (coerce_template_parms): Handle offset references to lists of
14332 member functions.
14333 * search.c (note_debug_info_needed): Don't crash when handed a
14334 type which is being defined.
14335 * typeck.c (complete_type): Don't crash when handed NULL_TREE;
14336 that can happen with some illegal code.
14337
14338 Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
14339
14340 * call.c (user_harshness): Initialize `code' to 0.
14341 (build_method_call): Initialize `candidates', `cp' and `len' to 0.
14342 (null_ptr_cst_p): Add parentheses around && within ||.
14343 (standard_conversion): Likewise.
14344 (z_candidate): Likewise.
14345 (build_user_type_conversion_1): Initialize `args' to NULL_TREE.
14346 (build_object_call): Likewise for `mem_args'.
14347 (build_new_op): Likewise for `mem_arglist'. Add `return' from
14348 default case in enumeration switch.
14349
14350 * class.c (build_vtable_entry): Add explicit braces to avoid
14351 ambiguous `else'.
14352 (build_class_init_list): Likewise.
14353 (finish_struct_1): Initialize `width' to 0.
14354 (instantiate_type): Initialize `name' to NULL_TREE. Add
14355 explicit braces to avoid ambiguous `else'.
14356
14357 * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous
14358 `else'.
14359
14360 * decl.c (grok_reference_init): Eliminate unused parameter, all
14361 callers changed.
14362 (record_builtin_type): Initialize `tdecl' to NULL_TREE.
14363 (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE.
14364 (cp_finish_decl): Initialize `ttype' to NULL_TREE.
14365 (grokdeclarator): Add parentheses around && within ||. Add
14366 explicit braces to avoid ambiguous `else'.
14367 (grokparms): Initialize `type' to NULL_TREE.
14368 (xref_tag): Remove unused label `just_return'.
14369 (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE.
14370 (finish_function): Initialize `cond' and `thenclause' to NULL_TREE.
14371 (hack_incomplete_structures): Add parentheses around assignment
14372 used as truth value.
14373
14374 * decl2.c (coerce_delete_type): Hide definition of `e3'.
14375
14376 * error.c: Include <stdlib.h>.
14377 (dump_expr): Change the type of `i' to size_t. Remove unused
14378 label `error'.
14379
14380 * except.c (init_exception_processing): Remove unused variable `d'.
14381 (expand_throw): Likewise for `label'.
14382
14383 * friend.c (add_friends): Add explicit braces to avoid ambiguous
14384 `else'.
14385
14386 * init.c (sort_member_init): Initialize `last_field' to NULL_TREE.
14387 (sort_base_init): Likewise for `binfo'.
14388 (expand_member_init): Likewise for `rval'.
14389 (build_member_call): Add parentheses around assignment used as
14390 truth value.
14391 (build_offset_ref): Add explicit braces to avoid ambiguous `else'.
14392 (build_new): Initialize `nelts' to NULL_TREE. Initialize
14393 `old_immediate_size_expand' to 0.
14394 (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE.
14395 (build_vec_delete_1): Remove unused variable `block'.
14396 (expand_vec_init): Initialize `itype' to NULL_TREE.
14397
14398 * lex.c: Include <strings.h> if we don't have <string.h>. Protect
14399 declaration of `index' and `rindex' with autoconf macros.
14400 (reinit_parse_for_expr): Remove unused variables
14401 `look_for_semicolon' and `look_for_lbrac'.
14402 (cons_up_default_function): Initialize `args' to NULL_TREE.
14403 (readescape): Initialize `firstdig' to 0.
14404 (real_yylex): Add parentheses around assignment used as truth value.
14405
14406 * method.c: Include <strings.h> if we don't have <string.h>.
14407 Protect declaration of `index' with autoconf macro.
14408
14409 * parse.y (primary): Add explicit braces to avoid ambiguous `else'.
14410 Initialize `type' to NULL_TREE.
14411 (structsp): Remove unused variable `id'.
14412
14413 * pt.c (coerce_template_parms): Add explicit braces to avoid
14414 ambiguous `else'.
14415 (lookup_template_class): Initialize `template' to NULL_TREE.
14416 (instantiate_class_template): Remove unused variable `name' and `e'.
14417 (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE.
14418 (do_poplevel): Initialize `saved_warn_unused' to 0.
14419 (type_unification): Remove unused varable `parm'.
14420 (unify): Likewise for `j'.
14421
14422 * repo.c (init_repo): Add parentheses around assignment used as
14423 truth value.
14424 (finish_repo): Remove unused varable `p'.
14425
14426 * search.c (get_binfo): Initialize `type' to NULL_TREE.
14427 (get_base_distance): Likewise.
14428 (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path'
14429 and `new_v' to NULL_TREE.
14430 (lookup_fnfields): Likewise for `rval_binfo_h'.
14431 (breadth_first_search): Add parentheses around assignment used as
14432 truth value.
14433 (get_template_base): Initialize `type' to NULL_TREE.
14434
14435 * sig.c (append_signature_fields): Initialize `last_mfptr' to
14436 NULL_TREE.
14437 (build_signature_table_constructor): Likewise for
14438 `last_rhs_field', `pfn' and `vt_off'.
14439 (build_sigtable): Likewise for `init'.
14440
14441 * tree.c (break_out_calls): Initialize `t2' to NULL_TREE.
14442 (propagate_binfo_offsets): Likewise for `delta'.
14443 (hash_tree_cons): Initialize hashcode to 0.
14444 (can_free): Likewise for `size'.
14445 (cp_tree_equal): Add explicit braces to avoid ambiguous `else'.
14446
14447 * typeck.c (convert_sequence): Hide prototype.
14448 (common_type): Add explicit braces to avoid ambiguous `else'.
14449 (comp_target_types): Likewise.
14450 (build_x_function_call): Initialize `ctypeptr' to NULL_TREE.
14451 (build_function_call_real): Add explicit braces to avoid ambiguous
14452 `else'.
14453 (convert_arguments): Initialize `called_thing' to 0.
14454 (convert_for_initialization): Initialize `savew' and `savee' to 0.
14455
14456 * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0.
14457 (digest_init): Initialize `old_tail_contents' to NULL_TREE.
14458 (build_x_arrow): Likewise for `last_rval'.
14459
14460 * xref.c (GNU_xref_decl): Initialize `cls' to 0.
14461
14462 Sun Feb 1 12:45:34 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
14463
14464 * decl.c (init_decl_processing): Use set_sizetype.
14465 * decl2.c (sizetype): Don't declare.
14466 * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype.
14467 (c_sizeof_nowarn, build_binary_op_nodefault): Likewise.
14468 (build_component_addr, unary_complex_lvalue): Likewise.
14469 * rtti.c (expand_class_desc): Likewise.
14470 * class.c (get_vfield_offset): Likewise.
14471
14472 Thu Jan 29 10:39:30 1998 Mark Mitchell <mmitchell@usa.net>
14473
14474 * pt.c (convert_nontype_argument): Move check for is_overloaded_fn
14475 early to avoid bogus error. Handle overloaded function
14476 names provided as template arguments correctly.
14477 (coerce_template_parms): Don't mishandle overloaded functions when
14478 dealing with template template parameters.
14479 (lookup_template_class): Issue an error message, rather than
14480 crashing, when the TYPE_DECL provided is not a template type.
14481
14482 Wed Jan 28 23:14:44 1998 Jason Merrill <jason@yorick.cygnus.com>
14483
14484 * class.c (instantiate_type): Don't just return a known type if
14485 it's wrong.
14486
14487 Wed Jan 28 11:04:07 1998 Mark Mitchell <mmitchell@usa.net>
14488
14489 * class.c (instantiate_type): Remove handling of FUNCTION_DECL
14490 since that code could never be reached.
14491
14492 * error.c (dump_decl): Avoid aborting in the midst of printing an
14493 error message about an illegal template declaration.
14494
14495 * parse.y (structsp): Print an error message, rather than crashing,
14496 when a class-head does not name a class.
14497
14498 * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE
14499 template arguments as a g++ extension.
14500
14501 * cp-tree.def (ALIGNOF_EXPR): New tree code.
14502 * decl2.c (grok_alignof): If processing_template_decl, just store
14503 the expression.
14504 * typeck.c (c_alignof): Likewise.
14505 * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR.
14506 * error.c (dump_expr): Likewise.
14507 * pt.c (tsubst_copy): Likewise.
14508 * tree.c (cp_tree_equal): Likewise.
14509 * pt.c (uses_template_parms): Correctly determine whether or not a
14510 SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant
14511 folding can be done.
14512
14513 * cp-tree.h (grok_enum_decls): Remove type parameter.
14514 * decl.c (grok_enum_decls): Likewise.
14515 * decl2.c (grok_x_components): Call grok_enum_decls
14516 unconditionally, since it will do nothing if there is no
14517 current_local_enum. Use the new calling sequence.
14518 * pt.c (tsubst_enum): Use the new calling sequence for
14519 grok_enum_decls.
14520
14521 * decl.c (start_function): Make member functions of local classes
14522 in extern inline functions have comdat linkage here...
14523 (grokdeclarator): Rather than here.
14524
14525 Wed Jan 28 10:55:47 1998 Jason Merrill <jason@yorick.cygnus.com>
14526
14527 * pt.c (convert_nontype_argument): Use decl_constant_value.
14528
14529 Tue Jan 27 16:42:21 1998 Mark Mitchell <mmitchell@usa.net>
14530
14531 * call.c (add_template_candidate_real): New function.
14532 (add_template_candidate): Use it.
14533 (add_template_conv_candidate): Likewise.
14534 (joust): Pass extra argument to more_specialized.
14535 * class.c (instantiate_type): Handle a single FUNCTION_DECL.
14536 (is_local_class): Remove.
14537 (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
14538 * cp-tree.h (is_local_class): Remove.
14539 (perform_array_to_pointer_conversion): Likewise.
14540 (finish_member_template_decl): Add.
14541 (check_explicit_specialization): Return a tree, not an int.
14542 (more_specialized): Take additional argument.
14543 (get_bindings): Likewise.
14544 (TI_PENDING_SPECIALIZATION_FLAG): New macro.
14545 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
14546 (perform_array_to_pointer_conversion): Remove.
14547 * decl.c (saved_scope): Add processing_specialization,
14548 processing_explicit_instantiation fields.
14549 (maybe_push_to_top_level): Save them.
14550 (pop_from_top_level): Restore them.
14551 (grokfndecl): Use new return value from
14552 check_explicit_specialization.
14553 (start_decl): Don't check flag_guiding_decls before pushing
14554 decls.
14555 (cp_finish_decl): Remove previous (bogus) change.
14556 (grok_declarator): Use decl_function_context rather than
14557 is_local_class.
14558 * decl2.c (finish_file): Pass extra argument to get_bindings.
14559 (build_expr_from_tree): Let build_x_component_ref check
14560 validity of arguments rather than doing it here.
14561 * lex.c (cons_up_default_function): Remove code fooling with
14562 processing_specialization, processing_explicit_instantiation
14563 flags, as that is now done in {maybe_push_top,pop_from}_top_level.
14564 * method.c (build_overload_identifier): Mangle local classes in
14565 template functions correctly.
14566 * parse.y (finish_member_template_decl): Move to pt.c.
14567 * pt.c (finish_member_template_decl): Moved here from parse.y.
14568 (print_candidates): New function.
14569 (determine_specialization): Change interface. Properly look for
14570 most specialized versions of template candidates.
14571 (check_explicit_specialization): Fully process explicit
14572 instantiations.
14573 (push_template_decl): Avoid looking at CLASSTYPE fields in
14574 FUNCTION_DECLS.
14575 (determine_overloaded_function): Remove.
14576 (convert_nontype_argument): Change name from
14577 convert_nontype_parameter. Use determine_overloaded_function
14578 instead of instantiate_type.
14579 (mangle_class_name_for_template): Handle type contexts as well as
14580 function contexts.
14581 (classtype_mangled_name): Likewise.
14582 (lookup_template_class): Likewise.
14583 (tsubst): Likewise.
14584 (more_specialized): Take explict template arguments as a
14585 parameter.
14586 (most_specialized): Likewise.
14587 (get_bindings): Likewise. Check that return types match before
14588 proclaiming a function a match.
14589 (do_decl_instantiation): Remove code searching for function to
14590 instantiate; that is now done in check_explicit_specialization.
14591 (add_maybe_template): Pass extra argument to get_bindings.
14592 * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
14593 implementation.
14594 * typeck.c (build_component_ref): Check for invalid arguments.
14595
14596 Tue Jan 27 01:44:02 1998 Jason Merrill <jason@yorick.cygnus.com>
14597
14598 * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
14599 return_target and call_target are equivalent.
14600
14601 * pt.c (type_unification_real): Just accept function parms that
14602 don't use any template parms.
14603
14604 Sun Jan 25 03:30:00 1998 Jason Merrill <jason@yorick.cygnus.com>
14605
14606 * decl.c (cp_finish_decl): When bailing on a comdat variable, also
14607 unset DECL_NOT_REALLY_EXTERN.
14608
14609 * parse.y (typename_sub*): Fix std::.
14610
14611 Sat Jan 24 12:13:54 1998 Jason Merrill <jason@yorick.cygnus.com>
14612
14613 * error.c (dump_decl): Fix type default template args.
14614 (dump_type): Hand TEMPLATE_DECL off to dump_decl.
14615
14616 Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
14617
14618 * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
14619 (file_name_nondirectory): Use.
14620
14621 Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
14622
14623 * pt.c (coerce_template_parms): Don't access elements of ARGLIST
14624 that are not really present. Substitute default arguments in
14625 template template arguments. Correctly convert TEMPLATE_DECL to
14626 TEMPLATE_TEMPLATE_PARM.
14627 (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM
14628 are no longer treated specially here.
14629 * parse.y (template_template_parm): Fix copy error.
14630 * decl.c (grokdeclarator): Warn about missing `typename' for nested
14631 type created from template template parameters.
14632 * parse.y (bad_parm): Likewise
14633
14634 * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM.
14635 (push_nested_class): Likewise.
14636 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code.
14637 * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro.
14638 (copy_template_template_parm): Declare.
14639 * decl.c (arg_looking_for_template): New variable.
14640 (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM.
14641 Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM
14642 node if arg_looking_for_template is nonzero.
14643 (pushdecl): Handle TEMPLATE_TEMPLATE_PARM.
14644 (grok_op_properties, xref_tag, xref_basetypes): Likewise.
14645 (grokdeclarator): Handle TEMPLATE_DECL.
14646 * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM.
14647 * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM.
14648 (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM.
14649 (dump_decl): Handle unnamed template type parameters.
14650 Handle template template parameters.
14651 (dump_function_name): Handle template template parameters.
14652 * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef):
14653 Handle TEMPLATE_TEMPLATE_PARM.
14654 * method.c (build_template_template_parm_names): New function.
14655 (build_template_parm_names): Handle TEMPLATE_DECL.
14656 (build_overload_nested_name, build_overload_name):
14657 Handle TEMPLATE_TEMPLATE_PARM.
14658 * parse.y (maybe_identifier): New nonterminal.
14659 (template_type_parm): Use it.
14660 (template_template_parm, template_arg1): New nonterminal.
14661 (template_parm): Add template_template_parm rules.
14662 (template_arg): Set processing_template_arg.
14663 (template_arg1): Rules moved from template_arg.
14664 (primary, nonnested_type): Set arg_looking_for_template if we are
14665 processing template arguments.
14666 * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL.
14667 (process_template_parm): Handle template template parameters.
14668 (coerce_template_parms, comp_template_args): Likewise.
14669 (mangle_class_name_for_template, lookup_template_class): Likewise.
14670 (uses_template_parms): Handle TEMPLATE_DECL and
14671 TEMPLATE_TEMPLATE_PARM.
14672 (current_template_args): Handle TEMPLATE_DECL.
14673 (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM.
14674 * search.c (dfs_walk, dfs_record_inheritance):
14675 Handle TEMPLATE_TEMPLATE_PARM.
14676 * tree.c (copy_template_template_parm): New function.
14677 (mapcar): Handle TEMPLATE_TEMPLATE_PARM.
14678 * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM.
14679
14680 Mon Jan 19 22:40:03 1998 Mark Mitchell <mmitchell@usa.net>
14681
14682 * decl.c (start_decl): Don't allow duplicate definitions of static
14683 data members.
14684
14685 * call.c (build_user_type_conversion_1): Handle user-defined
14686 template conversion operators correctly.
14687
14688 * decl2.c (build_expr_from_tree): Issue an error message if the
14689 object in a COMPONENT_REF is a TEMPLATE_DECL.
14690
14691 * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs.
14692
14693 * class.c (is_local_class): New function.
14694 * cp-tree.h (is_local_class): Declare it.
14695 (last_tree): Likewise.
14696 (begin_tree): Likewise.
14697 (end_tree): Likewise.
14698 (lookup_template_class): Change prototype.
14699 * decl.c (cp_finish_decl): Check for NULL where necessary.
14700 Consider FUNCTION_DECLS to declare objects with top-level binding,
14701 when calling make_decl_rtl.
14702 (grokdeclarator): Give members of local classes internal linkage.
14703 (start_function): Remove declaration of last_tree.
14704 (finish_function): Set flag_keep_inline_functions around call to
14705 rest_of_compilation if we are processing a member function in a
14706 local class.
14707 (start_method): Call push_template_decl for member functions of
14708 local classes in template functions.
14709 * decl2.c (import_export_decl): Don't give external linkage to
14710 instantiations of templates with internal linkage.
14711 * parse.y (last_tree): Remove declaration.
14712 (template_type): Pass extra parameter to lookup_template_class.
14713 (self_template_type): Likewise.
14714 (structsp): Move call to reset_specialization into left_curly.
14715 (left_curly): Call reset_specialization, and begin_tree.
14716 * pt.c (saved_trees): New variable.
14717 (mangle_class_name_for_template): Change prototype. Use
14718 additional function context to name local classes in templates
14719 correctly.
14720 (classtype_mangled_name): Pass the context.
14721 (push_template_decl): Handle local classes and templates, and
14722 member functions for such classes.
14723 (convert_nontype_parameter): Fix handling of pointer-to-member
14724 constants.
14725 (lookup_template_class): Handle local classes in templates.
14726 (tsubst): Likewise. Don't assume that template instantiations
14727 have external linkage; pay attention to the template declaration.
14728 (mark_decl_instantiated): Likewise.
14729 (begin_tree): New function.
14730 (end_tree): Likewise.
14731
14732 * decl.c (xref_basetypes): Don't call complete_type for basetypes
14733 that involve template parameters; that can lead to infinite
14734 recursion unnecessarily.
14735
14736 * pt.c (register_specialization): Do not register specializations
14737 that aren't ready to be registered yet.
14738 (check_explicit_specialization): Handle explicit specialization of
14739 constructors and destructors.
14740 (build_template_decl): New function.
14741 (push_template_delc): Handle out-of-class specializations of
14742 member templates.
14743
14744 * pt.c (check_explicit_specialization): Set up the template
14745 information before registering the specialization.
14746 (coerce_template_parms): Fix thinko.
14747 (tsubst): Handle specializations of member templates correctly.
14748
14749 * class.c (finish_struct_methods): Remove calls to
14750 check_explicit_specialization from here.
14751 (finish_struct): And insert them here.
14752 * cp-tree.h (perform_qualification_conversions): New function.
14753 (perform_array_to_pointer_conversion): Likewise.
14754 (begin_explicit_instantiation): Likewise.
14755 (end_explicit_instantiation): Likewise.
14756 (determine_specialization): Renamed from
14757 determine_explicit_specialization.
14758 (comp_template_parms): New function.
14759 (processing_explicit_instantiation): New variable.
14760 * cvt.c (perform_qualification_conversions): New function.
14761 (perform_array_to_pointer_conversion): Likewise.
14762 * decl.c (duplicate_decls): Don't consider template functions
14763 alike unless they have the same parameters. Refine handling of
14764 instantiation/specialization mismatches.
14765 (start_decl): Don't call pushdecl for template specializations,
14766 since they don't affect overloading.
14767 (start_function): Likewise.
14768 (grokfndecl): Call check_explicit_specialization a little later.
14769 Don't call duplicate_decls for memberm template specializations.
14770 (grokdeclarator): Don't update template_count for classes that are
14771 themselves specializations. Remove use of `2' as parameter to
14772 grokfndecl since that value isn't used.
14773 * lex.c (cons_up_default_function): Save and restore
14774 processing_explicit_instantiation around calls to grokfield.
14775 * parse.y (finish_member_template_decl): New function.
14776 (component_decl_1): Use it.
14777 (fn.def2): Likewise.
14778 (template_arg_list_opt): New nonterminal.
14779 (template_type): Use it.
14780 (self_template_type): Likewise.
14781 (template_id): Likewise.
14782 (object_template_id): Likewise.
14783 (notype_template_declarator): Likwise.
14784 (begin_explicit_instantiation): Likewise.
14785 (end_explicit_instantiation): Likewise.
14786 (explicit_instantiation): Use them.
14787 * pt.c (coerce_template_parms): Add parameters.
14788 (processing_explicit_instantiation): New variable.
14789 (convert_nontype_parameter): New function.
14790 (determine_overloaded_function): Likewise.
14791 (begin_explicit_instantiation): Likewise.
14792 (end_explicit_instantiation): Likewise.
14793 (retrieve_specialization): Likewise.
14794 (register_specialization): Likewise.
14795 (processing_explicit_specialization): Removed.
14796 (determine_specialization): Handle specializations of member
14797 functions of template class instantiations.
14798 (check_explicit_specialization): Refine to conform to standard.
14799 (comp_template_parms): New function.
14800 (coerce_template_parms): Call convert_nontype_parameter.
14801 (tsubst): Refine handling of member templates. Use
14802 register_specialization.
14803 (instantiate_template): Use retrieve_specialization.
14804 (do_decl_instantiation): Likewise.
14805 (instantiate_decl): Likewise.
14806 (type_unification): Improve handling of explict template
14807 arguments.
14808 * tree.c (mapcar): Return error_mark_node, rather than aborting,
14809 on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
14810 * typeck.c (build_unary_op): Call determine_specialization, rather
14811 than determine_explicit_specialization.
14812
14813 Mon Jan 19 13:18:51 1998 Jason Merrill <jason@yorick.cygnus.com>
14814
14815 * cvt.c (build_up_reference): A TARGET_EXPR has side effects.
14816
14817 Fri Jan 16 11:40:50 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14818
14819 * error.c (dump_decl): For enum tags, output the tag, not its value.
14820
14821 1998-01-13 Brendan Kehoe <brendan@cygnus.com>
14822
14823 * decl.c (init_decl_processing): Only call init_rtti_processing
14824 FLAG_RTTI is set.
14825
14826 Mon Jan 12 01:35:18 1998 Jason Merrill <jason@yorick.cygnus.com>
14827
14828 * init.c (build_new_1): Split out from build_new.
14829 (build_new): Just return a NEW_EXPR.
14830 * expr.c (cplus_expand_expr): Handle NEW_EXPR.
14831
14832 * decl2.c (get_temp_regvar): Tweak.
14833
14834 * cp-tree.h (TREE_CALLS_NEW): Comment out.
14835 * class.c (resolves_to_fixed_type_p): Remove use.
14836 * method.c (build_opfncall): Likewise.
14837 * call.c (build_new_op): Likewise.
14838
14839 Wed Jan 7 23:47:13 1998 Jason Merrill <jason@yorick.cygnus.com>
14840
14841 * exception.cc (__eh_alloc, __eh_free): New fns.
14842 (__cp_push_exception, __cp_pop_exception): Use them.
14843 (__uncatch_exception): Call terminate here if no exception.
14844 * except.c (build_terminate_handler): New fn.
14845 (expand_start_catch_block): Use it.
14846 (expand_exception_blocks): Likewise.
14847 (alloc_eh_object): New fn.
14848 (expand_throw): Use it. Protect exception init with terminate.
14849 * typeck.c (build_modify_expr): Remove code that ignores trivial
14850 methods.
14851
14852 Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
14853
14854 * call.c (add_builtin_candidate): Add default case in enumeration
14855 switch.
14856 (build_new_op): Likewise.
14857 (convert_like): Likewise.
14858 * cvt.c (build_expr_type_conversion): Likewise.
14859 * tree.c (real_lvalue_p): Likewise.
14860 (lvalue_p): Likewise.
14861 (cp_tree_equal): Likewise.
14862 * typeck.c (comptypes): Likewise.
14863 (build_component_ref): Likewise.
14864 (build_function_call_real): Likewise.
14865 (build_binary_op_nodefault): Likewise.
14866 (build_unary_op): Likewise.
14867 (build_modify_expr): Likewise.
14868 * typeck2.c (initializer_constant_valid_p): Likewise.
14869
14870 Sun Dec 21 15:59:00 1997 Nick Clifton <nickc@cygnus.com>
14871
14872 * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas.
14873
14874 Thu Dec 18 14:51:50 1997 Mark Mitchell <mmitchell@usa.net>
14875
14876 * pt.c (coerce_template_parms): Make sure to digest_init if
14877 possible.
14878
14879 * decl.c (duplicate_decls): Make the newdecl virtual if the
14880 olddecl was, just as is done with other attributes of olddecl.
14881
14882 Thu Dec 18 14:43:19 1997 Jason Merrill <jason@yorick.cygnus.com>
14883
14884 * typeck.c (unary_complex_lvalue): Ignore op0 when taking the
14885 address of an OFFSET_REF.
14886
14887 * cp-tree.def: Add AGGR_INIT_EXPR.
14888 * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
14889 AGGR_INIT_EXPR where appropriate.
14890 * expr.c (cplus_expand_expr): Likewise. Simplify.
14891
14892 * decl2.c (finish_file): Remove call to register_exception_table.
14893
14894 Wed Dec 17 17:08:52 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14895
14896 * pt.c (instantiate_class_template): Don't do injection when
14897 processing_template_decl is true, as pollutes current_binding_level
14898 for base classes.
14899
14900 Wed Dec 17 21:17:39 1997 Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de>
14901
14902 * pt.c (maybe_fold_nontype_arg): Add prototype.
14903
14904 Tue Dec 16 10:31:20 1997 Jason Merrill <jason@yorick.cygnus.com>
14905
14906 * tree.c (mapcar): Handle TRY_CATCH_EXPR et al.
14907 * error.c (dump_expr): Likewise.
14908
14909 Mon Dec 15 12:22:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14910
14911 * typeck.c (build_function_call_real): Remove "inline called before
14912 definition" pedwarn.
14913
14914 * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg.
14915
14916 Sun Dec 14 22:34:20 1997 Jason Merrill <jason@yorick.cygnus.com>
14917
14918 * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
14919
14920 * pt.c (type_unification_real): Change __null to type void* with
14921 a warning.
14922
14923 Sun Dec 14 20:38:35 1997 Mark Mitchell <mmitchell@usa.net>
14924
14925 * call.c (implicit_conversion): Don't call
14926 build_user_type_conversion_1 with a NULL expr, since it will
14927 crash.
14928
14929 * pt.c (unify): Don't try to unify array bounds if either array is
14930 unbounded.
14931
14932 Fri Dec 12 16:09:14 1997 Jason Merrill <jason@yorick.cygnus.com>
14933
14934 * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at):
14935 Replace extern decls with casts.
14936
14937 * decl.c (expand_start_early_try_stmts): Don't mess with a sequence.
14938 Update last_parm_cleanup_insn.
14939 (store_after_parms): Remove.
14940 * cp-tree.h: Adjust.
14941
14942 Thu Dec 11 22:18:37 1997 Jason Merrill <jason@yorick.cygnus.com>
14943
14944 * decl2.c (comdat_linkage): Also set DECL_COMDAT.
14945 (finish_file): Check DECL_COMDAT instead of weak|one_only.
14946 (import_export_vtable): Use make_decl_one_only instead of
14947 comdat_linkage for win32 tweak.
14948 (import_export_decl): Likewise.
14949 * pt.c (mark_decl_instantiated): Likewise.
14950
14951 * decl2.c (finish_file): Lose handling of templates in pending_statics.
14952
14953 Thu Dec 11 21:12:09 1997 Jason Merrill <jason@yorick.cygnus.com>
14954
14955 * decl2.c (finish_file): Lose call to expand_builtin_throw.
14956 * except.c (expand_builtin_throw): Remove.
14957 * cp-tree.h: Remove ptr_ptr_type_node.
14958 * decl.c: Likewise.
14959
14960 Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
14961
14962 * decl.c (ptr_ptr_type_node): Define.
14963 (init_decl_processing): Initialize it.
14964 * cp-tree.h: Declare it.
14965 * exception.cc (__cp_exception_info): Use __get_eh_info.
14966 (__cp_push_exception): Likewise.
14967 (__cp_pop_exception): Likewise.
14968
14969 From Scott Snyder <snyder@d0sgif.fnal.gov>:
14970 * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
14971 saved_pc.
14972 (init_exception_processing): Removed saved_pc initialization.
14973
14974 Wed Dec 10 11:04:45 1997 Jason Merrill <jason@yorick.cygnus.com>
14975
14976 * pt.c (instantiate_decl): Defer all templates but inline functions.
14977
14978 Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14979
14980 * init.c (expand_vec_init): Don't fold a list of parameters.
14981
14982 * decl.c (copy_args_p): Handle copy elision for types with virtual
14983 bases.
14984 * call.c (build_over_call): Likewise.
14985
14986 Sun Dec 7 22:38:12 1997 Mark Mitchell <mmitchell@usa.net>
14987
14988 * pt.c (lookup_template_function): Copy the template arguments,
14989 not just the list containing them, to the permanent obstack.
14990
14991 Sun Dec 7 15:53:06 1997 Jason Merrill <jason@yorick.cygnus.com>
14992
14993 * except.c (expand_start_catch_block): suspend_momentary for the
14994 terminate handler.
14995
14996 * error.c (dump_decl): Handle LOOKUP_EXPR.
14997
14998 Sun Dec 7 15:45:07 1997 Mark Mitchell <mmitchell@usa.net>
14999
15000 * rtti.c (build_dynamic_cast): Copy the cast-to type to the
15001 permanent obstack if we are processing a template decl.
15002 * typeck.c (build_static_cast): Likewise.
15003 (build_const_cast): Likewise.
15004 (build_reinterpret_cast): Likewise.
15005
15006 * pt.c (coerce_template_parms): Coerce some expressions, even
15007 when processing_template_decl.
15008
15009 Sun Dec 7 01:46:33 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
15010
15011 * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
15012 handling of pointer difference expressions.
15013
15014 * typeck.c (comp_target_types): Comparison of function/method types
15015 is independent of nptrs.
15016
15017 Sun Dec 7 01:40:27 1997 Mark Mitchell <mmitchell@usa.net>
15018
15019 * pt.c (tsubst): Avoid creating pointer to reference and
15020 reference to reference types.
15021
15022 Sat Dec 6 01:29:37 1997 Jason Merrill <jason@yorick.cygnus.com>
15023
15024 * parse.y (do_id): New nonterminal.
15025 (template_id): Use it.
15026
15027 Fri Dec 5 01:17:34 1997 Jason Merrill <jason@yorick.cygnus.com>
15028
15029 * parse.y (template_id): do_identifier for PFUNCNAMEs, too.
15030 * spew.c (yylex): Don't do_identifier here.
15031 * decl2.c (build_expr_from_tree): Revert last change.
15032
15033 * decl2.c (build_expr_from_tree): Expand the name for a method call.
15034 * parse.y (object_template_id): Don't try to take the DECL_NAME.
15035
15036 Wed Dec 3 20:02:39 1997 Jason Merrill <jason@yorick.cygnus.com>
15037
15038 * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for
15039 alloc_expr.
15040 * call.c (build_op_delete_call): Adjust.
15041
15042 * except.c (expand_end_catch_block): Lose rethrow region.
15043 (expand_start_catch_block): Likewise.
15044 (expand_end_catch_block): Don't expand_leftover_cleanups.
15045
15046 Wed Dec 3 13:24:04 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15047
15048 * pt.c (tsubst): Remove tree_cons call (places redundant info into
15049 DECL_TEMPLATE_INSTANTIATION).
15050
15051 Wed Dec 3 11:44:52 1997 Jason Merrill <jason@yorick.cygnus.com>
15052
15053 * tree.c (is_overloaded_fn): Handle getting a fn template.
15054 (really_overloaded_fn): Likewise.
15055 * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better.
15056 * pt.c (check_explicit_specialization): Tweak.
15057 (determine_explicit_specialization): Tweak.
15058
15059 * tree.c, cp-tree.h (get_target_expr): New fn.
15060
15061 Wed Dec 3 08:47:27 1997 Paul Eggert <eggert@twinsun.com>
15062
15063 * pt.c (check_explicit_specialization): Fix misspelling in
15064 diagnostic: `preceeded'.
15065 * typeck.c (get_delta_difference): Fix misspelling in diagnostic:
15066 `conversiona'.
15067
15068 1997-12-02 Mark Mitchell <mmitchell@usa.net>
15069
15070 * pt.c (determine_explicit_specialization): Avoid an internal
15071 error for bad specializations.
15072
15073 * method.c (build_overload_value): Handle SCOPE_REF.
15074
15075 Tue Dec 2 19:18:50 1997 Mike Stump <mrs@wrs.com>
15076
15077 * class.c (prepare_fresh_vtable): Enable even more complex MI
15078 vtable names.
15079
15080 Tue Dec 2 01:37:19 1997 Jason Merrill <jason@yorick.cygnus.com>
15081
15082 * exception.cc (__check_eh_spec): Optimize a bit.
15083
15084 * exception.cc (__cp_pop_exception): Lose handler arg.
15085 * except.c (do_pop_exception): Likewise.
15086 (push_eh_cleanup): Let the cleanup mechanism supply the handler.
15087 (expand_end_catch_block): Likewise.
15088
15089 Fri Nov 28 01:58:14 1997 Jason Merrill <jason@yorick.cygnus.com>
15090
15091 * pt.c (check_explicit_specialization): Complain about using a
15092 template-id for a non-specialization.
15093
15094 Fri Nov 28 12:35:19 1997 Scott Christley <scottc@net-community.com>
15095
15096 * repo.c: Prototype rindex only if needed.
15097 * xref.c: Likewise.
15098
15099 Fri Nov 28 01:56:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
15100
15101 * error.c (dump_decl): Handle TEMPLATE_ID_EXPR.
15102
15103 Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com>
15104
15105 * typeck.c (build_const_cast): Handle references here instead of
15106 handing off to convert_to_reference.
15107
15108 * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
15109 TerminateFunctionCall.
15110 (init_exception_processing): Likewise. Terminate et al are now
15111 the fns, not ADDR_EXPRs.
15112 (various): Lose redundant assemble_external calls.
15113 (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/.
15114
15115 * cp-tree.h (struct lang_decl_flags): Add comdat.
15116 (DECL_COMDAT): New macro.
15117 * decl.c (duplicate_decls): Propagate it.
15118 (cp_finish_decl): Handle it.
15119 * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs.
15120
15121 * class.c: Remove static pending_hard_virtuals.
15122 (add_virtual_function): Take pointers to pending_virtuals
15123 and pending_hard_virtuals.
15124 (finish_struct_1): Pass them. Declare pending_hard_virtuals.
15125
15126 Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com>
15127
15128 * decl2.c (import_export_vtable): If we support one_only but not
15129 weak symbols, mark instantiated template vtables one_only.
15130 (import_export_decl): Likewise for tinfo functions.
15131 (finish_vtable_vardecl): Also write out vtables from explicitly
15132 instantiated template classes.
15133 * pt.c (mark_class_instantiated): Revert last change.
15134
15135 * except.c (expand_throw): Call mark_used on the destructor.
15136
15137 Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com)
15138
15139 * lex.c (lang_init): Enable flag_exceptions by default if no
15140 command line switch was specified.
15141
15142 1997-11-26 Mark Mitchell <mmitchell@usa.net>
15143
15144 * pt.c (unify): Handle `void' template parameters in
15145 specializations.
15146
15147 Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
15148
15149 * rtti.c (build_dynamic_cast): Handle template case here.
15150 (build_dynamic_cast_1): Not here.
15151
15152 * typeck2.c (digest_init): Make copies where appropriate.
15153
15154 * decl2.c (delete_sanity): resolve_offset_ref.
15155
15156 * except.c: Call terminate without caching so many bits.
15157
15158 * except.c (expand_start_catch_block): Fix catching a reference
15159 to pointer.
15160
15161 Tue Nov 25 11:28:21 1997 Jason Merrill <jason@yorick.cygnus.com>
15162
15163 * init.c (build_new): Copy size to the saveable obstack.
15164
15165 * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the
15166 TRY_CATCH_EXPR for now.
15167
15168 Mon Nov 24 12:15:55 1997 Jason Merrill <jason@yorick.cygnus.com>
15169
15170 * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
15171 has DECL_LANG_SPECIFIC.
15172
15173 * exception.cc (struct cp_eh_info): Add handlers field.
15174 (__cp_push_exception): Initialize it.
15175 (__cp_pop_exception): Decrement it. Don't pop unless it's 0.
15176 (__throw_bad_exception): Remove.
15177 * except.c (call_eh_info): Add handlers field.
15178 (get_eh_handlers): New fn.
15179 (push_eh_cleanup): Increment handlers.
15180
15181 Fri Nov 21 12:22:07 1997 Jason Merrill <jason@yorick.cygnus.com>
15182
15183 * except.c (expand_start_eh_spec): Use the try/catch code.
15184 (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of
15185 doing everything inline.
15186 (init_exception_processing): throw_type_match now takes
15187 const void pointers.
15188 * exception.cc (__check_eh_spec): New fn.
15189 * inc/exception: Neither terminate nor unexpected return.
15190 * decl.c: Make const_ptr_type_node public.
15191 * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly.
15192
15193 * except.c (expand_start_catch_block): We only need the rethrow
15194 region for non-sjlj exceptions.
15195 (expand_end_catch_block): Likewise. Use outer_context_label_stack.
15196
15197 Thu Nov 20 14:40:17 1997 Jason Merrill <jason@yorick.cygnus.com>
15198
15199 * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
15200 (various.o): Likewise.
15201 * inc/new: Add placement deletes. Add throw specs for default new.
15202 * new.cc (set_new_handler): Move here from libgcc2.
15203 * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
15204 (new): Move from libgcc2. Throw bad_alloc.
15205 * new2.cc: Move the rest of the op news and op deletes from libgcc2.
15206 * decl.c (init_decl_processing): Update exception specs on new and
15207 delete.
15208
15209 * method.c (build_decl_overload_real): Don't mess with global
15210 placement delete.
15211
15212 * init.c (build_new): Check for null throw spec, not nothrow_t.
15213
15214 * decl.c (duplicate_decls): Don't complain about different exceptions
15215 from an internal declaration.
15216
15217 * call.c (build_op_delete_call): Fix check for member fns again.
15218
15219 * decl2.c (import_export_decl): Interface hackery affects
15220 virtual synthesized methods.
15221
15222 Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
15223
15224 * decl.c (start_decl): Don't just complain about a mismatched
15225 scope, fix it.
15226
15227 * decl.c (make_implicit_typename): Handle case where t is not
15228 actually from context.
15229 * tree.c (get_type_decl): Lose identifier case.
15230 * spew.c (yylex): Lose useless call to identifier_typedecl_value.
15231 * parse.y (nonnested_type): Just use lookup_name.
15232 (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
15233
15234 Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
15235
15236 * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
15237 T was built in C language context (for example, by
15238 output_func_start_profiler).
15239
15240 Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
15241
15242 * decl.c (make_implicit_typename): New fn.
15243 (lookup_name_real): Use it. Use current_class_type as the context.
15244
15245 Mon Nov 17 23:42:03 1997 Bruno Haible <haible@ilog.fr>
15246
15247 * pt.c (do_poplevel): Don't prohibit jumps into this contour.
15248
15249 Mon Nov 17 02:01:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15250
15251 * friend.c (do_friend): Warn about non-template friends in templates.
15252
15253 * call.c (build_op_delete_call): Fix handling of inherited delete.
15254
15255 * search.c (dfs_record_inheritance): Ignore template type parms.
15256
15257 Sat Nov 15 00:30:51 1997 Jason Merrill <jason@yorick.cygnus.com>
15258
15259 * call.c (build_new_op): Fix copy error.
15260 (build_op_new_call): New fn.
15261 (build_op_delete_call): New fn.
15262 * cp-tree.h: Declare them.
15263 * init.c (build_new): Use them. Support placement delete.
15264 (build_x_delete): Use build_op_delete_call.
15265 (build_delete): Likewise.
15266 * decl2.c (delete_sanity): Likewise.
15267 (coerce_delete_type): Don't complain about placement delete.
15268
15269 Thu Nov 13 01:52:36 1997 Jason Merrill <jason@yorick.cygnus.com>
15270
15271 * call.c (build_new_function_call): Remove unused 'obj' parm.
15272 * cp-tree.h, typeck.c: Adjust.
15273
15274 * init.c (build_new): Make the cleanup last longer.
15275 (expand_vec_init): Call do_pending_stack_adjust.
15276
15277 Wed Nov 12 11:04:33 1997 Jason Merrill <jason@yorick.cygnus.com>
15278
15279 * pt.c (do_type_instantiation): Fix typo.
15280 (mark_class_instantiated): If we support one_only but not weak
15281 symbols, don't mark this as known.
15282
15283 * init.c (build_new): Handle vec delete in EH cleanup.
15284
15285 Wed Nov 12 08:11:55 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15286
15287 * call.c (build_method_call): Call complete_type before checking
15288 for destructor.
15289
15290 Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com)
15291
15292 * decl.c (add_block_current_level): Delete.
15293 * init.c (build_vec_delete_1): Delete build_block and
15294 add_block_current_level calls.
15295
15296 Wed Nov 12 00:48:16 1997 Jason Merrill <jason@yorick.cygnus.com>
15297
15298 * init.c (build_new): Handle freeing allocated memory when the
15299 constructor throws.
15300
15301 * call.c (build_new_method_call): Fix flags arg.
15302
15303 * pt.c (do_type_instantiation): Don't try to instantiate
15304 member templates.
15305 (mark_decl_instantiated): If we support one_only but not
15306 weak symbols, mark this one_only.
15307 * decl2.c (import_export_vtable): Don't defer handling of vtables
15308 if MULTIPLE_SYMBOL_SPACES.
15309
15310 Tue Nov 11 12:02:12 1997 Jason Merrill <jason@yorick.cygnus.com>
15311
15312 * except.c (expand_end_catch_block): Lose call to __sjpopnthrow.
15313
15314 Tue Nov 11 02:53:44 1997 Jason Merrill <jason@lasher.cygnus.com>
15315
15316 * except.c (do_pop_exception): Return a value.
15317
15318 Mon Nov 10 20:25:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15319
15320 * call.c (build_new_method_call): Handle getting a
15321 TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field
15322 if we got template parms.
15323 * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR,
15324 not just the args.
15325 * decl2.c (build_expr_from_tree): Tweak last change.
15326 * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE.
15327 (maybe_fold_nontype_arg): Split out from tsubst_copy.
15328 * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR.
15329
15330 Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
15331
15332 * pt.c (tsubst_copy): Handle explicit template arguments in
15333 function calls.
15334 * typeck.c (build_x_function_call): Likewise.
15335 * decl2.c (build_expr_from_tree): Lookup function name if it
15336 hasn't been done.
15337
15338 * pt.c (tsubst): Instantiate template functions properly when
15339 template parameter does not appear in function arguments and return
15340 type.
15341 (comp_template_args): Handle member templates required by tsubst.
15342
15343 Mon Nov 10 20:08:38 1997 Jason Merrill <jason@yorick.cygnus.com>
15344
15345 * decl.c (grokdeclarator): Tweak conditions for pedwarn in
15346 previous change.
15347
15348 Mon Nov 10 20:08:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
15349
15350 * pt.c (coerce_template_parms): Tweak error message.
15351
15352 * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
15353 return type defaults to `int', even if there are storage-class
15354 specifiers.
15355
15356 Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com>
15357
15358 Complete nested exception support.
15359 * except.c (do_pop_exception): Split out...
15360 (push_eh_cleanup): From here. Handle the EH region by hand.
15361 (expand_start_catch_block): Add a new level for the catch parm.
15362 Move the rethrow region outside the two cleanup regions.
15363 Protect the initializer for the catch parm with terminate.
15364 (expand_end_catch_block): Likewise. End the region for the eh_cleanup.
15365 * exception.cc (__cp_pop_exception): Now takes two parms. Handle
15366 popping off the middle of the stack.
15367 * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
15368 WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
15369 (build_cplus_new): Only wrap CALL_EXPRs.
15370 * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
15371 the constructor call.
15372
15373 Sun Nov 9 18:00:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
15374
15375 * Make-lang.in (c++.distdir): Make inc subdirectory.
15376
15377 Fri Nov 7 11:57:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15378
15379 * decl2.c (finish_file): Put back some code.
15380
15381 Thu Nov 6 11:28:14 1997 Jason Merrill <jason@yorick.cygnus.com>
15382
15383 * decl2.c (finish_file): Remove redundant code.
15384 * method.c (emit_thunk): Don't let the backend defer generic thunks.
15385
15386 Wed Nov 5 23:52:50 1997 Jason Merrill <jason@yorick.cygnus.com>
15387
15388 * except.c (call_eh_info): Split out...
15389 (push_eh_info): From here.
15390 (expand_builtin_throw): Use it.
15391 (expand_start_catch_block): Move region start back.
15392
15393 Tue Nov 4 13:45:10 1997 Doug Evans <devans@canuck.cygnus.com>
15394
15395 * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
15396 (real_yylex): Record wide strings using target endianness, not host.
15397
15398 1997-11-03 Brendan Kehoe <brendan@lisa.cygnus.com>
15399
15400 * repo.c (rindex): Add decl unconditionally.
15401 (get_base_filename, open_repo_file): Don't cast rindex.
15402 * xref.c (rindex): Add decl unconditionally.
15403 (index): Remove unused decl.
15404 (open_xref_file): Don't cast rindex.
15405
15406 Sun Nov 2 15:04:12 1997 Jason Merrill <jason@yorick.cygnus.com>
15407
15408 * class.c (build_vbase_path): Propagate the result type properly.
15409
15410 1997-11-01 Brendan Kehoe <brendan@lisa.cygnus.com>
15411
15412 * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
15413 remaining use of saved_throw_type with a call to get_eh_type.
15414
15415 1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
15416
15417 * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
15418 (file_name_nondirectory): New function, doing the same as the macro.
15419 (set_typedecl_interface_info): Use it instead of the macro.
15420 (check_newline): Likewise.
15421 (handle_cp_pragma): Likewise.
15422
15423 * repo.c (get_base_filename): Cast result of rindex to char*.
15424 (open_repo_file): Likewise.
15425 * xref.c (open_xref_file): Likewise.
15426 * error.c (dump_char): Make its arg int, not char.
15427
15428 * except.c (push_eh_info): Pass the number of fields - 1 down, not
15429 the exact number of fields.
15430
15431 Fri Oct 31 01:47:57 1997 Jason Merrill <jason@yorick.cygnus.com>
15432
15433 Support for nested exceptions.
15434 * tinfo2.cc (__is_pointer): New fn.
15435 * exception.cc (struct cp_eh_info): Define.
15436 (__cp_exception_info, __uncatch_exception): New fns.
15437 (__cp_push_exception, __cp_pop_exception): New fns.
15438 * except.c: Lose saved_throw_{type,value,cleanup,in_catch}.
15439 Lose empty_fndecl.
15440 (init_exception_processing): Likewise. __eh_pc is now external.
15441 (push_eh_info): New fn.
15442 (get_eh_{info,value,type,caught}): New fns.
15443 (push_eh_cleanup): Just call __cp_pop_exception.
15444 (expand_start_catch_block): Use push_eh_info. Start the eh region
15445 sooner.
15446 (expand_end_eh_spec): Use push_eh_info.
15447 (expand_throw): Call __cp_push_exception to set up the exception info.
15448 Just pass the destructor or 0 as the cleanup. Call __uncatch_exception
15449 when we rethrow.
15450 (expand_builtin_throw): Don't refer to empty_fndecl.
15451
15452 Thu Oct 23 02:01:30 1997 Jason Merrill <jason@yorick.cygnus.com>
15453
15454 * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl.
15455
15456 1997-10-22 Brendan Kehoe <brendan@cygnus.com>
15457
15458 * method.c (build_template_parm_names, build_decl_overload_real):
15459 Add static to definitions.
15460 * pt.c (add_to_template_args, note_template_header,
15461 processing_explicit_specialization, type_unification_real): Likewise.
15462 ({determine,check}_explicit_specialization): Use a single string for
15463 error messages.
15464
15465 Mon Oct 20 12:06:34 1997 Jason Merrill <jason@yorick.cygnus.com>
15466
15467 * except.c (expand_exception_blocks): Call do_pending_stack_adjust.
15468 (expand_end_catch_block): Likewise.
15469 (expand_end_eh_spec): Likewise.
15470
15471 Mon Oct 20 11:44:20 1997 Mark Mitchell <mmitchell@usa.net>
15472
15473 * decl.c (duplicate_decls): Handle template specializations
15474 correctly.
15475 * error.c (dump_function_name): Fix printing of specializations of
15476 member functions that are not member templates.
15477 * cp-tree.h (processing_specialization): Make global.
15478 * pt.c (processing_specialization): Likewise.
15479 * lex.c (cons_up_default_function): Save and restore
15480 processing_specialization to avoid confusion.
15481
15482 Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
15483
15484 * decl.c (init_decl_processing): Give null_node unknown* type.
15485 * typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
15486 (common_type): Likewise.
15487 * error.c (args_as_string): Recognize null_node.
15488
15489 Sun Oct 19 09:13:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
15490
15491 * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
15492 (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
15493
15494 * decl.c (init_decl_processing): Call using_eh_for_cleanups.
15495
15496 * Make-lang.in (g++): Include prefix.o.
15497
15498 Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
15499
15500 * pt.c (determine_explicit_specialization): Initialize "dummy"
15501 to keep Purify quiet.
15502
15503 Thu Oct 16 00:14:48 1997 Jason Merrill <jason@yorick.cygnus.com>
15504
15505 * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here.
15506 (build_overload_int): Not here.
15507
15508 Wed Oct 15 00:35:28 1997 Mike Stump <mrs@wrs.com>
15509
15510 * class.c (build_type_pathname): Remove.
15511 (prepare_fresh_vtable): Fix problem with complex MI vtable names.
15512
15513 1997-10-14 Brendan Kehoe <brendan@lisa.cygnus.com>
15514
15515 * parse.y (unary_expr): Give a pedwarn if someone tries to use the
15516 &&label GNU extension.
15517
15518 Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
15519
15520 * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it,
15521 so as to avoid incorrect manglings.
15522 * method.c (build_decl_overload_real): Don't mangle return types
15523 for constructors.
15524
15525 Tue Oct 14 11:46:14 1997 Jason Merrill <jason@yorick.cygnus.com>
15526
15527 * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
15528 scratch_tree_cons): Define as macros for now.
15529 * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
15530 lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
15531 typeck2.c: Use them and the expression_obstack variants.
15532
15533 Mon Oct 13 17:41:26 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15534
15535 * decl.c (store_return_init): Allow classes with explicit ctors to
15536 be used with the named return values extension.
15537
15538 Fri Oct 10 12:21:11 1997 Jason Merrill <jason@yorick.cygnus.com>
15539
15540 * pt.c (instantiate_decl): Fix previous change.
15541
15542 Thu Oct 9 12:08:21 1997 Jason Merrill <jason@yorick.cygnus.com>
15543
15544 * pt.c (tsubst): Fix thinko.
15545 (instantiate_decl): Really use the original template.
15546
15547 * call.c (build_new_method_call): Use simple constructor_name for
15548 error messages.
15549
15550 Wed Oct 8 22:44:42 1997 Jeffrey A Law <law@cygnus.com>
15551
15552 * method.c (build_underscore_int): Don't use ANSI specific
15553 features.
15554
15555 Wed Oct 8 00:18:22 1997 Jason Merrill <jason@yorick.cygnus.com>
15556
15557 * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN
15558 for our key method; it might have been inlined by -O3.
15559
15560 Tue Oct 7 23:00:12 1997 Mark Mitchell <mmitchell@usa.net>
15561
15562 * decl.c (make_typename_type): Do not try to call lookup_field for
15563 non-aggregate types.
15564
15565 Tue Oct 7 22:52:10 1997 Jason Merrill <jason@yorick.cygnus.com>
15566
15567 * typeck.c (build_reinterpret_cast): Tweak.
15568
15569 Tue Oct 7 22:45:31 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
15570
15571 * typeck.c (build_reinterpret_cast): Converting a void pointer
15572 to function pointer with a reinterpret_cast produces a warning
15573 if -pedantic is issued.
15574
15575 Tue Oct 7 22:43:43 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
15576
15577 * typeck.c (c_expand_return): Don't warn about returning a
15578 reference-type variable as a reference.
15579
15580 Tue Oct 7 21:11:22 1997 Jason Merrill <jason@yorick.cygnus.com>
15581
15582 * method.c (build_static_name): Fix typo.
15583
15584 1997-10-07 Brendan Kehoe <brendan@lisa.cygnus.com>
15585
15586 * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on
15587 OLDDECL before we try to do DECL_USE_TEMPLATE.
15588
15589 Tue Oct 7 00:48:36 1997 Jason Merrill <jason@yorick.cygnus.com>
15590
15591 * decl.c (duplicate_decls): Don't warn about template instances.
15592
15593 * typeck.c (mark_addressable): Lose ancient code that unsets
15594 DECL_EXTERNAL.
15595
15596 * pt.c (do_decl_instantiation): Lose support for instantiating
15597 non-templates.
15598
15599 * call.c (build_new_function_call): Fix handling of null explicit
15600 template args.
15601 (build_new_method_call): Likewise.
15602
15603 Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net>
15604
15605 * method.c (build_underscore_int): Fix typo.
15606
15607 1997-10-06 Brendan Kehoe <brendan@lisa.cygnus.com>
15608
15609 * tree.c (print_lang_statistics): #if 0 call to
15610 print_inline_obstack_statistics until its definition is checked in.
15611
15612 Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
15613
15614 * decl2.c (finish_file): Move dump_tree_statistics to end.
15615
15616 * pt.c (instantiate_decl): Look for the original template.
15617 (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
15618 of member templates.
15619
15620 Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com>
15621
15622 * Makefile.in (g++FAQ.*): New rules.
15623 (CONFLICTS): Update.
15624 * g++FAQ.texi: Moved from libg++.
15625
15626 * parse.y (PFUNCNAME): Only specify the type once.
15627
15628 1997-10-01 Brendan Kehoe <brendan@lasher.cygnus.com>
15629
15630 * lex.c (real_yylex): Clean up the code to fully behave the way
15631 the c-lex.c parser does for complex and real numbers.
15632
15633 Tue Sep 30 08:51:36 1997 Jason Merrill <jason@yorick.cygnus.com>
15634
15635 * method.c (build_decl_overload_real): Reformat.
15636
15637 Tue Sep 30 00:18:26 1997 Jason Merrill <jason@yorick.cygnus.com>
15638
15639 * method.c (synthesize_method): If at_eof, determine our linkage.
15640
15641 1997-09-29 Paul Eggert <eggert@twinsun.com>
15642
15643 * lex.c (real_yylex): Treat `$' just like `_', except issue a
15644 diagnostic if !dollars_in_ident or if pedantic.
15645
15646 * lang-specs.h (@c++): -ansi no longer implies -$.
15647
15648 * decl2.c (lang_decode_option):
15649 -traditional and -ansi now do not mess with
15650 dollars_in_ident.
15651
15652 Mon Sep 29 19:57:51 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
15653
15654 * Makefile.in (parse.o, decl.o): Also depend on
15655 $(srcdir)/../except.h $(srcdir)/../output.h.
15656 (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
15657 $(srcdir)/../except.h $(srcdir)/../output.h.
15658 (typeck.o, init.o): Also depend on $(srcdir)/../expr.h
15659 ../insn-codes.h.
15660
15661 * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.
15662
15663 * expr.c (cplus_expand_expr): Make it static.
15664
15665 * decl2.c, init.c, typeck.c: Include "expr.h".
15666 (expand_expr): Use proper values when calling the function.
15667
15668 Mon Sep 29 11:05:54 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
15669
15670 * lang-options.h: New -Wold-style-cast flag.
15671 * cp-tree.h (warn_old_style_cast): New variable.
15672 * decl2.c (warn_old_style_cast): Likewise.
15673 (lang_decode_option): Support -Wold-style-cast.
15674 (reparse_absdcl_as_casts): Produce old-style-cast warning.
15675
15676 Mon Sep 29 09:20:53 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15677
15678 * decl.c (cp_finish_decl): Allow expand_aggr_init to set
15679 TREE_USED, reset value based on already_used.
15680
15681 * init.c (expand_member_init): Revert change.
15682
15683 Mon Sep 29 08:57:53 1997 Jason Merrill <jason@yorick.cygnus.com>
15684
15685 * cp-tree.h, decl.c, decl2.c, pt.c:
15686 Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public.
15687
15688 * decl2.c (lang_decode_option): Add missing ;.
15689
15690 Sat Sep 27 16:22:48 1997 Jason Merrill <jason@yorick.cygnus.com>
15691
15692 * friend.c (do_friend): Disable injection for all template-derived
15693 decls.
15694 * decl2.c (lang_decode_option): Handle -fguiding-decls.
15695 * parse.y (notype_template_declarator): New nonterminal.
15696 (direct_notype_declarator): Use it.
15697 (complex_direct_notype_declarator): Likewise.
15698 (object_template_id): Accept any kind of identifier after TEMPLATE.
15699 (notype_qualified_id): Don't add template declarators here.
15700
15701 Sat Sep 27 16:21:58 1997 Mark Mitchell <mmitchell@usa.net>
15702
15703 * call.c (add_template_candidate): Add explicit_targs parameter.
15704 (build_scoped_method_call): Use it.
15705 (build_overload_call_real): Likewise.
15706 (build_user_type_conversion_1): Likewise.
15707 (build_new_function_call): Likewise.
15708 (build_object_call): Likewise.
15709 (build_new_op): Likewise.
15710 (build_new_method_call): Likewise.
15711 (build_new_function_call): Handle TEMPLATE_ID_EXPR.
15712 (build_new_method_call): Likewise.
15713
15714 * class.c (finish_struct_methods): Add specialization pass to
15715 determine which methods were specializing which other methods.
15716 (instantiate_type): Handle TEMPLATE_ID_EXPR.
15717
15718 * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.
15719
15720 * cp-tree.h (name_mangling_version): New variable.
15721 (flag_guiding_decls): Likewise.
15722 (build_template_decl_overload): New function.
15723 (begin_specialization): Likewise.
15724 (reset_specialization): Likewise.
15725 (end_specialization): Likewise.
15726 (determine_explicit_specialization): Likewise.
15727 (check_explicit_specialization): Likewise.
15728 (lookup_template_function): Likewise.
15729 (fn_type_unification): Add explicit_targs parameter.
15730 (type_unification): Likewise.
15731
15732 * decl.c (duplicate_decls): Add smarts for explicit
15733 specializations.
15734 (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
15735 specializations.
15736 (grokfndecl): Call check_explicit_specialization.
15737
15738 * decl2.c (lang_decode_option): Handle -fname-mangling-version.
15739 (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
15740 (check_classfn): Handle specializations.
15741
15742 * error.c (dump_function_name): Print specialization arguments.
15743
15744 * friend.c (do_friend): Don't call pushdecl for template
15745 instantiations.
15746
15747 * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.
15748
15749 * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
15750 and -fno-guiding-decls.
15751
15752 * lex.c (identifier_type): Return PFUNCNAME for template function
15753 names.
15754
15755 * method.c (build_decl_overload_real): New function.
15756 (build_template_parm_names): New function.
15757 (build_overload_identifier): Use it.
15758 (build_underscore_int): New function.
15759 (build_overload_int): Use it. Add levels for template
15760 parameters.
15761 (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs.
15762 (build_overload_nested_names): Handle template type parameters.
15763 (build_template_decl_overload): New function.
15764
15765 * parse.y (YYSTYPE): New ntype member.
15766 (nested_name_specifier): Use it.
15767 (nested_name_specifier_1): Likewise.
15768 (PFUNCNAME): New token.
15769 (template_id, object_template_id): New non-terminals.
15770 (template_parm_list): Note specializations.
15771 (template_def): Likewise.
15772 (structsp): Likewise.
15773 (fn.def2): Handle member template specializations.
15774 (component_decl_1): Likewise.
15775 (direct_notype_declarator): Handle template-ids.
15776 (component_decl_1): Likewise.
15777 (direct_notype_declarator): Handle template-ids.
15778 (primary): Handle TEMPLATE_ID_EXPR, and template-ids.
15779
15780 * pt.c (processing_specializations): New variable.
15781 (template_header_count): Likewise.
15782 (type_unification_real): New function.
15783 (processing_explicit_specialization): Likewise.
15784 (note_template_header): Likewise.
15785 (is_member_template): Handle specializations.
15786 (end_template_decl): Call reset_specialization.
15787 (push_template_decl): Handle member template specializations.
15788 (tsubst): Likewise.
15789 (tsubst_copy): Handle TEMPLATE_ID_EXPR.
15790 (instantiate_template): Handle specializations.
15791 (instantiate_decl): Likewise.
15792 (fn_type_unification): Handle explicit_targs.
15793 (type_unification): Likewise. Allow incomplete unification
15794 without an error message, if allow_incomplete.
15795 (get_bindings): Use new calling sequence for fn_type_unification.
15796
15797 * spew.c (yylex): Handle PFUNCNAME.
15798
15799 * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
15800 (really_overloaded_fn): Likewise.
15801 (get_first_fn): Handle function templates.
15802
15803 * typeck.c (build_x_function_call): Use really_overloaded_fn.
15804 Handle TEMPLATE_ID_EXPR.
15805 (build_x_unary_op): Likewise.
15806 (build_unary_op): Likewise.
15807 (mark_addressable): Templates whose address is taken are marked
15808 as used.
15809
15810 1997-09-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
15811
15812 * decl.c (init_decl_processing): Declare __builtin_constant_p as
15813 accepting any kind of type, not only int.
15814
15815 Fri Sep 26 00:22:56 1997 Jason Merrill <jason@yorick.cygnus.com>
15816
15817 * search.c (get_matching_virtual): Notice virtual bases when sorrying
15818 about covariant returns.
15819
15820 * parse.y (member_init): Also imply typename here. Remove ancient
15821 extension for initializing base members.
15822
15823 Thu Sep 25 11:11:13 1997 Jason Merrill <jason@yorick.cygnus.com>
15824
15825 Handle multi-level typenames and implicit typename in base list.
15826 * parse.y (typename_sub{,[0-2]}): New rules.
15827 (structsp, rule TYPENAME_KEYWORD): Use typename_sub.
15828 (nonnested_type): New rule.
15829 (complete_type_name): Use it.
15830 (base_class.1): Use typename_sub and nonnested_type.
15831 (nested_name_specifier): Don't elide std:: here.
15832 * decl.c (make_typename_type): Handle getting a type for NAME.
15833 (lookup_name_real): Turn std:: into :: here.
15834
15835 Rvalue conversions were removed in London.
15836 * call.c (is_subseq): Don't consider lvalue transformations.
15837 (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK.
15838 (joust): Re-enable ?: kludge.
15839
15840 1997-09-22 Brendan Kehoe <brendan@lisa.cygnus.com>
15841
15842 * decl.c (start_function): Up warning of no return type to be a
15843 pedwarn.
15844
15845 Mon Sep 22 14:15:34 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15846
15847 * init.c (expand_member_init): Don't set TREE_USED.
15848 * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
15849 set,don't clear TREE_USED wholesale.
15850
15851 Sat Sep 20 15:31:00 1997 Jason Merrill <jason@yorick.cygnus.com>
15852
15853 * call.c (build_over_call): Do require_complete_type before
15854 build_cplus_new.
15855
15856 Thu Sep 18 16:47:52 1997 Jason Merrill <jason@yorick.cygnus.com>
15857
15858 * search.c (lookup_field): Call complete_type in all cases.
15859
15860 * decl.c (finish_function): Just warn about flowing off the end.
15861
15862 Wed Sep 17 10:31:25 1997 Jason Merrill <jason@yorick.cygnus.com>
15863
15864 * decl.c (grokparms): Don't bash a permanent list node if we're
15865 in a function.
15866
15867 1997-09-17 Brendan Kehoe <brendan@lisa.cygnus.com>
15868
15869 * Makefile.in (CONFLICTS): Fix s/r conflict count to 18.
15870
15871 Tue Sep 16 14:06:56 1997 Jason Merrill <jason@yorick.cygnus.com>
15872
15873 * call.c (build_new_op): Give better error for syntactically
15874 correct, but semantically invalid, use of undeclared template.
15875
15876 * call.c (compare_qual): Handle pmfs.
15877
15878 * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
15879 after the exception spec.
15880
15881 Mon Sep 15 11:52:13 1997 Jason Merrill <jason@yorick.cygnus.com>
15882
15883 * call.c (null_ptr_cst_p): Integer type, not integral type.
15884
15885 * call.c (joust): Disable warnings until they can be moved to the
15886 right place.
15887
15888 Fri Sep 12 16:11:13 1997 Per Bothner <bothner@cygnus.com>
15889
15890 * Makefile.in, config-lang.in: Convert to autoconf.
15891
15892 Thu Sep 11 17:14:55 1997 Jason Merrill <jason@yorick.cygnus.com>
15893
15894 * decl.c (lookup_name_real): Add implicit 'typename' to types from
15895 base classes.
15896
15897 * pt.c (most_specialized_class): Fix typo.
15898 (tsubst): Move constant folding to TREE_VEC case.
15899
15900 Thu Sep 11 10:08:45 1997 Mark Mitchell <mmitchell@usa.net>
15901
15902 * pt.c (do_poplevel): Don't warn about unused local variables
15903 while processing_template_decl since we don't always know whether
15904 or not they will need constructing/destructing.
15905
15906 * pt.c (uses_template_parms): Check the values of an enumeration
15907 type to make sure they don't depend on template parms.
15908
15909 * decl.c (make_typename_type): Don't lookup the field if the
15910 context uses template parms, even if we're not
15911 processing_template_decl at the moment.
15912
15913 * pt.c (coerce_template_parms): Avoid looking at the
15914 TYPE_LANG_DECL portion of a typename type, since there won't be
15915 one.
15916 (tsubst): Do constant folding as necessary to make sure that
15917 arguments passed to lookup_template_class really are constants.
15918
15919 Wed Sep 10 11:21:55 1997 Jason Merrill <jason@yorick.cygnus.com>
15920
15921 * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO.
15922 * decl2.c (finish_file): Only register exception tables if we
15923 need to.
15924
15925 * decl.c (init_decl_processing): Add __builtin_[fs]p.
15926
15927 Tue Sep 9 19:49:38 1997 Jason Merrill <jason@yorick.cygnus.com>
15928
15929 * pt.c (unify): Just return 0 for a TYPENAME_TYPE.
15930
15931 Tue Sep 9 17:57:25 1997 Mark Mitchell <mmitchell@usa.net>
15932
15933 * error.c (dump_decl): Avoid crashing when presented with a
15934 uninitialized constant, as can occur with a template parameter.
15935 (dump_expr): Make sure that there are enough levels of
15936 current_template_parms before we start diving through them.
15937
15938 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
15939
15940 * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to
15941 c-typeck.c.
15942
15943 Tue Sep 9 09:36:39 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15944
15945 * except.c (expand_throw): Call build_delete for all
15946 exception types, not just objects with destructors.
15947
15948 Mon Sep 8 02:33:20 1997 Jody Goldberg <jodyg@idt.net>
15949
15950 * decl.c (current_local_enum): Remove static.
15951 * pt.c (tsubst_enum): Save and restore value of current_local_enum
15952 in case template is expanded in enum decl.
15953 (instantiate_class_template): Use new tsubst_enum signature.
15954 (tsubst_expr): Likewise.
15955
15956 Mon Sep 8 01:21:43 1997 Mark Mitchell <mmitchell@usa.net>
15957
15958 * pt.c (begin_member_template_processing): Take a function as
15959 argument, not a set of template arguments. Use the template
15960 parameters, rather than the arguments. Handle non-type parameters
15961 correctly. Push a binding level for the parameters so that multiple
15962 member templates using the same parameter names can be declared.
15963 (end_member_template_processing): Pop the binding level.
15964 (push_template_decl): Mark member templates as static when
15965 appropriate.
15966
15967 * lex.c (do_pending_inlines): Pass the function, not its template
15968 arguments, to begin_member_template_processing.
15969 (process_next_inline): Likewise.
15970 (do_pending_defargs): Likewise.
15971
15972 * error.c (dump_expr): Obtain the correct declaration for a
15973 TEMPLATE_CONST_PARM.
15974
15975 * call.c (add_template_conv_candidate): New function.
15976 (build_object_call): Handle member templates, as done in the other
15977 build_ functions.
15978
15979 Sat Sep 6 10:20:27 1997 Mark Mitchell <mmitchell@usa.net>
15980
15981 * decl.c (replace_defag): Undo previous change.
15982 * lex.c (do_pending_defargs): Deal with member templates.
15983
15984 * pt.c (is_member_template): Avoid crashing when passed a
15985 non-function argument.
15986
15987 Fri Sep 5 17:27:38 1997 Jason Merrill <jason@yorick.cygnus.com>
15988
15989 * class.c (grow_method): Remove check for redeclaration.
15990
15991 Fri Sep 5 01:37:17 1997 Mark Mitchell <mmitchell@usa.net>
15992
15993 * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
15994 (DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
15995 (PRIMARY_TEMPLATE_P): Use it.
15996 * call.c (build_overload_call_real): Use it.
15997 * class.c (instantiate_type): Likewise.
15998 * decl.c (decls_match): Likewise.
15999 * method.c (build_overload_identifier): Likewise.
16000 * pt.c (push_template_decl): Likewise.
16001 (classtype_mangled_name): Likewise.
16002 (lookup_template_class): Likewise.
16003
16004 * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
16005 DECL_NTPARMS to conform to usage elsewhere.
16006 * call.c (add_template_candidate): Likewise.
16007 * class.c (instantiate_type): Likewise.
16008 * pt.c (instantiate_template): Likewise.
16009 (get_bindings): Likewise.
16010
16011 * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
16012 is_member_template.
16013
16014 * pt.c (unify): Undo changes to allow multiple levels of template
16015 parameters.
16016 (type_unification): Likewise.
16017 (fn_type_unification): Likewise.
16018 (get_class_bindings): Likewise.
16019 * cp-tree.h (Likewise).
16020
16021 * decl.c (replace_defarg): Check that the type of the default
16022 parameter does not invlove a template type before complaining
16023 about the initialization.
16024
16025 * error.c (dump_expr): Deal with template constant parameters in
16026 member templates correctly.
16027
16028 * pt.c (is_member_template): Deal with class specializations
16029 correctly.
16030 (tsubst): Handle "partial instantiation" of member templates
16031 correctly.
16032
16033 Wed Sep 3 12:30:24 1997 Mark Mitchell <mmitchell@usa.net>
16034
16035 * pt.c (type_unification): Change calling sequence to allow for
16036 multiple levels of template parameters.
16037 (tsubst_expr): Likewise.
16038 (tsubst): Likewise.
16039 (tsubst_copy): Likewise.
16040 (instantiate_template): Likewise.
16041 (unify): Likewise.
16042 * call.c (build_overload_call_real): Use it.
16043 (add_builtin_candidate): Use it.
16044 (build_new_method_call): Use it.
16045 * class.c (instantiate_type): Use it.
16046 * decl.c (grokdeclarator): Use it.
16047 * decl2.c (finish_file): Use it.
16048 * method.c (build_overload_identifier): Use it.
16049
16050 * call.c (add_template_candidate): Add additional parameter for
16051 the function return type. Call fn_type_unification istead of
16052 type_unification.
16053 (build_user_type_conversion_1): Handle member templates.
16054 (build_new_function_call): Likewise.
16055 (build_new_op): Likewise.
16056 (build_new_method_call): Likewise.
16057
16058 * class.c (grow_method): Don't give an error message indicating
16059 that two member templates with the same name are ambiguous.
16060 (finish_struct): Treat member template functions just like member
16061 functions.
16062
16063 * cp-tree.h (check_member_template): Add declaration.
16064 (begin_member_template_processing): Likewise.
16065 (end_member_template_processing): Likewise.
16066 (fn_type_unification): Likewise.
16067 (is_member_template): Likewise.
16068 (tsubst): Change prototype.
16069 (tsubst_expr): Likewise.
16070 (tsubst_copy): Likewise.
16071 (instantiate_template): Likewise.
16072 (get_bindings): Likewise.
16073
16074 * decl.c (decls_match): Handle multiple levels of template
16075 parameters.
16076 (pushdecl): Handle template type params just like other type
16077 declarations.
16078 (push_class_level_binding): Return immediately if the
16079 class_binding_level is NULL.
16080 (grokfndecl): If check_classfn() returns a member_template, use
16081 the result of the template, not the template itself.
16082
16083 * decl2.c (check_member_template): New function. Check to see
16084 that the entity declared to be a member template can be one.
16085 (check_classfn): Allow redeclaration of member template functions
16086 with different types; the new functions can be specializations or
16087 explicit instantiations.
16088
16089 * error.c (dump_decl): Handle multiple levels of template
16090 parameters.
16091 (dump_function_decl): Update to handle function templates.
16092
16093 * lex.c (do_pending_inlines): Set up template parameter context
16094 for member templates.
16095 (process_next_inline): Likewise.
16096
16097 * method.c (build_overload_identifier): Adjust for multiple levels
16098 of template parameters.
16099
16100 * parse.y (fn.def2): Add member templates.
16101 (component_decl_1): Likewise.
16102
16103 * pt.c (begin_member_template_processing): New function.
16104 (end_member_template_processing): Likewise.
16105 (is_member_template): Likewise.
16106 (fn_type_unification): Likewise.
16107 (current_template_parms): Return a vector of all the template
16108 parms, not just the innermost level of parms.
16109 (push_template_decl): Deal with the possibility of member
16110 templates.
16111 (lookup_template_class): Likewise.
16112 (uses_template_parms): Likewise.
16113 (tsubst): Modify processing to TEMPLATE_TYPE_PARM and
16114 TEMPLATE_CONST_PARM to deal with multiple levels of template
16115 arguments. Add processing of TEMPLATE_DECL to produce new
16116 TEMPLATE_DECLs from old ones.
16117 (do_decl_instantiation): Handle member templates.
16118
16119 * search.c (lookup_fnfields_1): Handle member template conversion
16120 operators.
16121
16122 * tree.c (cp_tree_equal): Check the levels, as well as the
16123 indices, of TEMPLATE_CONST_PARMs.
16124
16125 * typeck.c (comptypes): Check the levels, as well as the indices,
16126 fo TEMPLATE_TYPE_PARMs.
16127 (build_x_function_call): Treat member templates like member
16128 functions.
16129
16130 Wed Sep 3 11:09:25 1997 Jason Merrill <jason@yorick.cygnus.com>
16131
16132 * typeck.c (c_expand_return): Always convert_for_initialization
16133 before checking for returning a pointer to local.
16134
16135 * pt.c (type_unification): If strict and the function parm doesn't
16136 use template parms, just compare types.
16137
16138 Wed Sep 3 10:35:49 1997 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
16139
16140 * method.c (build_overloaded_value): Replace direct call
16141 to the floating point emulator with REAL_VALUE_TO_DECIMAL macro.
16142
16143 Wed Sep 3 00:02:53 1997 Jason Merrill <jason@yorick.cygnus.com>
16144
16145 * typeck.c (convert_arguments): Don't arbitrarily choose the first
16146 of a set of overloaded functions.
16147
16148 Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
16149
16150 * lex.c (real_yylex): Don't elide __FUNCTION__.
16151
16152 * method.c (build_overload_value): Add in_template parm.
16153 (build_overload_int): Likewise.
16154 (build_overload_identifier): Pass it.
16155
16156 * decl.c (duplicate_decls): Don't bash a previous template
16157 definition with a redeclaration.
16158
16159 * pt.c (unify): float doesn't match double.
16160
16161 * pt.c (do_type_instantiation): Handle getting a _TYPE or a
16162 TYPE_DECL. Handle getting non-template types.
16163 * parse.y (explicit_instantiation): Use typespec instead of
16164 aggr template_type.
16165
16166 Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
16167
16168 * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
16169
16170 Mon Sep 1 13:19:04 1997 Eugene Mamchits <eugin@ips.ras.ru>
16171
16172 * call.c (add_builtin_candidate): Add missing TREE_TYPE.
16173 (compare_ics): Likewise.
16174
16175 Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
16176
16177 * call.c (joust): Warn about choosing one conversion op over
16178 another because of 'this' argument when the other return type is
16179 better.
16180 (source_type): New fn.
16181
16182 * call.c (build_new_op): Strip leading REF_BIND from first operand
16183 to builtin operator.
16184
16185 * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
16186 use its RTL.
16187
16188 Thu Aug 28 09:45:23 1997 Jason Merrill <jason@yorick.cygnus.com>
16189
16190 * call.c (null_ptr_cst_p): Remove support for (void*)0.
16191
16192 Wed Aug 27 02:03:34 1997 Jeffrey A Law <law@cygnus.com>
16193
16194 * typeck.c (expand_target_expr): Make definition match declaration.
16195
16196 * class.c (get_basefndecls): Make definition match declaration.
16197
16198 Mon Aug 25 14:30:02 1997 Jason Merrill <jason@yorick.cygnus.com>
16199
16200 * input.c (sub_getch): Eventually give up and release the input file.
16201
16202 * decl.c (cp_finish_decl): If #p i/i, put inline statics in the
16203 right place.
16204
16205 * call.c (joust): Tweak message.
16206
16207 Sat Aug 23 18:02:59 1997 Mark Mitchell <mmitchell@usa.net>
16208
16209 * error.c (type_as_string): Put const/volatile on template type
16210 parameters where appropriate.
16211
16212 Sat Aug 23 17:47:22 1997 Jeffrey A Law <law@cygnus.com>
16213
16214 * call.c (strictly_better): Make arguments unsigned ints.
16215
16216 Thu Aug 21 18:48:44 1997 Jason Merrill <jason@yorick.cygnus.com>
16217
16218 * lex.c (real_yylex): Refer to __complex instead of complex.
16219
16220 Thu Aug 21 22:25:46 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
16221
16222 * lex.c (real_yylex): Don't use getc directly.
16223
16224 Wed Aug 20 17:25:08 1997 Jason Merrill <jason@yorick.cygnus.com>
16225
16226 * call.c (is_subseq): Don't try to be clever.
16227
16228 Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
16229
16230 * parse.y, pt.c: Include "except.h".
16231 * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
16232 error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
16233 lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
16234 sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
16235 prototyping.
16236
16237 Wed Aug 20 01:34:40 1997 Jason Merrill <jason@yorick.cygnus.com>
16238
16239 * decl2.c (mark_vtable_entries): Instead of replacing pure
16240 virtuals with a reference to __pure_virtual, copy the decl and
16241 change the RTL.
16242
16243 Tue Aug 19 02:26:07 1997 Jason Merrill <jason@yorick.cygnus.com>
16244
16245 * pt.c (lookup_nested_type_by_name): Handle typedef wierdness.
16246
16247 * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com.
16248
16249 * pt.c (instantiate_class_template): Call repo_template_used
16250 before finish_prevtable_vardecl.
16251
16252 * call.c (is_subseq): New fn.
16253 (compare_ics): Use it.
16254
16255 * repo.c (finish_repo): Don't crash on no args.
16256
16257 * parse.y (named_complex_class_head_sans_basetype): Handle
16258 explicit global scope.
16259 * decl2.c (handle_class_head): New fn.
16260
16261 * pt.c (unify): Add CONST_DECL case.
16262
16263 Thu Aug 14 10:05:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16264
16265 * rtti.c (permanent_obstack): Fix decl to not be a pointer.
16266
16267 * cp-tree.h (report_type_mismatch): Add prototype.
16268 * call.c (build_overload_call_real): Remove erroneous fourth
16269 argument to report_type_mismatch.
16270 (build_user_type_conversion_1): Remove erroneous second arg to
16271 tourney.
16272 (build_new_function_call): Likewise.
16273 (build_object_call): Likewise.
16274 (build_new_op): Likewise.
16275 (build_new_method_call): Likewise.
16276
16277 Wed Aug 13 19:19:25 1997 Jason Merrill <jason@yorick.cygnus.com>
16278
16279 * error.c (dump_decl): Don't bother processing a function with no
16280 DECL_LANG_SPECIFIC.
16281
16282 * method.c (emit_thunk): Call init_function_start in the macro case.
16283
16284 Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
16285
16286 * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
16287 defined and used to set flag_vtable_thunks.
16288
16289 Tue Aug 12 20:13:57 1997 Jason Merrill <jason@yorick.cygnus.com>
16290
16291 * parse.y: Don't clear the inlines from their obstack until they've
16292 all been processed.
16293
16294 * decl.c (duplicate_decls): Don't complain about exception
16295 specification mismatch if flag_exceptions is off.
16296
16297 Mon Aug 11 15:01:56 1997 Marc Lehmann <pcg@goof.com>
16298
16299 * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
16300
16301 Sun Aug 10 12:06:09 1997 Paul Eggert <eggert@twinsun.com>
16302
16303 * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
16304 * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
16305 Include <stdio.h> before include files that formerly used STDIO_PROTO.
16306
16307 * decl.c, g++spec.c, lex.c, method.c, repo.c:
16308 Include "config.h" first, as per autoconf manual.
16309
16310 Fri Aug 8 11:47:48 1997 Jason Merrill <jason@yorick.cygnus.com>
16311
16312 * decl.c (duplicate_decls): Tweak wording.
16313 * lex.c (do_pending_defargs): Don't die if we see a default arg
16314 that isn't a DEFAULT_ARG.
16315 * error.c (dump_expr): Handle DEFAULT_ARG.
16316
16317 * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
16318 * lang-options.h: Add -fhandle-exceptions.
16319
16320 * class.c (build_vtable): Vtables are artificial.
16321 (prepare_fresh_vtable): Likewise.
16322
16323 Wed Aug 6 11:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
16324
16325 * cvt.c (ocp_convert): After converting to the target type, set
16326 LOOKUP_NO_CONVERSION.
16327
16328 * call.c (joust): Warn about potentially confusing promotion rules
16329 with -Wsign-promo.
16330 * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
16331
16332 Tue Aug 5 15:15:07 1997 Michael Meissner <meissner@cygnus.com>
16333
16334 * exception.cc: Declare __terminate_func with noreturn attribute.
16335
16336 Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
16337
16338 * parse.y: Break out eat_saved_input, handle errors.
16339 (function_try_block): Use compstmt instead of compstmt_or_error.
16340
16341 Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
16342
16343 * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
16344
16345 Fri Jul 4 01:45:16 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
16346
16347 * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
16348 existence of cc1plus check whether $(LANGUAGES) contains C++.
16349
16350 Wed Jul 30 13:04:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
16351
16352 * method.c (do_build_copy_constructor): When copying an anonymous
16353 union member loop around to handle nested anonymous unions. Use
16354 the offset of the member relative to the outer structure, not the
16355 union.
16356
16357 Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com>
16358
16359 * call.c (resolve_args): New fn.
16360 (build_new_function_call): Use it.
16361 (build_object_call): Likewise.
16362 (build_new_method_call): Likewise.
16363
16364 Mon Jul 28 16:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
16365
16366 * call.c (build_over_call): tsubst all default parms from templates.
16367
16368 Wed Jul 23 13:36:25 1997 Jason Merrill <jason@yorick.cygnus.com>
16369
16370 * decl.c (struct cp_function): Add static_labelno.
16371 (push_cp_function_context): Save it.
16372 (pop_cp_function_context): Restore it.
16373
16374 Tue Jul 22 14:43:29 1997 Jason Merrill <jason@yorick.cygnus.com>
16375
16376 * typeck.c (build_component_ref_1): Convert from reference.
16377
16378 Tue Jul 22 11:06:23 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16379
16380 * parse.y (current_declspecs, prefix_attributes): Initialize to
16381 NULL_TREE.
16382
16383 * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil
16384 before we try to force it to be a TREE_LIST.
16385 (decl): Make sure $1.t is non-nil.
16386
16387 Sun Jul 20 11:53:07 1997 Jason Merrill <jason@yorick.cygnus.com>
16388
16389 * pt.c (uses_template_parms): Handle template first-parse codes.
16390
16391 * decl.c (cp_finish_decl): Only warn about user-defined statics.
16392
16393 Fri Jul 18 17:56:08 1997 Jason Merrill <jason@yorick.cygnus.com>
16394
16395 * pt.c (unify): Handle BOOLEAN_TYPE.
16396
16397 * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE.
16398 * pt.c (tsubst): Don't set it.
16399 * call.c (build_over_call): Use uses_template_parms.
16400
16401 Thu Jul 17 18:06:30 1997 Jason Merrill <jason@yorick.cygnus.com>
16402
16403 * method.c (build_overload_nested_name): Use static_labelno
16404 instead of var_labelno.
16405 (build_qualified_name): New fn.
16406 (build_overload_name): Split out from here.
16407 (build_static_name): Use build_qualified_name.
16408 * decl.c (cp_finish_decl): Statics in extern inline functions
16409 have comdat linkage.
16410 (start_function): Initialize static_labelno.
16411
16412 Thu Jul 17 11:20:17 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
16413
16414 * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy
16415 before "all member functions in class [] are private".
16416
16417 Wed Jul 16 23:47:08 1997 Jason Merrill <jason@yorick.cygnus.com>
16418
16419 * lex.c (do_scoped_id): convert_from_reference.
16420 * init.c (build_offset_ref): Likewise.
16421
16422 Wed Jul 16 12:34:29 1997 Benjamin Kosnik <bkoz@lisa.cygnus.com>
16423
16424 * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list.
16425
16426 Mon Jul 14 03:23:46 1997 Jason Merrill <jason@yorick.cygnus.com>
16427
16428 * typeck.c (get_member_function_from_ptrfunc): Promote index
16429 before saving it.
16430
16431 Sun Jul 13 00:11:52 1997 Jason Merrill <jason@yorick.cygnus.com>
16432
16433 * tree.c (layout_basetypes): Move non-virtual destructor warning.
16434 * decl.c (xref_basetypes): Remove non-virtual destructor warning.
16435
16436 Sat Jul 12 12:47:12 1997 Jason Merrill <jason@yorick.cygnus.com>
16437
16438 * decl.c (grokdeclarator): Call add_defarg_fn for the function
16439 type, too.
16440 * lex.c (add_defarg_fn): Adjust.
16441 (do_pending_defargs): Adjust. Don't skip the first parm.
16442
16443 Fri Jul 11 01:39:50 1997 Jason Merrill <jason@yorick.cygnus.com>
16444
16445 * decl.c (build_enumerator): Global enumerators are also readonly.
16446
16447 * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast.
16448 (build_dynamic_cast): Call it and convert_from_reference.
16449
16450 * lex.c (add_defarg_fn): New fn.
16451 (snarf_defarg): Don't add to defarg_types.
16452 (do_pending_defargs): Lose defarg_types. All fns we process now
16453 have defargs.
16454 * decl.c (grokfndecl): Call add_defarg_fn.
16455
16456 * Makefile.in (CONFLICTS): Expect 18 s/r conflicts.
16457 * cp-tree.def: Add DEFAULT_ARG.
16458 * spew.c (yylex): Call snarf_defarg as appropriate.
16459 * parse.y: New tokens DEFARG and DEFARG_MARKER.
16460 (defarg_again, pending_defargs, defarg, defarg1): New rules.
16461 (structsp): Use pending_defargs.
16462 (parms, full_parm): Use defarg.
16463 * lex.c (init_lex): Initialize inline_text_firstobj.
16464 (do_pending_inlines): Never pass the obstack to feed_input.
16465 (process_next_inline): Call end_input instead of restore_pending_input.
16466 (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs,
16467 finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns.
16468 * input.c (end_input): New fn.
16469 (sub_getch): At the end of some fed input, just keep returning EOF
16470 until someone calls end_input.
16471 Remove 'obstack' field from struct input_source.
16472 * decl.c (grokparms): Handle DEFAULT_ARG.
16473 (replace_defarg): New fn.
16474 * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros.
16475
16476 Wed Jul 9 13:44:12 1997 Jason Merrill <jason@yorick.cygnus.com>
16477
16478 * call.c (implicit_conversion): If nothing else works, try binding
16479 an rvalue to a reference.
16480
16481 Wed Jul 9 13:04:38 1997 Geoffrey Noer <noer@cygnus.com>
16482
16483 * decl.c (init_decl_processing): Fix Jun 30 patch -- move
16484 ifndef for Cygwin32 to include SIGSEGV.
16485
16486 Thu Jul 3 01:44:05 1997 Jason Merrill <jason@yorick.cygnus.com>
16487
16488 * class.c (finish_struct_1): Only complain about pointers without
16489 copy stuff if there are any constructors.
16490
16491 * rtti.c (build_dynamic_cast): Call complete_type on the types.
16492
16493 * decl.c (grokfndecl): If the function we chose doesn't actually
16494 match, die.
16495
16496 * decl2.c (grokclassfn): Don't specify 'const int' for the
16497 artificial destructor parm.
16498
16499 * pt.c (type_unification): If we are called recursively, nothing
16500 decays.
16501
16502 Mon Jun 30 17:53:21 1997 Geoffrey Noer <noer@cygnus.com>
16503
16504 * decl.c (init_decl_processing): Stop trying to catch signals
16505 other than SIGABRT since the Cygwin32 library doesn't support
16506 them correctly yet. This fixes a situation in which g++ causes
16507 a hang on SIGSEGVs and other such signals in our Win32-hosted
16508 tools.
16509
16510 Mon Jun 30 14:50:01 1997 Jason Merrill <jason@yorick.cygnus.com>
16511
16512 * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
16513
16514 Fri Jun 27 15:18:49 1997 Jason Merrill <jason@yorick.cygnus.com>
16515
16516 * typeck2.c (store_init_value): Always return the value if our
16517 type needs constructing.
16518
16519 * method.c (hack_identifier): Convert class statics from
16520 reference, too.
16521
16522 Thu Jun 26 11:44:46 1997 Jason Merrill <jason@yorick.cygnus.com>
16523
16524 * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
16525
16526 Thu Jun 19 16:49:28 1997 Mike Stump <mrs@cygnus.com>
16527
16528 * typeck.c (c_expand_return): Make sure we clean up temporaries at
16529 the end of return x;
16530
16531 Thu Jun 19 12:28:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16532
16533 * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER.
16534
16535 Tue Jun 17 18:35:57 1997 Mike Stump <mrs@cygnus.com>
16536
16537 * except.c (expand_builtin_throw): Add support
16538 -fno-sjlj-exceptions -fPIC exception handling on the SPARC.
16539
16540 Mon Jun 16 01:24:37 1997 Jason Merrill <jason@yorick.cygnus.com>
16541
16542 * repo.c (extract_string): Null-terminate.
16543
16544 * cp-tree.h (TI_SPEC_INFO): New macro.
16545 (CLASSTYPE_TI_SPEC_INFO): New macro.
16546 * pt.c (push_template_decl): Correctly determine # of template parms
16547 for partial specs.
16548
16549 * call.c (compare_ics): Really fix 'this' conversions.
16550
16551 * pt.c (do_decl_instantiation): Don't crash on explicit inst of
16552 non-template fn.
16553
16554 * pt.c (push_template_decl): Complain about mismatch in # of
16555 template parms between a class template and a member template.
16556
16557 Sun Jun 15 02:38:20 1997 Jason Merrill <jason@yorick.cygnus.com>
16558
16559 * method.c (synthesize_method): You can't call
16560 function_cannot_inline_p after finish_function.
16561 * decl.c (finish_function): Turn on flag_inline_functions and turn
16562 off DECL_INLINE before handing a synthesized method to the
16563 backend.
16564
16565 Thu Jun 12 17:35:28 1997 Jason Merrill <jason@yorick.cygnus.com>
16566
16567 * method.c (synthesize_method): Remove July 30 change to never set
16568 DECL_INLINE if at_eof.
16569
16570 Thu Jun 12 15:25:08 1997 Mike Stump <mrs@cygnus.com>
16571
16572 * xref.c (GNU_xref_member): Ensure that the node has a
16573 decl_lang_specific part before checking DECL_FRIEND_P.
16574
16575 Thu Jun 12 12:36:05 1997 Jason Merrill <jason@yorick.cygnus.com>
16576
16577 * pt.c (instantiate_class_template): Diagnose non-class types used
16578 as bases.
16579
16580 Wed Jun 11 17:33:40 1997 Jason Merrill <jason@yorick.cygnus.com>
16581
16582 * typeck.c (build_conditional_expr): Use convert_for_initialization
16583 instead of convert_and_check.
16584
16585 Wed Jun 11 12:31:33 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16586
16587 * parse.y (typespec): Don't pedwarn for typeof.
16588
16589 Tue Jun 10 00:22:09 1997 Jason Merrill <jason@yorick.cygnus.com>
16590
16591 * repo.c (finish_repo): Only check changes if we would write a
16592 repo file.
16593
16594 * call.c (compare_ics): Fix handling of 'this' conversions.
16595
16596 * pt.c (do_decl_instantiation): Support static data too. Rename
16597 from do_function_instantiation.
16598 * cp-tree.h: Adjust.
16599 * parse.y: Adjust.
16600
16601 * repo.c (extract_string): New fn.
16602 (get_base_filename): Use it.
16603 (init_repo): Compare old args with current args.
16604
16605 Mon Jun 9 14:25:30 1997 Mike Stump <mrs@cygnus.com>
16606
16607 * Makefile.in, Make-lang.in: Protect C-ls with a comment
16608 character, idea from Paul Eggert <eggert@twinsun.com>.
16609
16610 Mon Jun 9 01:52:03 1997 Jason Merrill <jason@yorick.cygnus.com>
16611
16612 * typeck.c (c_expand_return): Be more persistent in looking for
16613 returned temps.
16614
16615 * cvt.c (build_up_reference): Use NOP_EXPR for switching from
16616 pointer to reference.
16617
16618 * class.c (build_vbase_path): Don't do anything if PATH has no steps.
16619
16620 Sun Jun 8 03:07:05 1997 Jason Merrill <jason@yorick.cygnus.com>
16621
16622 * init.c (build_member_call, build_offset_ref):
16623 Use do_scoped_id instead of do_identifier.
16624
16625 * cvt.c (convert): Remove bogosity.
16626
16627 Sat Jun 7 20:50:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16628
16629 * cvt.c (build_up_reference): Do checks of ARGTYPE and
16630 TARGET_TYPE before trying to use get_binfo.
16631
16632 Fri Jun 6 17:36:39 1997 Jason Merrill <jason@yorick.cygnus.com>
16633
16634 * cvt.c (build_up_reference): Call get_binfo to get access control.
16635
16636 * decl2.c (import_export_decl): If we don't support weaks, leave
16637 statics undefined.
16638
16639 Fri Jun 6 15:55:49 1997 Mike Stump <mrs@cygnus.com>
16640
16641 * except.c (expand_builtin_throw): Add support for machines that
16642 cannot access globals after throw's epilogue when
16643 -fno-sjlj-exceptions is used.
16644
16645 Thu Jun 5 16:28:43 1997 Jason Merrill <jason@yorick.cygnus.com>
16646
16647 * parse.y: 'std::' becomes '::'.
16648 * lex.c (real_yylex): Remove 'namespace' warning.
16649 * init.c (build_member_call): Ignore 'std::'.
16650 (build_offset_ref): Likewise.
16651 * decl2.c (do_using_directive): Ignore 'using namespace std;'.
16652 (do_toplevel_using_decl): Ignore 'using std::whatever'.
16653 * decl.c (push_namespace): Just sorry.
16654 (pop_namespace): Nop.
16655 (init_decl_processing): Declare std namespace.
16656
16657 Tue Jun 3 18:08:23 1997 Jason Merrill <jason@yorick.cygnus.com>
16658
16659 * search.c (push_class_decls): A name which ambiguously refers to
16660 several instantiations of the same template just refers to the
16661 template.
16662
16663 Tue Jun 3 12:30:40 1997 Benjamin Kosnik <bkoz@cirdan.cygnus.com>
16664
16665 * decl.c (build_enumerator): Fix problem with unsigned long
16666 enumerated values being smashed to ints, causing overflow
16667 when computing next enumerated value (for enum values around
16668 MAX_VAL).
16669
16670 Mon Jun 2 17:40:56 1997 Jason Merrill <jason@yorick.cygnus.com>
16671
16672 * typeck.c (build_component_ref): Only call mark_used on a decl.
16673
16674 Thu May 29 15:54:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16675
16676 * typeck.c (build_c_cast): Make the check for a ptr to function
16677 more specific before possible default_conversion call.
16678
16679 Thu May 29 13:02:06 1997 Mike Stump <mrs@cygnus.com>
16680
16681 * except.c (expand_exception_blocks): Simplify and fix and make
16682 sure we don't end a region in a sequence, as expand_end_bindings
16683 doesn't like it.
16684
16685 Wed May 28 17:08:03 1997 Mike Stump <mrs@cygnus.com>
16686
16687 * except.c (init_exception_processing): Mark terminate as not
16688 returning so that the optimizer can optimize better.
16689
16690 Tue May 27 19:49:19 1997 Mike Stump <mrs@cygnus.com>
16691
16692 * cvt.c (convert): Don't do any extra work, if we can avoid it
16693 easily.
16694
16695 Tue May 27 18:21:47 1997 Mike Stump <mrs@cygnus.com>
16696
16697 * *.[chy]: Change cp_convert to ocp_convert, change convert to
16698 cp_convert. convert is now reserved for the backend, and doesn't
16699 have the semantics a frontend person should ever want.
16700
16701 Fri May 23 10:58:31 1997 Jason Merrill <jason@yorick.cygnus.com>
16702
16703 * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled.
16704 Lose -traditional support.
16705
16706 Thu May 22 15:41:28 1997 Jason Merrill <jason@yorick.cygnus.com>
16707
16708 * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype).
16709
16710 * parse.y (self_reference): Do it for templates, too.
16711 * class.c (pushclass): Don't overload_template_name; the alias
16712 generated by build_self_reference serves the same purpose.
16713
16714 * tree.c (list_hash): Make static, take more args.
16715 (list_hash_lookup): Likewise.
16716 (list_hash_add): Make static.
16717 (list_hash_canon): Lose.
16718 (hash_tree_cons): Only build a new node if one isn't already in the
16719 hashtable.
16720 (hash_tree_chain): Use hash_tree_cons.
16721 * cp-tree.h: Adjust.
16722 * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead
16723 of calling lookup_name.
16724
16725 Wed May 21 18:24:19 1997 Jason Merrill <jason@yorick.cygnus.com>
16726
16727 * pt.c (instantiate_class_template): TYPE_VALUES for an enum
16728 doesn't refer to the CONST_DECLs.
16729
16730 Tue May 20 21:09:32 1997 Bob Manson <manson@charmed.cygnus.com>
16731
16732 * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever
16733 is bigger.
16734 (expand_class_desc): Convert the last argument to a sizetype.
16735
16736 Tue May 20 13:55:57 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
16737
16738 * gxx.gperf (__complex, __complex__, __imag, __imag__, __real,
16739 __real__): Add reswords.
16740 * hash.h: Regenerate.
16741 * lex.h (rid): Add RID_COMPLEX.
16742 (RID_LAST_MODIFIER): Set to RID_COMPLEX.
16743 * lex.c (init_lex): Add building of RID_COMPLEX.
16744 (real_yylex): General cleanup in line with what c-lex.c also has,
16745 sans the cruft for traditional; add handling of SPEC_IMAG, complex
16746 types, and imaginary numeric constants.
16747 * parse.y (REALPART, IMAGPART): Add tokens.
16748 (unary_expr): Add REALPART and IMAGPART rules.
16749 * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare.
16750 * decl.c (complex_{integer,float,double,long}_type_node): Define
16751 types.
16752 (init_decl_processing): Set up the types.
16753 (grokdeclarator): Add handling of RID_COMPLEX. Set and use
16754 DEFAULTED_INT instead of EXPLICIT_INT when we default to int type.
16755 * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
16756 * cvt.c (cp_convert): Handle COMPLEX_TYPE.
16757 * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add
16758 COMPLEX_TYPE case.
16759 * method.c (build_overload_name): Add handling of the different
16760 COMPLEX_TYPEs, prefixing them with `J'.
16761 * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE
16762 as a template parm.
16763 (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case.
16764 * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases.
16765 (mapcar): Handle COMPLEX_CST.
16766 * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE.
16767 (common_type): Add code for complex types.
16768 (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
16769 (convert_for_assignment): Likewise.
16770 (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases.
16771
16772 Mon May 19 12:26:27 1997 Jason Merrill <jason@yorick.cygnus.com>
16773
16774 * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to
16775 tsubst_expr, as it might try to do overload resolution.
16776
16777 Sat May 17 10:48:31 1997 Jason Merrill <jason@yorick.cygnus.com>
16778
16779 * pt.c (instantiate_class_template): Oops.
16780
16781 Fri May 16 14:23:57 1997 Jason Merrill <jason@yorick.cygnus.com>
16782
16783 * cp-tree.def: Add TAG_DEFN.
16784 * pt.c (tsubst_enum): New fn.
16785 (instantiate_class_template): Use it.
16786 (tsubst_expr): Support TAG_DEFN.
16787 (tsubst): Support local enums.
16788 (tsubst_copy): Likewise.
16789 * decl.c (finish_enum): Likewise.
16790 (start_enum): If this is a local enum, switch to permanent_obstack.
16791
16792 Wed May 14 19:08:28 1997 Mike Stump <mrs@cygnus.com>
16793
16794 * decl.c (store_parm_decls): Set last_parm_cleanup_insn here.
16795 (finish_function): Put the base init code for constructors just
16796 after the parm cleanup insns.
16797 (struct cp_function): Add last_parm_cleanup_insn.
16798 (pu
This page took 0.737572 seconds and 6 git commands to generate.