]> gcc.gnu.org Git - gcc.git/blame - gcc/cp/ChangeLog
Cast pointer arguments to bzero and bcopy to char *.
[gcc.git] / gcc / cp / ChangeLog
CommitLineData
cba8ba35
JM
1Mon Oct 10 00:56:53 1994 Jason Merrill (jason@phydeaux.cygnus.com)
2
3 * lex.c (cons_up_default_function): Mark methods in a template class
4 as template instances. Store the values of interface_unknown and
5 interface_only for do_pending_inlines.
6 (do_pending_inlines): Use them.
7
8Sun Oct 9 02:42:29 1994 Jason Merrill (jason@phydeaux.cygnus.com)
9
10 * method.c (do_build_copy_constructor): Handle anonymous unions.
11 (do_build_assign_ref): Ditto.
12 (largest_union_member): Move from lex.c.
13
14Wed Oct 5 13:44:41 1994 Jason Merrill (jason@phydeaux.cygnus.com)
15
16 * call.c (build_overload_call_real): Don't immediately do
17 array->pointer conversion.
18
19 * pt.c (type_unification): If not passing to a reference, strip
20 cv-quals. Also handle array->pointer conversion.
21
22Tue Oct 4 17:45:37 1994 Jason Merrill (jason@phydeaux.cygnus.com)
23
24 * decl.c (grokdeclarator): Don't warn about applying const to a
25 const typedef or template type parameter.
26
27Mon Oct 3 15:02:41 1994 Jason Merrill (jason@phydeaux.cygnus.com)
28
29 * decl.c (shadow_tag): Remove obsolete code for pushing tags and
30 dealing with exceptions.
31
32Sun Oct 2 00:21:56 1994 Jason Merrill (jason@phydeaux.cygnus.com)
33
34 * parse.y (expr_or_declarator): Add '(' expr_or_declarator ')' rule.
35 (direct_notype_declarator): Ditto.
36 (complex_direct_notype_declarator): Remove it here.
37
38Sat Oct 1 21:42:18 1994 Jason Merrill (jason@deneb.cygnus.com)
39
40 * init.c (resolve_offset_ref): Fix types used in resolving .*
41 expressions.
42
b3738072
MB
43Thu Sep 29 16:15:36 1994 Michael I Bushnell <mib@churchy.gnu.ai.mit.edu>
44
45 * g++.c: Rework last change so it's done like collect.c (and
46 gcc.c).
47
81613e43
BK
48Wed Sep 28 19:19:01 1994 Brendan Kehoe (brendan@mole.gnu.ai.mit.edu)
49
50 * except.c (register_exception_table): Use Pmode, not PTRmode.
51
44c5421f
MB
52Wed Sep 14 10:17:27 1994 Michael I Bushnell <mib@churchy.gnu.ai.mit.edu>
53
54 * g++.c: Include <sys/errno.h> in case `errno' is a macro
55 as permitted by ANSI C.
56
eac293a1
MS
57Thu Sep 29 16:58:52 1994 Mike Stump <mrs@cygnus.com>
58
59 * typeck.c (c_expand_return): Use magic so the backend can fixup the
60 assignment into the return register, so cleanups won't clobber it.
61
62Thu Sep 29 13:08:50 1994 Jason Merrill (jason@deneb.cygnus.com)
63
64 * method.c (hack_identifier): Don't call assemble_external for
65 template decls.
66
67 * decl.c (finish_decl): Also end temporary allocation if the decl in
68 question has a type of error_mark_node.
69
70Wed Sep 28 21:45:00 1994 Mike Stump (mrs@cygnus.com)
71
72 * typeck.c (build_modify_expr): When optimizing ?: on lhs, make sure
73 that if the ?: was a reference type, that the subparts will be also.
74
75Wed Sep 28 16:14:04 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
76
77 * except.c (register_exception_table): Use Pmode, not PTRmode.
78
79Fri Sep 23 13:54:27 1994 Jason Merrill (jason@deneb.cygnus.com)
80
81 * lex.c (do_pending_inlines): Do method synthesis after the
82 pending_inlines have been reversed.
83
f376e137
MS
84Thu Sep 22 12:53:03 1994 Per Bothner (bothner@kalessin.cygnus.com)
85
86 * decl2.c (finish_file): Fix Brendan's fix: Only call
87 register_exception_table if there is a non-empty exception table.
88
89Thu Sep 22 12:03:46 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
90
91 * decl2.c (finish_file): Only do register_exception_table if
92 -fhandle-exceptions is being used.
93
94Wed Sep 21 19:01:51 1994 Per Bothner (bothner@kalessin.cygnus.com)
95
96 * except.c (output_exception_table_entry): Simplify
97 by using assemble_integer.
98 (build_exception_table): Change to return a count.
99 Cleanup to use standard macros, instead of hard-wired
100 sparc asm format. Don't make __EXCEPTION_TABLE__ global.
101 (register_exception_table): New function. Generate call to builtin.
102 * decl2.c (finish_file): Call register_exception_table.
103 * cp-tree.h (build_exception_table): Fix prototype.
104
105Wed Sep 21 13:20:42 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
106
107 * tree.c (break_out_calls): Don't try to duplicate the DECL_INITIAL.
108
109 * decl2.c (delete_sanity): Give an error at trying to delete a
110 function.
111
112Wed Sep 21 11:47:10 1994 Jason Merrill (jason@deneb.cygnus.com)
113
114 * lex.c (cons_up_default_function): Mark synthesized destructors
115 inline.
116
117 * decl.c (duplicate_decls): Ignore redeclarations of wchar_t as
118 something other than __wchar_t, complaining if -pedantic and not in
119 a system header.
120
121Tue Sep 20 09:43:28 1994 Jason Merrill (jason@deneb.cygnus.com)
122
123 * decl.c (xref_tag): Set up BINFO_INHERITANCE_CHAIN on base binfos
124 here.
125
126 * typeck.c (build_modify_expr): Require complete type after checking
127 for error_mark_node.
128
129 * call.c (build_method_call): Print parmtypes when complaining of
130 ambiguous call.
131
132 * typeck.c (build_modify_expr): Handle assignment to array from
133 non-array.
134
135 * decl.c (lookup_name_real): Deal with got_scope == error_mark_node.
136
137 * call.c (build_method_call): Don't bother with the exact match.
138
139Mon Sep 19 00:51:39 1994 Jason Merrill (jason@deneb.cygnus.com)
140
141 * init.c (expand_aggr_init): If we munge the type of the variable,
142 also munge the type of the initializer.
143
144 * decl.c (grokdeclarator): Use <= when comparing to RID_LAST_MODIFIER.
145 (init_decl_processing): Push artificial declaration of wchar_t so
146 people don't have to declare it before they can use it.
147
148 * error.c (cp_line_of): return lineno in lieu of 0.
149
150 * typeck.c (convert_for_assignment): Handle conversion of pmfs to
151 int and bool.
152 (build_component_ref): Fold the COMPONENT_REF in case it can be
153 reduced.
154
155 * typeck2.c (store_init_value): Don't pedwarn about non-constant
156 bracketed initializers for automatic variables.
157
158Sun Sep 18 10:12:12 1994 Jason Merrill (jason@deneb.cygnus.com)
159
160 * error.c (dump_decl): Don't say `typedef enum foo foo'.
161
162 * decl.c (start_decl): Don't set TREE_PUBLIC on template decls just
163 because they're affected by #pragma i/i. We'll deal with that when
164 they get instantiated.
165
166 * typeck.c (build_unary_op): Clean up cruft in ADDR_EXPR case.
167
168 * class.c (instantiate_type): Set TREE_CONSTANT on instantiated
169 ADDR_EXPRs if appropriate.
170
171 * decl.c (build_ptrmemfunc_type): Unset IS_AGGR_TYPE on pmf types.
172
173 * typeck.c (build_ptrmemfunc): Handle &overloaded_method as an
174 initializer properly.
175 * typeck2.c (digest_init): Ditto.
176
177 * tree.c (cp_build_type_variant): Like c_build_type_variant, except
178 it uses build_cplus_array_type.
179 * *.c: Use cp_build_type_variant instead of c_build_type_variant.
180
181 * pt.c (do_type_instantiation): Don't try to instantiate nested
182 enums.
183
184Tue Sep 13 10:56:58 1994 Jason Merrill (jason@deneb.cygnus.com)
185
186 * cvt.c (build_up_reference): Handle preincrement and predecrement
187 properly.
188
189Tue Sep 13 09:51:59 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
190
191 * decl.c (finish_decl): Only lay out the rtl for DECL if it is, in
192 fact, static.
193
194Mon Sep 12 14:40:30 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
195
196 * decl.c (finish_decl): Lay out the rtl for DECL before doing
197 grok_reference_init, in case it's static.
198
199Mon Sep 12 12:45:38 1994 Jason Merrill (jason@deneb.cygnus.com)
200
201 * class.c (finish_struct): Don't synthesize constructors if the
202 class has a field with the same name as the class. Don't die on
203 classes with no constructors or destructors. Don't die if the head
204 and tail of the class are in different files.
205
206 * decl.c (grokdeclarator): Don't treat a function pointer field
207 with the same name as the class as a constructor.
208
209Fri Sep 9 13:17:00 1994 Jason Merrill (jason@deneb.cygnus.com)
210
211 * typeck.c (build_c_cast): Pull constant values out of their
212 variables here.
213
214 * decl.c (duplicate_decls): Only propagate DECL_CHAIN in
215 FUNCTION_DECLs and TEMPLATE_DECLs.
216
217Thu Sep 8 10:07:48 1994 Jason Merrill (jason@deneb.cygnus.com)
218
219 * decl.c (duplicate_decls): Propagate DECL_CHAIN in all DECLs that
220 have it.
221
222 * pt.c (unify): REALs and INTEGERs only unify with their own genus.
223 (instantiate_member_templates): Don't muck with DECL_EXTERNAL and
224 TREE_PUBLIC unless -fexternal-templates.
225
226Wed Sep 7 13:17:10 1994 Jason Merrill (jason@deneb.cygnus.com)
227
228 * pt.c (do_type_instantiation): Call instantiate_member_templates.
229 Deal with specializations.
230 (tsubst): Don't stick the mangled name in DECL_NAME for function
231 instantiations. Don't push them, either.
232
233 * decl2.c (grokfield): Move code for generating the
234 DECL_ASSEMBLER_NAME for static members from here.
235 * method.c (build_static_name): To here.
236 * decl.c (grokvardecl): Call build_static_name.
237 (duplicate_decls): Keep old DECL_ASSEMBLER_NAME.
238
239Mon Sep 5 12:49:18 1994 Jason Merrill (jason@deneb.cygnus.com)
240
241 * call.c (build_method_call): if -Wsynth, warn when selecting
242 synthesized op= over user-supplied one cfront would select.
243 * decl2.c (lang_decode_option): Handle -Wsynth.
244
245Fri Sep 2 15:11:59 1994 Jason Merrill (jason@deneb.cygnus.com)
246
247 * decl.c (finish_enum): Overhaul to fix several bugs.
248 (start_enum): Disable useless code.
249
250Thu Sep 1 16:04:54 1994 Jason Merrill (jason@deneb.cygnus.com)
251
252 * typeck.c (c_expand_return): Warn about returning a reference to a
253 temporary.
254 (convert_arguments): Increment argument counter when using default
255 arguments, too.
256
257Wed Aug 31 14:29:22 1994 Jason Merrill (jason@deneb.cygnus.com)
258
259 * decl.c (finish_decl): If the type of decl is error_mark_node,
260 don't bother trying to do anything.
261
262 * typeck.c (convert_for_initialization): If the rhs contains a
263 constructor call, pretend the lhs type needs to be constructed.
264
265 * init.c (expand_default_init): If we stick the object inside the
266 initializer, mark the initializer used.
267
268Tue Aug 30 13:50:18 1994 Jason Merrill (jason@deneb.cygnus.com)
269
270 * method.c (build_assign_ref): return *this;
271 (build_assign_ref): Fix base assignment order.
272 (build_copy_constructor): Fix member init order.
273
274Mon Aug 29 13:54:39 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
275
276 * g++.c (main): Remember to clear out SAW_SPECLANG after we see
277 its argument.
278
279Sat Aug 27 09:36:03 1994 Jason Merrill (jason@deneb.cygnus.com)
280
281 * method.c (build_copy_constructor): Also copy virtual bases.
282
283Fri Aug 26 17:05:15 1994 Jason Merrill (jason@deneb.cygnus.com)
284
285 * lex.c (do_pending_inlines): Clear out pending_inlines before doing
286 any synthesis. Also first set deja_vu on all pending_inlines.
287
288 * method.c (build_assign_ref): Use build_member_call to invoke base
289 operator=, rather than build_modify_expr. And use
290 build_reference_type instead of TYPE_REFERENCE_TO.
291 (build_copy_constructor): Use TYPE_NESTED_NAME to identify the
292 basetype.
293
294 * decl2.c (grokfield): Don't complain about undefined local class
295 methods.
296
297 * class.c (finish_struct): Don't try to synthesize methods here.
298 * lex.c (do_pending_inlines): Instead, synthesize them here.
299 (init_lex): Initialize synth_obstack.
300 (cons_up_default_function): Stick synthesis request on
301 pending_inlines.
302
303Fri Aug 26 12:24:14 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
304
305 * call.c (build_method_call) [PCC_STATIC_STRUCT_RETURN]: Also
306 accept an RTL_EXPR in what we're about to use for the instance,
307 since anything which would end up with pcc_struct_return set
308 inside cplus_expand_expr.
309
310 * cp-tree.h (cons_up_default_function): Note change of prototype.
311
312Thu Aug 25 23:05:30 1994 Gerald Baumgartner (gb@cs.purdue.edu)
313
314 * class.c (finish_struct): Undid change from Aug 21 testing
315 CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING.
316 * parse.y (left_curly): Ditto, undid change from Aug 21.
317 * decl.c (xref_tag): Undid change from Aug 21, set
318 CLASSTYPE_INTERFACE correctly, and added comments.
319
320Thu Aug 25 00:36:31 1994 Jason Merrill (jason@deneb.cygnus.com)
321
322 Rework approach to synthesized methods; don't go through the parser
323 anymore.
324 * class.c (finish_struct): Use new synthesis approach.
325 * lex.c (cons_up_default_function): Now just creates declaration,
326 not code.
327 (largest_union_member): #if 0 out.
328 (default_assign_ref_body): Ditto.
329 (default_copy_constructor_body): Ditto.
330 * method.c (build_default_constructor): New function to synthesize X().
331 (build_copy_constructor): Synthesize X(X&).
332 (build_assign_ref): Synthesize X::operator=(X&).
333 (build_dtor): Synthesize ~X().
334
335 * error.c (cp_line_of): If we're dealing with an artificial
336 TYPE_DECL, look at the type instead.
337
338Wed Aug 24 11:11:50 1994 Jason Merrill (jason@deneb.cygnus.com)
339
340 * init.c (sort_member_init): Check warn_reorder.
341 * decl2.c (lang_decode_option): Handle -W{no-,}reorder.
342
343 * cp-tree.h (CLASSTYPE_SOURCE_LINE): New macro.
344 * error.c (cp_line_of): Use CLASSTYPE_SOURCE_LINE for aggregates.
345 * class.c (finish_struct): Set CLASSTYPE_SOURCE_LINE.
346
347Tue Aug 23 09:28:35 1994 Mike Stump (mrs@cygnus.com)
348
349 * error.c (dump_decl): Improve wording, so that error messages
350 dont't read template<, class foo>...
351
352Mon Aug 22 15:30:51 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
353
354 * parse.y (label_colon): Also match a TYPENAME as a label name,
355 since they may have declared a class by that name but have also
356 tried to have a local label under the same name.
357
358 * pt.c (coerce_template_parms): Call cp_error, not cp_error_at,
359 for the message so they know at what point it was instantiated.
360
361Sun Aug 21 23:07:35 1994 Gerald Baumgartner (gb@cs.purdue.edu)
362
363 * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and
364 CLASSTYPE_VTABLE_NEEDS_WRITING for signatures up to left_curly time.
365 * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and
366 CLASSTYPE_VTABLE_NEEDS_WRITING for signatures down to left_curly time.
367 * parse.y (left_curly): New final resting place for setting
368 CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING for signatures.
369
370 * class.c (finish_struct): Don't test for function/field name
371 conflicts in signatures, since all the fields are compiler-constructed.
372
373Fri Aug 19 14:04:47 1994 Kung Hsu (kung@mexican.cygnus.com)
374
375 * method.c (build_overload_nested_name): in qualified name
376 mangling, the template with value instantiation will have numeric
377 at end and may mixed with the name length of next nested level.
378 Add a '_' in between.
379 * method.c (build_overload_name): ditto.
380 * method.c (build_overload_identifier): ditto.
381
382Thu Aug 18 16:24:43 1994 Mike Stump (mrs@cygnus.com)
383
384 * error.c (dump_decl): Handle NULL args.
385
00595019
MS
386Thu Aug 18 12:48:09 1994 Mike Stump (mrs@cygnus.com)
387
388 * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and
389 CLASSTYPE_VTABLE_NEEDS_WRITING up to left_curly time.
390 * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and
391 CLASSTYPE_VTABLE_NEEDS_WRITING down to left_curly time.
392 * parse.y (left_curly): New final resting place for setting
393 CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING.
394
395Thu Aug 11 11:32:42 1994 H.J. Lu (hjl@nynexst.com)
396
397 * g++.c (main): Only decrement "added" and set "library" to
398 NULL when "library" != NULL.
399
400Sat Aug 13 00:14:52 1994 Jason Merrill (jason@deneb.cygnus.com)
401
402 * decl.c (grokdeclarator): Don't set TREE_PUBLIC on a function decl
403 just because its class has a known interface.
404 (decls_match): Deal with new format of template parms.
405
406 * lex.c (cons_up_default_function): Don't play with TREE_PUBLIC and
407 DECL_EXTERNAL here.
408
409Fri Aug 12 01:55:15 1994 Jason Merrill (jason@deneb.cygnus.com)
410
411 * decl.c (pushtag): SET_DECL_ARTIFICIAL on gratuitous typedefs.
412 (xref_defn_tag): Ditto.
413 (pushdecl): Only allow artificial typedefs to be shadowed.
414
415 * init.c (emit_base_init): Pass the right binfos to
416 expand_aggr_init_1.
417
418 * class.c (delete_duplicate_fields_1): Make it work right.
419 (finish_struct): Catch function/field name conflict.
420
421 * decl2.c (check_classfn): Pass the function to cp_error, not just
422 the name.
423
424 * init.c (sort_member_init): Warn when order of member initializers
425 does not match order of member declarations.
426 (emit_base_init): Call expand_aggr_init_1 with LOOKUP_PROTECT.
427
428 * error.c (dump_expr): Handle lists of functions.
429
430 * decl.c (start_function): #pragma interface only affects functions
431 that would otherwise be static.
432 (finish_decl): Don't warn about an unused variable if it has both
433 constructor and destructor, since the 'resource allocation is
434 initialization' idiom is relatively common.
435
436 * typeck.c (comp_target_types): Don't handle TEMPLATE_TYPE_PARMs.
437 (comp_target_parms): Ditto.
438 (compparms): Never consider default parms.
439 (common_base_type): Don't choose a virtual baseclass if there is a
440 more derived class in common.
441 (build_conditional_expr): If pedantic, pedwarn about conversion to
442 common base in conditional expr.
443
444 * class.c (instantiate_type): Handle template instantiation better.
445
446 * typeck.c (convert_arguments): Don't try to get tricky and convert
447 to int directly when PROMOTE_PROTOTYPES is set, as it breaks
448 user-defined conversions.
449
450 * lex.c (check_for_missing_semicolon): Also give error at end of
451 file.
452
453 * call.c (build_method_call): Don't promote arrays to pointers here.
454
455 * typeck.c (convert_arguments): Don't require the actual parameter
456 to be of a complete type if the formal parameter is a reference.
457
458Thu Aug 11 15:21:40 1994 Jason Merrill (jason@deneb.cygnus.com)
459
460 * decl.c (grokdeclarator): Soften 'static' on member function error
461 to pedwarn.
462
463 * init.c (build_new): Don't automatically save rval.
464 (build_offset_ref): Do field lookup with proper basetype_path.
465
466Thu Aug 11 12:46:54 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
467
468 * errfn.c (cp_silent): Declare to mark when we should avoid
469 emitting warnings and errors.
470 (cp_error): Check it.
471 (cp_warning): Likewise.
472 (cp_pedwarn): Likewise.
473 (cp_compiler_error): Likewise.
474 (cp_error_at): Likewise.
475 (cp_warning_at): Likewise.
476 (cp_pedwarn_at): Likewise.
477 * call.c (compute_conversion_costs): Set CP_SILENT when we start
478 out, and make sure we turn it off before we leave.
479
480Thu Aug 11 00:02:54 1994 Jason Merrill (jason@deneb.cygnus.com)
481
482 * decl2.c (grok_array_decl): Try computing *(A+B) if neither
483 argument is obviously an array.
484
485Wed Aug 10 15:32:04 1994 Jason Merrill (jason@deneb.cygnus.com)
486
487 * typeck.c (c_expand_start_case): Do cleanups here.
488
489 * parse.y (xcond): Do bool conversion here, too.
490 (simple_stmt, SWITCH case): Don't do cleanups here.
491
492 * decl.c (duplicate_decls): Don't treat builtins that have been
493 explicitly declared specially.
494
495Tue Aug 9 01:16:09 1994 Jason Merrill (jason@deneb.cygnus.com)
496
497 * tree.c (make_deep_copy): Support copying pointer, reference,
498 function, array, offset and method types.
499
500 * decl.c (init_decl_processing): Mark exit and abort as
501 BUILT_IN_NONANSI so that duplicate_decls is kinder about
502 redeclaration.
503 (duplicate_decls): Don't give two errors for redeclaring a C
504 function with the same parms but a different return type.
505
506 * parse.y (paren_cond_or_null): Do cleanup and bool conversion here.
507 (condition): Instead of here.
508 (simple_stmt, SWITCH case): Also do cleanup here.
509
510 * decl2.c (finish_anon_union): Only break out FIELD_DECLs.
511
512 * call.c (build_method_call): Don't throw away the side effects of
513 the object in a call to a non-existent constructor.
514 * parse.y (primary): Ditto.
515
516 * method.c (build_decl_overload): Oop.
517
518 * decl2.c (lang_decode_option): Deal with flag_no_nonansi_builtin,
519 warn about uselessness of specifying -fansi-overloading.
520
521 * method.c (build_decl_overload): Treat any non-member new with one
522 parameter as __builtin_new.
523
524 * decl.c (init_decl_processing): Setup built-in meanings of exit,
525 _exit and abort.
526
527Mon Aug 8 15:03:30 1994 Jason Merrill (jason@deneb.cygnus.com)
528
529 * error.c (dump_readonly_or_volatile): Put a space between const and
530 volatile if both apply.
531
532 * init.c (perform_member_init): Clean up after this initialization.
533 (emit_base_init): Clean up after each base init, not after all have
534 been done.
535 (expand_aggr_vbase_init_1): Clean up after this init.
536
537Sun Aug 7 14:55:05 1994 Jason Merrill (jason@deneb.cygnus.com)
538
539 * call.c (build_method_call): Deal with destroying references.
540
541 * parse.y (condition): Do bool_truthvalue_conversion here.
542 (paren_expr_or_null): And here.
543 (simple_if): Not here.
544 (simple_stmt): Or here.
545
546Sat Aug 6 22:29:45 1994 Jason Merrill (jason@deneb.cygnus.com)
547
548 * parse.y (paren_expr_or_null): Wrap the expression in a
549 CLEANUP_POINT_EXPR.
550 (condition): Ditto.
551
552Sat Aug 6 19:46:37 1994 Rohan Lenard (rjl@easams.com.au)
553
554 * call.c (build_scoped_method_call): Fix error message when
555 destructor call refers to a nonexistent type.
556
557Sat Apr 16 22:43:30 1993 Gerald Baumgartner (gb@cs.purdue.edu)
558
559 * lex.h (rid): Deleted RID_RAISES, it's never used.
560 Moved RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, RID_EXCEPTION,
561 RID_TEMPLATE and RID_SIGNATURE to the end of the enumeration,
562 they don't need to be touched in `grokdeclarator.'
563 (RID_LAST_MODIFIER): Defined macro to be RID_MUTABLE.
564
565 * decl.c (grokdeclarator): Use RID_LAST_MODIFIER instead of
566 RID_MAX as loop limit for finding declaration specifiers.
567
568Sat Apr 3 21:59:07 1993 Gerald Baumgartner (gb@cs.purdue.edu)
569
570 * lex.c (debug_yytranslate): Moved to parse.y since it needs to
571 access `yytname,' which is static in parse.c.
572
573Fri Apr 2 23:36:57 1993 Gerald Baumgarnter (gb@cs.purdue.edu)
574
575 * cp-tree.h (GNU_xref_ref): Fixed typo in extern declaration, it
576 was `GNU_xref_def' instead of `GNU_xref_ref.'
577
578Fri Aug 5 14:20:16 1994 Jason Merrill (jason@deneb.cygnus.com)
579
580 * pt.c (do_function_instantiation): Don't set TREE_PUBLIC and
581 DECL_EXTERNAL on 'extern' instantiations; wait until EOF to do that.
582 (do_type_instantiation): Ditto.
583
584 * decl2.c (import_export_inline): Decides at EOF what an inline's
585 linkage should be.
586 (finish_file): Call it.
587
588 * decl.c (start_function): Don't rely on the settings of TREE_PUBLIC
589 and DECL_EXTERNAL from do_*_instantiation. Only set
590 DECL_DEFER_OUTPUT on inlines whose linkage might actually change.
591 (finish_function): Use DECL_DEFER_OUTPUT to decide which inlines to
592 mark for later consideration, rather than DECL_FUNCTION_MEMBER_P.
593
a292b002
MS
594Fri Aug 5 01:12:20 1994 Mike Stump (mrs@cygnus.com)
595
596 * class.c (get_class_offset_1, get_class_offset): New routine to
597 find the offset of the class where a virtual function is defined,
598 from the complete type.
599 * class.c (modify_one_vtable, fixup_vtable_deltas): Use
600 get_class_offset instead of virtual_offset as get_class_offset will
601 always provide the right answer.
602 * tree.c (virtual_offset): Remove. It only ever worked some of the
603 time.
604
605Tue Aug 2 12:44:21 1994 Jason Merrill (jason@deneb.cygnus.com)
606
607 * call.c (build_method_call): Put back unary_complex_lvalue call
608 that I thought was redundant.
609
610 * typeck.c (c_expand_return): Fix a case I missed before.
611
612Sun Jul 31 17:54:02 1994 Jason Merrill (jason@deneb.cygnus.com)
613
614 * pt.c (unify): Strip cv-quals from template type arguments (when
615 'const T*' is matched to 'const char*', that does not mean that T is
616 'const char').
617
618Fri Jul 29 01:03:06 1994 Jason Merrill (jason@deneb.cygnus.com)
619
620 * pt.c (do_type_instantiation): Instantiate nested TAGS, not
621 typedefs. Third time's the charm?
622
623 * parse.y (template_parm): Support default template parms.
624 * pt.c (process_template_parm): Ditto.
625 (end_template_parm_list): Ditto.
626 (coerce_template_parms): Ditto.
627 (mangle_class_name_for_template): Ditto.
628 (push_template_decls): Ditto.
629 (unify): Ditto.
630 * method.c (build_overload_identifier): Ditto.
631 * error.c (dump_decl): Ditto.
632
633Wed Jul 27 17:47:00 1994 Jason Merrill (jason@deneb.cygnus.com)
634
635 * pt.c (do_type_instantiation): Only instantiate nested *classes*.
636
637Tue Jul 26 13:22:40 1994 Jason Merrill (jason@deneb.cygnus.com)
638
639 * search.c (note_debug_info_needed): Also emit debugging information
640 for the types of fields.
641
642Mon Jul 25 00:34:44 1994 Jason Merrill (jason@deneb.cygnus.com)
643
644 * pt.c (lookup_template_class): Pass 'template' to
645 coerce_template_parms instead of 'in_decl', since it's a more
646 meaningful context.
647
648 * typeck.c (c_expand_return): Make sure any cleanups for the return
649 expression get run.
650 (build_c_cast): Use CONVERT_EXPR for conversion to void.
651
652 * pt.c (do_type_instantiation): Also instantiate nested types.
653
654 * typeck.c (convert_for_assignment): Don't die when comparing
655 pointers with different levels of indirection.
656
657 * decl.c (grokdeclarator): The sub-call to grokdeclarator for
658 class-local typedefs sets DECL_ARGUMENTS, so we need to clear it
659 out.
660
661 * decl2.c (finish_anon_union): Don't die if the union has no
662 members.
663
664 * decl.c (grokdeclarator): Undo changes to declspecs when we're done
665 so that 'typedef int foo, bar;' will work.
666
667 * decl2.c (finish_file): Don't call expand_aggr_init for
668 non-aggregates.
669
670Mon Jul 25 00:03:10 1994 Teemu Torma (tot@trema.fi)
671
672 * decl.c (finish_function): We can't inline constructors and
673 destructors under some conditions with -fpic, but don't unset
674 DECL_INLINE.
675
676Mon Jul 25 00:03:10 1994 Jason Merrill (jason@deneb.cygnus.com)
677
678 * typeck.c (build_object_ref): Make sure 'datum' is a valid object.
679
680Sun Jul 24 14:19:31 1994 Jason Merrill (jason@deneb.cygnus.com)
681
682 * class.c (finish_struct): Don't set DECL_FIELD_BITPOS on
683 non-fields.
684 (finish_struct_methods): Use copy_assignment_arg_p.
685
686 * cvt.c (cp_convert): If expr is an OFFSET_REF, resolve it instead
687 of giving an error.
688
689 * typeck.c (build_binary_op_nodefault): Don't set result_type if we
690 don't know how to compare the operands.
691
692 * decl.c (grokdeclarator): Avoid seg fault when someone uses '__op'
693 as a declarator-id in their program. Like the Linux headers do.
694 Arrgh.
695
696 * tree.c (lvalue_p): Treat calls to functions returning objects by
697 value as lvalues again.
698
699 * typeck.c (build_component_addr): Use convert_force to convert the
700 pointer in case the component type is also a private base class.
701
702 * search.c (get_matching_virtual): Fix bogus warning of overloaded
703 virtual.
704
705 * pt.c (overload_template_name): Set DECL_ARTIFICIAL on the created
706 TYPE_DECL to fix bogus shadowing warnings.
707
708Fri Jul 22 01:15:32 1994 Jason Merrill (jason@deneb.cygnus.com)
709
710 * init.c (expand_aggr_init_1): const and volatile mismatches do not
711 prevent a TARGET_EXPR from initializing an object directly.
712
713Tue Jul 19 17:55:37 1994 Jason Merrill (jason@deneb.cygnus.com)
714
715 * cvt.c (build_up_reference): Allow building up references to
716 `this', don't warn about making references to artificial variables
717 (like `this').
718
719 * tree.c (lvalue_p): `this' is not an lvalue.
720
721 * call.c (build_method_call): Accept using a typedef name (or
722 template type parameter) for explicit destructor calls.
723
cf17cae3
JM
724Wed Jul 13 03:57:54 1994 Jason Merrill (jason@deneb.cygnus.com)
725
a292b002
MS
726 * method.c (hack_identifier): Put back old code so lists of
727 non-functions will be handled properly.
a5ef9010 728
a292b002
MS
729 * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): #if 0 out; this macro is now
730 defined in the language-independent tree.h.
cf17cae3 731
a292b002
MS
732 * tree.c (count_functions): Avoid bogus warning when compiling this
733 function.
cf17cae3
JM
734
735Mon Jul 11 18:37:20 1994 Jason Merrill (jason@deneb.cygnus.com)
736
a292b002
MS
737 * decl.c (grok_reference_init): Always save the initializer of a
738 reference.
cf17cae3 739
5b605f68
MS
740Fri Jul 8 17:41:46 1994 Mike Stump (mrs@cygnus.com)
741
742 * decl.c (cplus_expand_expr_stmt): Wrap statement expressions inside
743 CLEANUP_POINT_EXPRs so that the stack slots can be reused.
63c68bb7 744 (disabled for now)
5b605f68
MS
745
746Fri Jul 8 12:59:38 1994 Jason Merrill (jason@deneb.cygnus.com)
747
748 * method.c (hack_identifier): Fix for new overloading.
749
750 * typeck.c (build_binary_op_nodefault): Don't mess with division by
751 zero.
752
753Fri Jul 8 13:20:28 1994 Gerald Baumgartner (gb@cs.purdue.edu)
754
755 * decl2.c (finish_file): Only call walk_sigtables, if
756 flag_handle_signatures is turned on, don't waste time otherwise.
757
758Fri Jul 8 02:27:41 1994 Jason Merrill (jason@deneb.cygnus.com)
759
760 * decl.c (push_overloaded_decl): Don't create overloads of one when
761 shadowing a class type.
a292b002 762 * typeck.c (build_x_function_call): Complain about overloads of one.
5b605f68
MS
763
764 * decl.c (grokdeclarator): Don't try to treat a char* as a tree.
765 (grokdeclarator): Fix setting of TREE_STATIC.
766 (start_decl): Clear DECL_IN_AGGR_P after calling duplicate_decls.
767
311862c8
GB
768Thu Jul 7 22:20:46 1994 Gerald Baumgartner (gb@andros.cygnus.com)
769
770 * cp-tree.h (walk_sigtables): Created extern declaration.
771 * decl2.c (walk_sigtables): Created function, patterned after
772 walk_vtables, even though we only need it to write out sigtables.
773 (finish_sigtable_vardecl): Created function.
774 (finish_vtable_vardecl): Changed 0 to NULL_PTR.
775 (finish_file): Call walk_sigtables.
776
777 * sig.c (build_signature_table_constructor): Mark class member
778 function pointed to from signature table entry as addressable.
779
5b605f68
MS
780Thu Jul 7 13:39:37 1994 Jason Merrill (jason@deneb.cygnus.com)
781
782 * decl.c (start_decl): Check new decl of static member variable
783 against the declaration in the class here.
784 (grokvardecl): Instead of here.
785
786 * class.c (prepare_fresh_vtable): Call import_export_vtable if not
787 -fvtable-thunks.
788 (build_vtable): Ditto.
789
790 * decl2.c (import_export_vtable): Move logic for deciding the
791 interface of a template class from here.
792 (import_export_template): To here.
793 (finish_vtable_vardecl): Call import_export_template before
794 import_export_vtable.
795
a3b49ccd
MS
796Wed Jul 6 20:25:48 1994 Mike Stump (mrs@cygnus.com)
797
798 * except.c (init_exception_processing): Setup interim_eh_hook to
799 call lang_interim_eh.
800 * except.c (do_unwind): Propagate throw object value across
801 stack unwinding.
802 * except.c (saved_throw_value): Used to hold the value of the object
803 being thrown. It is always a reference to the real value.
804 * except.c (expand_start_catch_block): Add handling for the
805 value of the exception object.
806 * except.c (expand_start_catch_block): Add handler for the handler,
807 so that throws inside the handler go to the outer block.
808 * except.c (expand_end_catch_block): Ditto.
809 * parse.y (handler_args): Use parm instead, as the other doesn't yet
810 handle references correctly.
811
812Wed Jul 6 17:55:32 1994 Per Bothner (bothner@kalessin.cygnus.com)
813
814 * decl2.c (mark_vtable_entries): If -ftable-thunks, set the
815 vtable entry properly to abort.
816
5b605f68
MS
817Tue Jul 5 14:07:54 1994 Jason Merrill (jason@deneb.cygnus.com)
818
819 * typeck.c (build_binary_op_nodefault): Downgrade division by zero
820 errors to warnings.
821
822 * call.c (build_overload_call_real): Handle fnname being a list of
823 functions.
824 * typeck.c (build_x_function_call): Pass list of functions to
825 build_overload_call, not just the name.
826 * tree.c (count_functions): Complain when called for invalid
827 argument.
828
829 * decl.c (grokdeclarator): Fix settings of TREE_STATIC, TREE_PUBLIC
830 and DECL_EXTERNAL on static members and initialized const members.
831 * decl2.c (grokfield): Reflect this change.
832
9a0e77ba
JM
833Fri Jul 1 09:35:51 1994 Jason Merrill (jason@deneb.cygnus.com)
834
835 * parse.y (init): ANSI C++ does not forbid { }.
836
837Thu Jun 30 00:35:22 1994 Jason Merrill (jason@deneb.cygnus.com)
838
839 * decl2.c (lang_decode_option): Set warn_nonvdtor along with -Wall.
840 warn_nonvdtor defaults to off.
841
842 * class.c (instantiate_type): Use comptypes rather than relying on
843 types to satisfy ==.
844
845 * decl.c (start_function): Set DECL_DEFER_OUTPUT on all inlines that
846 might be static.
847
848 * tree.c (build_cplus_new): Never build WITH_CLEANUP_EXPRs.
849
850 * decl.c (grok_reference_init): Deal with ADDR_EXPRs of TARGET_EXPRs.
851
852 * cvt.c (cp_convert): Pass 0 to with_cleanup_p arg of
853 build_cplus_new.
854
855Wed Jun 29 22:31:09 1994 Jason Merrill (jason@deneb.cygnus.com)
856
857 * decl2.c (finish_file): Maybe consider static inlines multiple
858 times, in case they reference each other.
859
63718c49
GB
860Tue Jun 28 11:58:38 1994 Gerald Baumgartner (gb@cs.purdue.edu)
861
862 * class.c (finish_struct): Don't `cons_up_default_function's
863 for signatures.
864 (finish_struct): Handle an empty method_vec correctly.
865
866 * decl.c (grokdeclarator): Don't warn about a signature being
867 empty in a signature pointer declaration if we only saw a
868 forward declaration of the signature. Changed `warning's into
869 `cp_warning's.
870
871 * sig.c (build_sigtable): Don't die if a null signature table
872 constructor is returned.
873 (build_signature_pointer_constructor): If the signature table
874 constructor is null, the _sptr field is set to a null pointer
875 and cast to the appropriate type. Make copies of all null
876 pointers so that the type null_pointer_node doesn't get changed.
877 (build_signature_table_constructor): Added comments.
878
879 * sig.c (build_signature_pointer_constructor): Complain if we
880 try to assign to/initialize a signature pointer/reference of
881 an undefined signature.
882
883Mon Jun 27 14:05:16 1994 Gerald Baumgartner (gb@cs.purdue.edu)
884
885 * typeck2.c (store_init_value): Don't be pedantic about
886 non-constant initializers of signature tables/pointers/references.
887
888Fri Jun 24 16:49:41 1994 Gerald Baumgartner (gb@cs.purdue.edu)
889
890 * decl.c (grokdeclarator): If we are grokking an opaque typedef
891 in a signature, don't complain about it begin static.
892
21474714
MS
893Wed Jun 29 16:44:45 1994 Mike Stump (mrs@cygnus.com)
894
895 Fixes a problem of the this pointer being wrong in virtual calls to
896 methods that are not overridden in more derived classes.
897
898 * class.c (fixup_vtable_delta): New routine. It will fixup the
899 delta entries in vtables, wheever they need updating.
900 * class.c (finish_struct): Call the new routine for all virtual
901 bases, as they can have different offsets, than those used in base
902 classes that we derive our vtable from.
903
904Tue Jun 28 23:49:28 1994 Jason Merrill (jason@deneb.cygnus.com)
905
906 * typeck.c (build_binary_op): Use the types before default
907 conversions in the error message.
908
909 * *.c: Use c_build_type_variant instead of build_type_variant where
910 the type might be an array.
911
912 * call.c (build_method_call): Call build_type_variant and
913 build_reference_type in the right order.
914 * decl.c (record_builtin_type): Ditto.
915
916Wed Jun 29 16:58:53 1994 Jason Merrill (jason@deneb.cygnus.com)
917
918 * call.c (build_method_call): Call build_type_variant and
919 build_reference_type in the right order.
920 * decl.c (record_builtin_type): Ditto.
921
922Tue Jun 28 23:49:28 1994 Jason Merrill (jason@deneb.cygnus.com)
923
924 * typeck.c (build_binary_op): Use the types before default
925 conversions in the error message.
926
927 * *.c: Use c_build_type_variant instead of build_type_variant where
928 the type might be an array.
929
930Sat Jun 25 11:50:54 1994 Jason Merrill (jason@deneb.cygnus.com)
931
932 * cvt.c (convert_to_reference): Try UDC's before doing the
933 reinterpret_cast thang, though.
934
935Fri Jun 24 01:24:01 1994 Jason Merrill (jason@deneb.cygnus.com)
936
937 * typeck.c (c_expand_return): Don't USE the return value location
938 after we've expanded the jump.
939
940 * decl2.c (finish_file): Make sure DECL_SAVED_INSNS is not 0 before
941 trying to write out an inline.
942
943 * cvt.c (build_up_reference): Also do address adjustment when the
944 target type uses MI.
945 (convert_to_reference): Try UDCs only after built-in conversions.
946 (build_type_conversion_1): Don't play games with the argument to the
947 method.
948 (build_type_conversion): #if 0 out code for binding to reference.
949
a3203465
MS
950Thu Jun 23 00:22:28 1994 Jason Merrill (jason@deneb.cygnus.com)
951
21474714
MS
952 * decl2.c (finish_file): Use TREE_SYMBOL_REFERENCED to decide
953 whether to emit inlines.
954
a3203465
MS
955 * decl.c (grokdeclarator): Set explicit_int for decls that just
956 specify, say, 'long'.
957
958 * init.c (do_friend): Do overload C functions (or call pushdecl,
63718c49 959 anyaway).
a3203465
MS
960
961Wed Jun 22 13:40:49 1994 Jason Merrill (jason@deneb.cygnus.com)
962
963 * cvt.c (build_up_reference): Don't call readonly_error.
964 (convert_to_reference): Propagate const and volatile from expr to
965 its type.
966
967 * tree.c (lvalue_p): Random CALL_EXPRs are not lvalues.
968
969 * cvt.c (build_up_reference): Break out WITH_CLEANUP_EXPR when
970 creating a temporary.
971 (convert_to_reference): Lose excessive and incorrect trickiness.
972 (cp_convert): Call build_cplus_new with with_cleanup_p set.
973
974 * typeck2.c (build_functional_cast): Ditto.
975
976Tue Jun 21 17:38:38 1994 Jason Merrill (jason@deneb.cygnus.com)
977
978 * decl.c (grokdeclarator): signed, unsigned, long and short all
979 imply 'int'.
980
981 * decl.c (grokdeclarator): Allow "this is a type" syntax.
982 (grok_reference_init): Simplify and fix.
983
984Sun Jun 19 17:08:48 1994 Jason Merrill (jason@deneb.cygnus.com)
985
986 * decl.c (grokdeclarator): pedwarn about a typedef that specifies no
987 type.
988
989Sat Jun 18 04:16:50 1994 Jason Merrill (jason@deneb.cygnus.com)
990
991 * decl.c (start_function): Move TREE_PUBLIC and DECL_EXTERNAL
992 tinkering to after call to pushdecl.
993
994Fri Jun 17 14:48:28 1994 Jason Merrill (jason@deneb.cygnus.com)
995
996 * call.c (build_method_call): Handle destructors for non-aggregate
997 types properly.
998
999Thu Jun 16 16:48:05 1994 Jason Merrill (jason@deneb.cygnus.com)
1000
1001 * call.c (build_method_call): Make sure that the name given for the
1002 destructor matches the constructor_name of the instance.
1003
1004 * pt.c (do_function_instantiation): A non-extern instantiation
1005 overrides a later extern one.
1006 (do_type_instantiation): Ditto.
1007
1008Wed Jun 15 19:34:54 1994 Jason Merrill (jason@deneb.cygnus.com)
1009
1010 * init.c (expand_aggr_init): Use TYPE_MAIN_VARIANT to get the
1011 unqualified array type.
1012
1013 * cp-tree.h (EMPTY_CONSTRUCTOR_P): Tests whether NODE is a
1014 CONSTRUCTOR with no elements.
1015
1016 * decl.c (various): Lose empty_init_node.
1017 (finish_decl): Use EMPTY_CONSTRUCTOR_P, do the empty CONSTRUCTOR
1018 thing depending on the value of DECL_COMMON instead of
1019 flag_conserve_space, do the empty CONSTRUCTOR thing for types that
1020 don't have constructors, don't treat a real empty CONSTRUCTOR
1021 specially.
1022
1023 * typeck2.c (process_init_constructor): Don't treat empty_init_node
1024 specially.
1025
1026Wed Jun 15 19:05:25 1994 Mike Stump (mrs@cygnus.com)
1027
1028 * class.c (override_one_vtable): Don't forget to merge in an old
1029 overrider when we wanted to reuse a vtable, but couldn't.
1030
1031Wed Jun 15 15:03:16 1994 Jason Merrill (jason@deneb.cygnus.com)
1032
1033 * decl.c (start_decl): Put statics in common again.
1034
1035 * decl.c (grokdeclarator): Return NULL_TREE for an error rather than
1036 setting the type to error_mark_node.
1037
1038 * typeck.c (build_modify_expr): Build up a COMPOUND_EXPR for enum
1039 bitfield assignments.
1040
f0e01782
MS
1041Tue Jun 14 12:23:38 1994 Jason Merrill (jason@deneb.cygnus.com)
1042
1043 * decl.c (grok_op_properties): Const objects can be passed by value.
1044
1045Mon Jun 13 03:10:59 1994 Jason Merrill (jason@deneb.cygnus.com)
1046
1047 * decl2.c (import_export_vtable): Force implicit instantiations to
1048 be interface_only when -fno-implicit-templates.
1049
1050 * decl.c (duplicate_decls): Redeclaring a class template name is an
1051 error.
1052
1053 * pt.c (end_template_decl): Call GNU_xref_decl for class templates.
1054 * xref.c (GNU_xref_decl): Support templates.
1055
1056Sat Jun 11 17:09:05 1994 Jason Merrill (jason@deneb.cygnus.com)
1057
1058 * decl.c (grok_op_properties): Split out checking for whether this
1059 function should suppress the default assignment operator.
1060 * decl2.c (grok_function_init): Ditto.
1061 (copy_assignment_arg_p): New function do do just that.
1062 Now considers virtual assignment operators that take a base as an
1063 argument to count as copy assignment operators.
1064
1065 * search.c (dfs_debug_mark): Lose checks for DWARF_DEBUG and
1066 TREE_ASM_WRITTEN, as they are redundant.
1067
1068 * pt.c (end_template_decl): Don't try to set DECL_CLASS_CONTEXT on a
1069 decl that has no LANG_SPECIFIC part.
1070 (do_type_instantiation): Force the debugging information for this
1071 type to be emitted.
1072
1073 * decl.c (start_decl): Clear up uses of various types of templates
1074 (say sorry for static data members, rather than "invalid template").
1075 (expand_static_init): Fix initialization of static data members of
1076 template classes.
1077
1078Fri Jun 10 00:41:19 1994 Jason Merrill (jason@deneb.cygnus.com)
1079
1080 * decl.c (grokdeclarator): Set DECL_CONTEXT on static data members.
1081
1082 * g++.c (main): Use -xc++-cpp-output for .i files.
1083
1084 * pt.c (tsubst): Give meaningful error about declaring template for
1085 a copy constructor which was not declared in the class template.
1086 (do_type_instantiation): Explicit instantiation before the class
1087 template is an error.
1088 (instantiate_template): Don't die if tsubst returns error_mark_node.
1089
1090Thu Jun 9 19:04:59 1994 Jason Merrill (jason@deneb.cygnus.com)
1091
1092 Don't synthesize the copy assignment operator if the one in a base
1093 class is pure virtual.
1094 * cp-tree.h (TYPE_HAS_ABSTRACT_ASSIGN_REF): New macro to indicate
1095 whether the type has a pure virtual copy assignment operator.
1096 * class.c (finish_base_struct): Don't generate the copy assignment
1097 operator if a base class has a pure virtual one.
1098 * decl.c (grok_op_properties): Add disabled code to set
1099 TYPE_HAS_ABSTRACT_ASSIGN_REF with comment pointing to where it is
1100 actually set.
1101 * decl2.c (grok_function_init): Set TYPE_HAS_ABSTRACT_ASSIGN_REF.
1102
1103 * decl2.c (import_export_vtable): Always treat template
1104 instantiations as if write_virtuals >= 2, and treat implicit
1105 instantiations as external if -fno-implicit-templates.
1106 (finish_file): Output all pending inlines if
1107 flag_keep_inline_functions.
1108
1109Wed Jun 8 20:48:02 1994 Mike Stump (mrs@cygnus.com)
1110
1111 * tree.c (layout_vbasetypes): Align virtual base classes inside
1112 complete objects, so that we don't core dump on machines such as
1113 SPARCs when we access members that require larger than normal
1114 alignments, such as a double. Also, we bump up the total alignment
1115 on the complete type, as necessary.
1116
1117Wed Jun 8 16:18:14 1994 Jason Merrill (jason@deneb.cygnus.com)
1118
1119 * gxxint.texi (Free Store): New section with code for examining
1120 cookie.
1121 (Limitations of g++): Remove operator delete entry, since it is no
1122 longer accurate. Fix access control entry.
1123
1124 * typeck.c (build_unary_op): Pedwarn about taking the address of or
1125 incrementing a cast to non-reference type.
1126 (build_modify_expr): Use convert instead of convert_force again.
1127
1128 * search.c (get_base_distance): Use IS_AGGR_TYPE_CODE to check for
1129 class type, not == RECORD_TYPE.
1130
1131 * decl.c (grokdeclarator): Cope with grokfndecl returning NULL_TREE.
1132
1133 * typeck2.c (report_case_error): #if 0 out.
1134 * lex.c (real_yylex): Lose RANGE.
1135 * parse.y: Ditto.
1136
1137Tue Jun 7 18:17:35 1994 Jason Merrill (jason@deneb.cygnus.com)
1138
1139 * parse.y (simple_stmt, case ranges): Use ELLIPSIS instead of RANGE.
1140
1141Mon Jun 6 19:39:57 1994 Jason Merrill (jason@deneb.cygnus.com)
1142
1143 * typeck.c (build_c_cast): Don't shortcut conversions to the same
1144 type. Don't replace consts with their values here, since that's now
1145 done in cp_convert.
1146
1147 * cvt.c (cp_convert): When converting to bool, take
1148 integer_zero_node to false_node and all other INTEGER_CSTs to
1149 true_node.
1150 (build_type_conversion): Don't complain about multiple conversions
1151 to float if we're not really converting.
1152
a0a33927
MS
1153Fri Jun 3 02:10:56 1994 Jason Merrill (jason@deneb.cygnus.com)
1154
f0e01782
MS
1155 Implement 'extern template class A<int>;' syntax for suppressing
1156 specific implicit instantiations.
1157 * cp-tree.h: Update prototypes for do_*_instantiation.
1158 * pt.c (do_pending_expansions): Don't compile 'extern' explicit
1159 instantiations.
1160 (do_function_instantiation): Set DECL_EXTERNAL on 'extern' explicit
1161 instantiations.
1162 (do_type_instantiation): Ditto.
1163 * parse.y (explicit_instantiation): Support 'extern template class
1164 A<int>;' syntax.
1165 * decl.c (start_function): Don't modify the settings of TREE_PUBLIC
1166 and DECL_EXTERNAL on explicit instantiations.
1167
a0a33927
MS
1168 * cvt.c (cp_convert): Replace constants with their values before
1169 converting.
f0e01782 1170 (cp_convert): Consistently use 'e' instead of 'expr'.
a0a33927
MS
1171
1172Thu Jun 2 03:53:30 1994 Jason Merrill (jason@deneb.cygnus.com)
1173
1174 * typeck2.c (build_x_arrow): Resolve OFFSET_REFs first.
1175
1176Wed Jun 1 18:57:35 1994 Jason Merrill (jason@deneb.cygnus.com)
1177
1178 * typeck2.c (digest_init): Handle initializing a pmf with an
1179 overloaded method.
1180 * typeck.c (build_ptrmemfunc): Handle overloaded methods.
1181
1182 * decl.c (pushtag): Use build_decl to make TYPE_DECLs.
1183 (xref_defn_tag): Ditto.
1184 * pt.c (process_template_parm): Ditto.
1185 (lookup_template_class): Ditto.
1186 (push_template_decls): Ditto.
1187 (instantiate_class_template): Ditto.
1188 (create_nested_upt): Ditto.
1189 * class.c (finish_struct): Don't try to set DECL_CLASS_CONTEXT on
1190 TYPE_DECLs.
1191
1192 * typeck.c (convert_arguments): Make sure type is not NULL before
1193 checking its TREE_CODE.
1194
1195Wed Jun 1 17:40:39 1994 Mike Stump (mrs@cygnus.com)
1196
1197 * class.c (get_derived_offset): New routine.
1198 * class.c (finish_base_struct): Make sure we set BINFO_VTABLE and
1199 BINFO_VIRTUALS when we choose a new base class to inherit from.
1200 * class.c (modify_one_vtable): Use get_derived_offset to get the
1201 offset to the most base class subobject that we derived this binfo
1202 from.
1203 * class.c (finish_struct): Move code to calculate the
1204 DECL_FIELD_BITPOS of the vfield up, as we need might need it for
1205 new calls to get_derived_offset in modify_one_vtable.
1206
1207Wed Jun 1 16:50:59 1994 Jason Merrill (jason@deneb.cygnus.com)
1208
1209 * init.c (build_member_call): Use build_pointer_type instead of
1210 TYPE_POINTER_TO.
1211
1212Wed Jun 1 11:11:15 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
1213
1214 * decl.c (grokdeclarator): Make sure we have a DNAME set before we
1215 try to use it in an error.
1216
1217Wed Jun 1 09:48:49 1994 Mike Stump (mrs@cygnus.com)
1218
1219 * typeck.c (convert_arguments, convert_for_initialization): Don't
1220 strip NOP_EXPRs, when we are converting to a reference.
1221
1222Wed Jun 1 01:11:38 1994 Jason Merrill (jason@deneb.cygnus.com)
1223
1224 * typeck.c (build_modify_expr): Don't dereference references when
1225 initializing them.
1226
1227 * decl2.c (grokfield): Don't check for grokdeclarator returning
1228 error_mark_node any more.
1229
1230 * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
1231 (start_method): Return void_type_node instead of error_mark_node.
1232
1233 * typeck.c (build_modify_expr): Resolve offset refs earlier.
1234
1235Tue May 31 16:06:58 1994 Jason Merrill (jason@deneb.cygnus.com)
1236
1237 * call.c (build_method_call): Resolve OFFSET_REFs in the object.
1238
1239 * typeck.c (build_modify_expr): Dereference references before trying
1240 to assign to them.
1241
1242 * call.c (build_method_call): Don't confuse type conversion
1243 operators with constructors.
1244 * typeck2.c (build_functional_cast): Just call build_c_cast if there
1245 was only one parameter.
1246 * method.c (build_typename_overload): Don't set
1247 IDENTIFIER_GLOBAL_VALUE on these identifiers.
1248 * decl.c (grok_op_properties): Warn about defining a type conversion
1249 operator that converts to a base class (or reference to it).
1250 * cvt.c (cp_convert): Don't try to use a type conversion operator
1251 when converting to a base class.
1252 (build_type_conversion_1): Don't call constructor_name_full on an
1253 identifier.
1254 * cp-tree.h (DERIVED_FROM_P): Should be self-explanatory.
1255
1256 * decl.c (start_decl): Don't complain that error_mark_node is an
1257 incomplete type.
1258 (finish_decl): Check for type == error_mark_node.
1259
1260Mon May 30 23:38:55 1994 Jason Merrill (jason@deneb.cygnus.com)
1261
1262 * decl.c (start_function): Set DECL_DEFER_OUTPUT on implicit
1263 instantiations and inline members.
1264
1265 * spew.c (yylex): Set looking_for_template if the next token is a '<'.
1266
1267 * lex.h: Declare looking_for_template.
1268
1269 * decl.c (lookup_name_real): Use looking_for_template to arbitrate
1270 between type and template interpretations of an identifier.
1271
1272Sat May 28 04:07:40 1994 Jason Merrill (jason@deneb.cygnus.com)
1273
1274 * pt.c (instantiate_template): Zero out p if we found a
1275 specialization.
1276
1277 * decl.c (grokdeclarator): Elucidate warning.
1278 (grokdeclarator): If pedantic AND -ansi, complain about long long.
1279
1280 Make explicit instantiation work reasonably. It is now appropriate
1281 to deprecate the use of -fexternal-templates.
1282 * pt.c (instantiate_template): Set DECL_TEMPLATE_SPECIALIZATION or
1283 DECL_IMPLICIT_INSTANTIATION on fndecl as appropriate.
1284 (end_template_instantiation): Reflect changes in USE_TEMPLATE
1285 semantics.
1286 (do_pending_expansions): if (!flag_implicit_templates) DECIDE(0);
1287 (do_function_instantiation): Don't set EXPLICIT_INST if
1288 flag_external_templates is set. Do set TREE_PUBLIC and DECL_EXTERN
1289 appropriately otherwise.
1290 (do_type_instantiation): Set interface info for class. Set
1291 TREE_PUBLIC and DECL_EXTERN for methods. Do none of this if
1292 flag_external_templates is set.
1293 * parse.y: Reflect changes in USE_TEMPLATE semantics.
1294 * decl2.c: New flag flag_implicit_templates determines whether or
1295 not implicit instantiations get emitted. This flag currently
1296 defaults to true, and must be true for -fexternal-templates to work.
1297 (finish_file): Consider flag_implement_inlines when
1298 setting DECL_EXTERNAL. Consider flag_implicit_templates when
1299 deciding whether or not to emit a static copy.
1300 * decl.c (start_function): Set TREE_PUBLIC and DECL_EXTERNAL
1301 properly for template instantiations.
1302 (start_method): Set DECL_IMPLICIT_INSTANTIATION on methods of a
1303 template class.
1304 * cp-tree.h (CLASSTYPE_USE_TEMPLATE): Change semantics.
1305 (DECL_USE_TEMPLATE): Parallel macro for FUNCTION and VAR_DECLs.
1306 (various others): Accessor macros for the above.
1307
1308Fri May 27 13:57:40 1994 Jason Merrill (jason@deneb.cygnus.com)
1309
1310 * typeck.c (build_binary_op_nodefault): Division by constant zero is
1311 an error.
1312
1313Fri May 27 13:50:15 1994 Mike Stump (mrs@cygnus.com)
1314
1315 * class.c (override_one_vtable): Don't modify things we don't own.
1316
1317Fri May 27 01:42:58 1994 Jason Merrill (jason@deneb.cygnus.com)
1318
1319 * decl.c (finish_decl): Don't postpone processing the initializer of
1320 a decl with DECL_EXTERNAL set, and do call rest_of_compilation for a
1321 PUBLIC const at toplevel.
1322 (grokdeclarator): pedwarn about initializing non-const or
1323 non-integral statics in the class body.
1324
1325 * decl.c (pushtag): Don't try to set DECL_CLASS_CONTEXT on a
1326 TYPE_DECL.
1327
1328 * call.c (convert_harshness): Dereference reference on rhs before
1329 proceeding, properly grok passing const things to non-const
1330 references.
1331
1332 * typeck.c (build_unary_op): Soften error about taking the address
1333 of main() to a pedwarn.
1334
1335 * lex.c (default_copy_constructor_body): Unambiguously specify base
1336 classes (i.e. A((const class ::A&)_ctor_arg) ).
1337 (default_assign_ref_body): Ditto.
1338
1339Thu May 26 13:13:55 1994 Gerald Baumgartner (gb@mexican.cygnus.com)
1340
1341 * decl2.c (grokfield): Don't complain about local signature
1342 method declaration without definition.
1343
1344 * call.c (convert_harshness): If `type' is a signature pointer
1345 and `parmtype' is a pointer to a signature, just return 0. We
1346 don't really convert in this case; it's a result of making the
1347 `this' parameter of a signature method a signature pointer.
1348
1349 * call.c (build_method_call): Distinguish calling the default copy
1350 constructor of a signature pointer/reference from a signature
1351 member function call.
1352
1353Thu May 26 12:56:25 1994 Jason Merrill (jason@deneb.cygnus.com)
1354
1355 * decl2.c (grokfield): Don't set TREE_PUBLIC on member function
1356 declarations.
1357
1358 * decl.c (duplicate_decls): A previous function declaration as
1359 static overrides a subsequent non-static definition.
1360 (grokdeclarator): Don't set TREE_PUBLIC on inline method
1361 declarations.
1362
1363Wed May 25 14:36:38 1994 Jason Merrill (jason@deneb.cygnus.com)
1364
1365 * decl.c (grokdeclarator): Handle initialization of static const
1366 members.
1367 (finish_decl): Ditto.
1368
1369 * decl2.c (grokfield): Allow initialization of static const members
1370 even when pedantic.
1371
1372 * decl2.c (grokfield): Deal with grokdeclarator returning
1373 error_mark_node.
1374
1375 * decl.c (grok_ctor_properties): Return 0 for A(A) constructor.
1376 (grokfndecl): Check the return value of grok_ctor_properties.
1377 (start_method): Ditto.
1378
1379 * parse.y (absdcl): Expand type_quals inline.
1380
1381Tue May 24 19:10:32 1994 Jason Merrill (jason@deneb.cygnus.com)
1382
1383 * decl.c (pushtag): Use IS_AGGR_TYPE rather than checking for a
1384 RECORD_TYPE.
1385
1386Tue May 24 18:09:16 1994 Per Bothner (bothner@kalessin.cygnus.com)
1387
1388 * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks,
1389 always use "__vt_%s".
1390 * decl2.c (finish_vtable_vardecl): Don't consider abstract virtuals
1391 when looking for a "sentinal" method (to decide on emitting vtables).
1392 * decl2.c (finish_file): Scan all decls for thunks that need
1393 to be emitted.
1394 * decl2.c (finish_vtable_vardecl): Don't bother calling emit_thunk.
1395 * method.c (make_thunk): Use a more meaningful label. If there
1396 exists a matching top-level THUNK_DECL re-use it; otherwise
1397 create a new THUNK_DECL (and declare it).
1398 * method.c (emit_thunk): Make thunk external/public depending
1399 on the underlying method.
1400
1401Tue May 24 00:22:04 1994 Jason Merrill (jason@deneb.cygnus.com)
1402
1403 * pt.c (tsubst): Use lookup_name_nonclass to find guiding decls, not
1404 lookup_name.
1405
1406 * call.c (build_overload_call_real): Don't immediately pick a
1407 function which matches perfectly.
1408
1409 * decl.c (grokdeclarator): Use c_build_type_variant for arrays.
1410 (grokdeclarator): Warn about, and throw away, cv-quals attached to a
1411 reference (like 'int &const j').
1412
1413 * typeck.c (convert_arguments): Don't mess with i for methods.
1414 * call.c (build_method_call): Pass the function decl to
1415 convert_arguments.
1416
1417 * typeck.c (comp_ptr_ttypes_real): New function. Implements the
1418 checking for which multi-level pointer conversions are allowed.
1419 (comp_target_types): Call it.
1420 (convert_for_assignment): Check const parity on the ultimate target
1421 type, too. And make those warnings pedwarns.
1422
1423Mon May 23 14:11:24 1994 Jason Merrill (jason@deneb.cygnus.com)
1424
1425 * error.c (dump_char): Use TARGET_* for character constants.
1426
1427Mon May 23 13:03:03 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
1428
1429 * tree.c (debug_no_list_hash): Make static.
1430
1431 * decl.c (decls_match): Say the types don't match if newdecl ends up
1432 with a null type, after we've checked if olddecl does.
1433 (pushdecl): Check if the decls themselves match before looking for
1434 an extern redeclared as static, to avoid inappropriate and incorrect
1435 warnings.
1436
1437Fri May 20 14:04:34 1994 Jason Merrill (jason@deneb.cygnus.com)
1438
1439 * decl.c (grokdeclarator): Make warning about duplicate short, etc.
1440 a pedwarn.
1441
1442 * typeck.c (build_c_cast): Casting to function or method type is an
1443 error.
1444
1445 * class.c (finish_struct): Make warning for anonymous class with no
1446 instances a pedwarn.
1447
1448 * Makefile.in (stamp-parse): Expect a s/r conflict.
1449
1450 * typeck.c (build_modify_expr): pedwarn about using a non-lvalue
1451 cast as an lvalue.
1452
2986ae00
MS
1453Thu May 19 12:08:48 1994 Jason Merrill (jason@deneb.cygnus.com)
1454
1455 * cvt.c (type_promotes_to): Make sure bool promotes to int rather
1456 than unsigned on platforms where sizeof(char)==sizeof(int).
1457
1458Wed May 18 14:27:06 1994 Jason Merrill (jason@deneb.cygnus.com)
1459
1460 * typeck.c (build_c_cast): Tack on a NOP_EXPR when casting to
1461 another variant.
1462 (build_modify_expr): Don't strip NOP_EXPRs, and don't get tricky
1463 and treat them as lvalues.
1464
1465 * decl.c (shadow_tag): Do complain about forward declarations of
1466 enums and empty declarations.
1467 * parse.y: Don't complain about forward declarations of enums and
1468 empty declarations.
1469
1470 * typeck.c (convert_for_assignment): Complain about changing
1471 the signedness of a pointer's target type.
1472
1473 * parse.y (stmt): Move duplicated code for checking case values from
1474 here.
1475 * decl2.c (check_cp_case_value): To here. And add a call to
1476 constant_expression_warning.
1477
1478 * typeck.c (convert_for_assignment): Don't complain about assigning
1479 a negative value to bool.
1480
1481 * decl.c (init_decl_processing): Make bool unsigned.
1482
1483 * class.c (finish_struct): Allow bool bitfields.
1484
2986ae00
MS
1485Wed May 18 12:35:27 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
1486
1487 * Make-lang.in (c++.install-man): Get g++.1 from $(srcdir)/cp.
1488
1489Wed May 18 03:28:35 1994 Jason Merrill (jason@deneb.cygnus.com)
1490
1491 * cvt.c (build_type_conversion): Lose special handling of
1492 truthvalues.
1493
1494 * search.c (dfs_pushdecls): Improve shadowing warning.
1495
1496Tue May 17 13:34:46 1994 Jason Merrill (jason@deneb.cygnus.com)
1497
1498 * init.c (build_delete): Throw away const and volatile on `this'.
1499
1500 * decl.c (finish_enum): Put the constants in TYPE_VALUES again,
1501 rather than the enumerators.
1502 (pushtag): s/cdecl/c_decl/g
1503
1504Mon May 16 23:04:01 1994 Stephen R. van den Berg (berg@pool.informatik.rwth-aachen.de)
1505
63718c49
GB
1506 * cp/typeck.c (common_type): Attribute merging.
1507 (comp_types): Utilise COMP_TYPE_ATTRIBUTES macro.
2986ae00 1508
63718c49 1509 * cp/parse.y: Revamp attribute parsing.
2986ae00
MS
1510
1511Mon May 16 01:40:34 1994 Jason Merrill (jason@deneb.cygnus.com)
1512
1513 * decl.c (shadow_tag): Also check for inappropriate use of auto and
1514 register.
1515
1516 * method.c (build_overload_name): Clarify that the illegal case is a
1517 pointer or reference to array of unknown bound.
1518
1519 * error.c (dump_type_prefix): Print references to arrays properly.
1520
1521 * typeck.c (various): Be more helpful in pointer
1522 comparison diagnostics.
1523
1524 * tree.c (lvalue_p): MODIFY_EXPRs are lvalues again. Isn't this
1525 fun?
1526
1527 * parse.y: Also catch an error after valid stmts.
1528
1529 * search.c (dfs_init_vbase_pointers): Don't abort because `this' is
1530 const.
1531
1532 * typeck.c (convert_for_initialization): If call to
1533 convert_to_reference generated a diagnostic, print out the parm
1534 number and function decl if any.
1535
1536 * errfn.c (cp_thing): Check atarg1 to determine whether or not we're
1537 specifying a line, not atarg.
1538
1539 * tree.c (build_cplus_method_type): Always make `this' const.
1540
1541 * decl2.c (grokclassfn): If -fthis-is-variable and this function is
1542 a constructor or destructor, make `this' non-const.
1543
1544 * typeck.c (build_modify_expr): Don't warn specially about
1545 assignment to `this' here anymore, since it will be caught by the
1546 usual machinery.
1547
1548 * various: Disallow specific GNU extensions (variable-size arrays,
1549 etc.) when flag_ansi is set, not necessarily when pedantic is set,
1550 so that people can compile with -pedantic-errors for tighter const
1551 checking and such without losing desirable extensions.
1552
1553 * typeck2.c (build_functional_cast): Call build_method_call with
1554 LOOKUP_PROTECT.
1555 (process_init_constructor): Only process FIELD_DECLs.
1556
1557 * decl.c (finish_decl): Also force static consts with no explicit
1558 initializer that need constructing into the data segment.
1559
1560 * init.c (build_delete): Undo last patch, as it interferes with
1561 automatic cleanups.
1562
1563Sat May 14 01:59:31 1994 Jason Merrill (jason@deneb.cygnus.com)
1564
1565 * call.c, class.h, cp-tree.h, cvt.c, decl2.c: Lose old overloading
1566 code.
1567
1568 * init.c (build_delete): pedwarn about using plain delete to delete
1569 an array.
1570
1571Fri May 13 16:45:07 1994 Jason Merrill (jason@deneb.cygnus.com)
1572
1573 * typeck.c (comp_target_types): Be more helpful in contravariance
1574 warnings, and make them pedwarns.
1575
1576 * decl.c (grokdeclarator): Use decl_context to decide whether or not
1577 this is an access declaration.
1578
1579 * class.c (finish_struct_bits): Set TYPE_HAS_INT_CONVERSION if it
1580 has a conversion to enum or bool, too.
1581
1582Fri May 13 16:31:27 1994 Mike Stump (mrs@cygnus.com)
1583
1584 * method.c (emit_thunk): Make declaration for
1585 current_call_is_indirect local (needed for hppa).
1586
1587Fri May 13 16:16:37 1994 Jason Merrill (jason@deneb.cygnus.com)
1588
1589 * pt.c (uses_template_parms): Grok BOOLEAN_TYPE.
1590 (tsubst): Ditto.
1591
1592Fri May 13 16:23:32 1994 Mike Stump (mrs@cygnus.com)
1593
1594 * pt.c (tsubst): If there is already a function for this expansion,
1595 use it.
1596 * pt.c (instantiate_template): Ditto.
1597
1598Fri May 13 10:30:42 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
1599
1600 * parse.y (implicitly_scoped_stmt, simple_stmt case): Use
1601 kept_level_p for MARK_ENDS argument to expand_end_bindings, to avoid
1602 generating debug info for unemitted symbols on some systems.
1603
1604 * cp-tree.h (build_static_cast, build_reinterpret_cast,
1605 build_const_cast): Add declarations.
1606
1607Fri May 13 09:50:31 1994 Mike Stump (mrs@cygnus.com)
1608
1609 * search.c (expand_indirect_vtbls_init): Fix breakage from Apr 27
1610 fix. We now try get_binfo, and if that doesn't find what we want,
1611 we go back to the old method, which still sometimes fails.
1612
1613Fri May 13 01:43:18 1994 Jason Merrill (jason@deneb.cygnus.com)
1614
1615 * parse.y (initdcl): Call cplus_decl_attributes on the right
1616 variable.
1617 * decl2.c (cplus_decl_attributes): Don't call decl_attributes for
1618 void_type_node.
1619
1620 * typeck.c (build_binary_op_nodefault): Change result_type for
1621 comparison ops to bool.
1622 (build_binary_op): Convert args of && and || to bool.
1623 * cvt.c (build_default_binary_type_conversion): Convert args of &&
1624 and || to bool.
1625 (build_default_unary_type_conversion): Convert arg of ! to bool.
1626 (type_promotes_to): bool promotes to int.
1627
1628Fri May 13 01:43:18 1994 Mike Stump (mrs@cygnus.com)
1629
1630 Implement the new builtin `bool' type.
1631 * typeck.c (build_binary_op_nodefault): Convert args of && and || to
1632 bool.
1633 (build_unary_op): Convert arg of ! to bool.
1634 * parse.y: Know true and false. Use bool_truthvalue_conversion.
1635 * method.c (build_overload_value): Know bool.
1636 (build_overload_name): Ditto.
1637 * lex.c (init_lex): Set up RID_BOOL.
1638 * gxx.gperf: Add bool, true, false.
1639 * error.c (*): Know bool.
1640 * decl.c (init_decl_processing): Set up bool, true, false.
1641 * cvt.c (cp_convert): Handle conversion to bool.
1642 (build_type_conversion): Ditto.
1643 * *.c: Accept bool where integers and enums are accepted (use
1644 INTEGRAL_CODE_P macro).
1645
8de7634e
RE
1646Thu May 12 19:13:54 1994 Richard Earnshaw (rwe11@cl.cam.ac.uk)
1647
1648 * g++.c: Use #ifdef for __MSDOS__, not #if.
1649
a4443a08
MS
1650Thu May 12 18:05:18 1994 Mike Stump (mrs@cygnus.com)
1651
1652 * decl2.c (lang_f_options): Handle -fshort-temps. -fshort-temps
1653 gives old behavior , and destroys temporaries earlier. Default
1654 behavior now conforms to the ANSI working paper.
1655
1656Thu May 12 14:45:35 1994 Jason Merrill (jason@deneb.cygnus.com)
1657
1658 * typeck.c (build_modify_expr): Understand MODIFY_EXPR as an lvalue.
1659 Use convert_force to convert the result of a recursive call when we
1660 are dealing with a NOP_EXPR. Don't automatically wrap MODIFY_EXPRs
1661 in COMPOUND_EXPRs any more.
1662 (various): Lose pedantic_lvalue_warning.
1663 (unary_complex_lvalue): Understand MODIFY_EXPR.
1664
1665 * cvt.c (convert_to_reference): Allow DECL to be error_mark_node if
1666 we don't know what we're initializing.
1667
1668Wed May 11 01:59:36 1994 Jason Merrill (jason@deneb.cygnus.com)
1669
1670 * cvt.c (convert_to_reference): Modify to use convtype parameter.
1671 Only create temporaries when initializing a reference, not when
1672 casting.
1673 (cp_convert): New main function.
1674 (convert): Call cp_convert.
1675 * cvt.c, decl.c, typeck.c: Fix calls to convert_to_reference.
1676 * cp-tree.h (CONV_*): New constants used by conversion code for
1677 selecting conversions to perform.
1678
1679 * tree.c (lvalue_p): MODIFY_EXPRs are no longer lvalues.
1680
1681 * typeck.c (build_{static,reinterpret,const_cast): Stubs that just
1682 call build_c_cast.
1683 * parse.y: Add {static,reinterpret,const}_cast.
1684 * gxx.gperf: Ditto.
1685
1686 * typeck.c (common_type): Allow methods with basetypes of different
1687 UPTs.
1688 (comptypes): Deal with UPTs.
1689 (build_modify_expr): Wrap all MODIFY_EXPRs in a COMPOUND_EXPR.
1690
1691 * pt.c (end_template_decl): Check for multiple definitions of member
1692 templates.
1693
1694 * call.c (build_method_call): Complain about calling an abstract
1695 virtual from a constructor.
1696
1697 * typeck.c (pointer_int_sum): Check for the integer operand being 0
1698 after checking the validity of the pointer operand.
1699
1700 * typeck2.c (digest_init): Pedwarn about string initializer being
1701 too long.
1702
1703Tue May 10 12:10:28 1994 Jason Merrill (jason@deneb.cygnus.com)
1704
1705 * decl.c (push_overloaded_decl): Only throw away a builtin if the
1706 decl in question is the artificial one.
1707
1708 * parse.y (simple_stmt, switch): Use implicitly_scoped_stmt because
1709 expand_{start,end}_case cannot happen in the middle of a block.
1710
1711 * cvt.c (build_type_conversion_1): Use convert again.
1712
1713Tue May 10 11:52:04 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
1714
1715 * typeck2.c (digest_init): Make sure we check for signed and
1716 unsigned chars as well when warning about string initializers.
1717
1718 * init.c (emit_base_init): Check if there's a DECL_NAME on the
1719 member before trying to do an initialization for it.
1720
1721Tue May 10 11:34:37 1994 Mike Stump (mrs@cygnus.com)
1722
1723 * except.c: Don't do anything useful when cross compiling.
1724
1725Tue May 10 03:04:13 1994 Jason Merrill (jason@deneb.cygnus.com)
1726
1727 * decl.c (duplicate_decls): Fix up handling of builtins yet again.
1728 (push_overloaded_decl): Ditto.
1729
1730 * cvt.c (convert): Don't look for void type conversion.
1731
1732Mon May 9 18:05:41 1994 Jason Merrill (jason@deneb.cygnus.com)
1733
1734 * init.c (do_friend): Only do a pushdecl for friends, not
1735 pushdecl_top_level.
1736
1737Mon May 9 13:36:34 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
1738
1739 * decl.c (lookup_name_current_level): Put empty statement after
1740 the label OUT to make the code valid C.
1741
1742Mon May 9 12:20:57 1994 Jason Merrill (jason@deneb.cygnus.com)
1743
1744 * typeck.c (build_binary_op_nodefault): Only complain about
1745 comparing void * and a function pointer if void * is smaller.
1746
1747Sun May 8 01:29:13 1994 Jason Merrill (jason@deneb.cygnus.com)
1748
1749 * decl.c (lookup_name_current_level): Move through temporary binding
1750 levels.
1751
1752 * parse.y (already_scoped_stmt): Revive.
1753 (simple_stmt): Use it again.
1754
1755 * decl.c (poplevel): Always call poplevel recursively if we're
1756 dealing with a temporary binding level.
1757
1758Sat May 7 10:52:28 1994 Mike Stump (mrs@cygnus.com)
1759
1760 * decl.c (finish_decl): Make sure we run cleanups for initial values
1761 of decls. Cures memory leak.
1762 * decl.c (expand_static_init): Ditto for static variables.
1763 * decl2.c (finish_file): Ditto for globals.
1764
1765Sat May 7 03:57:44 1994 Jason Merrill (jason@deneb.cygnus.com)
1766
1767 * typeck.c (commonparms): Don't complain about redefining default
1768 args.
1769
1770 * decl.c (duplicate_decls): Don't complain twice about conflicting
1771 function decls.
1772 (decls_match): Don't look at default args.
1773 (redeclaration_error_message): Complain about redefining default
1774 args.
1775
1776 * call.c (build_overload_call_real): Also deal with guiding
1777 declarations coming BEFORE the template decl.
1778
1779 * pt.c (unify): Allow different parms to have different
1780 cv-qualifiers.
1781 (unify): Allow trivial conversions on non-template parms.
1782
1783Fri May 6 03:53:23 1994 Jason Merrill (jason@deneb.cygnus.com)
1784
1785 * pt.c (tsubst): Support OFFSET_TYPEs.
1786 (unify): Ditto.
1787
1788 * decl2.c (finish_decl_parsing): Call push_nested_class with a type.
1789
1790 * init.c (build_offset_ref): Fix error message.
1791 * search.c (lookup_field): Ditto.
1792
1793 * call.c (build_scoped_method_call): Pass binfo to
1794 build_method_call.
1795 * typeck.c (build_object_ref): Ditto.
1796
1797 * typeck2.c (binfo_or_else): Don't return a _TYPE.
1798
1799 * class.c (finish_struct): Don't complain about re-use of inherited
1800 names or shadowing of type decls.
1801 * decl.c (pushdecl_class_level): Ditto.
1802
1803 * decl.c (finish_enum): Set the type of all the enums.
1804
1805 * class.c (finish_struct): Don't get confused by access decls.
1806
1807 * cp-tree.h (TYPE_MAIN_DECL): New macro to get the _DECL for a
1808 _TYPE. You can stop using TYPE_NAME for that now.
1809
1810 * parse.y: Lose doing_explicit (check $0 instead).
1811 * gxx.gperf: 'template' now has a RID.
1812 * lex.h (rid): Ditto.
1813 * lex.c (init_lex): Set up the RID for 'template'.
1814
1815 * parse.y (type_specifier_seq): typed_typespecs or
1816 nonempty_type_quals. Use it.
1817 (handler_args): Fix bogus syntax.
1818 (raise_identifier{,s}, optional_identifier): Lose.
1819 * except.c (expand_start_catch_block): Use grokdeclarator to parse
1820 the catch variable.
1821 (init_exception_processing): The second argument to
1822 __throw_type_match is ptr_type_node.
1823
1824 Fri May 6 07:18:54 1994 Chip Salzenberg (chip@fin)
1825
1826 [ change propagated from c-decl.c of snapshot 940429 ]
1827 * cp/decl.c (finish_decl): Setting asmspec_tree should not
1828 zero out the old RTL.
1829
8d2733ca
MS
1830Fri May 6 01:25:38 1994 Mike Stump (mrs@cygnus.com)
1831
1832 Add alpha exception handling support to the compiler.
1833 Quick and dirty backend in except.c.
1834
1835 * cp/*: Remove most remnants of old exception handling support.
1836 * decl.c (finish_function): Call expand_exception_blocks to put
1837 the exception hanlding blocks at the end of the function.
1838 * dec.c (hack_incomplete_structures): Make sure expand_decl_cleanup
1839 comes after expand_decl_init.
1840 * except.c: Reimplementation.
1841 * expr.c (cplus_expand_expr): Handle THROW_EXPRs.
1842 * lex.c (init_lex): Always have catch, try and throw be reserved
1843 words, so that we may always parse exception handling.
1844 * parse.y: Cleanup to support new interface into exception handling.
1845 * tree.def (THROW_EXPR): Add.
1846
1847Thu May 5 17:35:37 1994 Jason Merrill (jason@deneb.cygnus.com)
1848
1849 * parse.y (simple_stmt, for loops): Use implicitly_scoped_stmt.
1850 (various): Lose .kindof_pushlevel and partially_scoped_stmt.
1851
1852Thu May 5 16:17:27 1994 Kung Hsu (kung@mexican.cygnus.com)
1853
1854 * parse.y (already_scoped_stmt): move expand_end_binding() to
1855 fix the unmatched LBB/LBE in stabs.
1856
1857Thu May 5 14:36:17 1994 Jason Merrill (jason@deneb.cygnus.com)
1858
1859 * decl.c (set_nested_typename): Set TREE_MANGLED on the new
1860 identifiers.
1861 (pushdecl): Check TREE_MANGLED.
1862 (xref_tag): Ditto.
1863 * cp-tree.h (TREE_MANGLED): This identifier is a
1864 DECL_NESTED_TYPENAME (named to allow for future use to denote
1865 mangled function names as well).
1866
1867 Implement inconsistency checking specified in [class.scope0].
1868 * decl.c (lookup_name_real): Don't set ICV here after all.
1869 (finish_enum): Also set the type of the enumerators themselves.
1870 (build_enumerator): Put the CONST_DECL in the list instead of its
1871 initial value.
1872 (pushdecl_class_level): Check inconsistent use of a name in the
1873 class body.
1874 * class.c (finish_struct): Check inconsistent use of a name in the
1875 class body. Don't set DECL_CONTEXT on types here anymore.
1876 * parse.y (qualified_type_name): Note that the identifier has now
1877 been used (as a type) in the class body.
1878 * lex.c (do_identifier): Note that the identifier has now been used
1879 (as a constant) in the class body.
1880 * error.c (dump_decl): Print type and enum decls better.
1881
700f8a87
MS
1882Thu May 5 09:35:35 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
1883
1884 * typeck.c (build_modify_expr): Warn about assignment to `this'.
1885
1886Wed May 4 15:55:49 1994 Jason Merrill (jason@deneb.cygnus.com)
1887
1888 * init.c (build_delete): Use the global operator delete when
1889 requested.
1890
1891 * decl.c (lookup_name_real): If we find the type we're looking in a
1892 base class while defining a class, set IDENTIFIER_CLASS_VALUE for
1893 the type.
1894
1895 * class.c (finish_struct): Remove a couple of dependencies on
1896 language linkage.
1897
1898 * decl.c (pushtag): Classes do nest in extern "C" blocks.
1899 (pushdecl): Only set DECL_NESTED_TYPENAME on the canonical one for
1900 the type.
1901 (pushtag): Remove another dependency on the language linkage.
1902
1903 * lex.c (cons_up_default_function): Don't set DECL_CLASS_CONTEXT to
1904 a const-qualified type.
1905
1906 * decl.c (push_overloaded_decl): Throw away built-in decls here.
1907 (duplicate_decls): Instead of here.
1908
1909Wed May 4 15:27:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
1910
1911 * typeck.c (get_member_function_from_ptrfunc): Do The Right
1912 Thing (I hope) if we're using thunks.
1913
1914Wed May 4 13:52:38 1994 Jason Merrill (jason@deneb.cygnus.com)
1915
1916 * parse.y (specialization): aggr template_type_name ';'.
1917 (named_class_head_sans_basetype): Use it.
1918 (explicit_instantiation): Ditto.
1919 (tmpl.2): Revert.
1920
1921 * cvt.c (build_type_conversion_1): Use convert_for_initialization,
1922 rather than convert, to do conversions after the UDC.
1923
1924 * cp-tree.h (SHARED_MEMBER_P): This member is shared between all
1925 instances of the class.
1926
1927 * search.c (lookup_field): If the entity found by two routes is the
1928 same, it's not ambiguous.
1929
1930Wed May 4 12:10:00 1994 Per Bothner (bothner@kalessin.cygnus.com)
1931
1932 * decl.c (lookup_name_real): Check for a NULL TREE_VALUE,
1933 to prevent the compiler from crashing ...
1934
1935Wed May 4 11:19:45 1994 Jason Merrill (jason@deneb.cygnus.com)
1936
1937 * call.c (build_method_call): If we don't have an object, check
1938 basetype_path to figure out where to look up the function.
1939
1940 * typeck.c (convert_for_initialization): Pass TYPE_BINFO (type) to
1941 build_method_call in case exp is NULL_TREE.
1942
1943Tue May 3 16:02:53 1994 Per Bothner (bothner@kalessin.cygnus.com)
1944
1945 Give a vtable entries a unique named type, for the sake of gdb.
1946 * class.c (build_vtable_entry): The addres of a thunk now has
1947 type vtable_entry_type, not ptr_type_node.
1948 * method.c (make_thunk): Fix type of THUNK_DECL.
1949 * class.c (add_virtual_function, override_one_vtable): Use
1950 vfunc_ptr_type_node, instead of ptr_type_node.
1951 * cp-tree.h (vfunc_ptr_type_node): New macro.
1952 * decl.c (init_decl_processing): Make vtable_entry_type
1953 be a unique type of pointer to a unique function type.
1954
1955Tue May 3 09:20:44 1994 Jason Merrill (jason@deneb.cygnus.com)
1956
1957 * parse.y (do_explicit): Sets doing_explicit to 1.
1958 (explicit_instantiation): Use do_explicit rather than TEMPLATE
1959 directly, add "do_explicit error" rule.
1960 (datadef): Set doing_explicit to 0 after an explicit instantiation.
1961 (tmpl.2): Don't instantiate if we see a ';' unless we're doing an
1962 explicit instantiation.
1963 (named_class_head_sans_basetype): Remove aggr template_type_name
1964 ';' again.
1965
1966Mon May 2 23:17:21 1994 Jason Merrill (jason@deneb.cygnus.com)
1967
1968 * search.c (lookup_nested_tag): Lose.
1969
1970 * decl2.c (grokfield): Set DECL_CONTEXT on TYPE_DECLs.
1971 (lookup_name_nonclass): Lose.
1972
1973 * decl.c (poplevel_class): Add force parameter.
1974 (lookup_name_real): Fix handling of explicit scoping which specifies
1975 a class currently being defined. Add 'nonclass' argument.
1976 (lookup_name, lookup_name_nonclass): Shells for lookup_name_real.
1977
1978 * class.c (finish_struct): Don't unset IDENTIFIER_CLASS_VALUEs here.
1979 (popclass): Force clearing of IDENTIFIER_CLASS_VALUEs if we're being
1980 called from finish_struct.
1981
1982Mon May 2 19:06:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
1983
1984 * decl.c (init_decl_processing), cp-tree.h: Removed memptr_type.
1985 (It seeems redundant, given build_ptrmemfunc_type.)
1986 * typeck.c (get_member_function_from_ptrfunc), gc.c (build_headof,
1987 build_classof): Use vtable_entry_type instead of memptr_type.
1988 * method.c (emit_thunk): Call poplevel with functionbody==0
1989 to prevent DECL_INITIAL being set to a BLOCK.
1990
1991Mon May 2 15:02:11 1994 Jason Merrill (jason@deneb.cygnus.com)
1992
1993 * parse.y (named_class_head_sans_basetype): Add "aggr
1994 template_type_name ';'" rule for forward declaration of
1995 specializations.
1996
1997Mon May 2 15:02:11 1994 Jason Merrill (jason@deneb.cygnus.com)
1998
1999 * class.c (instantiate_type): Deal with pmf's.
bfef964b
JM
2000
2001 * Make-lang.in (cc1plus): Don't depend on OBJS or BC_OBJS, since
2002 stamp-objlist does.
700f8a87 2003
bfef964b
JM
2004 * Makefile.in (../cc1plus): Depend on OBJDEPS.
2005 (OBJDEPS): Dependency version of OBJS.
2006
700f8a87
MS
2007Mon May 2 12:51:31 1994 Kung Hsu (kung@mexican.cygnus.com)
2008
2009 * search.c (dfs_debug_mark): unmark TYPE_DECL_SUPPRESS_DEBUG, not
2010 DECL_IGNORED_P.
2011
2012Fri Apr 29 12:29:56 1994 Jason Merrill (jason@deneb.cygnus.com)
2013
2014 * class.c (finish_struct): Clear out memory of local tags. And
2015 typedefs.
2016
2017 * decl2.c (grokclassfn): Don't set DECL_CONTEXT to a cv-qualified
2018 type.
2019 * search.c (get_matching_virtual): Be more helpful in error message.
2020
2021 * *: Use DECL_ARTIFICIAL (renamed from DECL_SYNTHESIZED).
2022
2023 * lex.c (default_assign_ref_body): Expect TYPE_NESTED_NAME to work.
2024 (default_copy_constructor_body): Ditto.
2025
2026 * class.c (finish_struct): Don't gratuitously create multiple decls
2027 for nested classes.
2028
2029Thu Apr 28 23:39:38 1994 Jason Merrill (jason@deneb.cygnus.com)
2030
2031 Avoid clobbering the arg types of other functions when reverting
2032 static member functions.
2033 * decl.c (revert_static_member_fn): Rearrange arguments, don't
2034 require values for 'fn' and 'argtypes', add warning to comment
2035 above.
2036 (decls_match): Rearrange arguments in call to rsmf.
2037 (grok_op_properties): Don't pass values for fn and argtypes.
2038 * pt.c (instantiate_template): Don't pass values for fn and argtypes.
2039
15fa00e9
DE
2040Thu Apr 28 16:29:11 1994 Doug Evans (dje@canuck.cygnus.com)
2041
2042 * Make-lang.in (cc1plus): Depend on stamp-objlist.
2043 * Makefile.in (BC_OBJS): Delete.
700f8a87
MS
2044 (OBJS): Cat ../stamp-objlist to get language independent files.
2045 Include ../c-common.o.
15fa00e9
DE
2046 (../cc1plus): Delete reference to BC_OBJS.
2047
700f8a87
MS
2048Thu Apr 28 02:12:08 1994 Jason Merrill (jason@deneb.cygnus.com)
2049
2050 * search.c (compute_access): No really, deal with static members
2051 properly. Would I lie to you?
2052
2053 Implement lexical hiding of function declarations.
2054 * pt.c (tsubst): Use lookup_name to look for function decls to guide
2055 instantiation.
2056 * method.c (build_opfncall): Use lookup_name_nonclass to look for
2057 non-member functions.
2058 * init.c (do_friend): Use lookup_name_nonclass to look for
2059 functions.
2060 * error.c (ident_fndecl): Use lookup_name to look for functions.
2061 * decl2.c (lookup_name_nonclass): New function, skips over
2062 CLASS_VALUE.
2063 * decl.c (struct binding_level): Lose overloads_shadowed field.
2064 (poplevel): Don't deal with overloads_shadowed.
2065 (push_overloaded_decl): Do lexical hiding for functions.
2066 * class.c (instantiate_type): Don't check non-members if we have
2067 members with the same name.
2068 * call.c (build_method_call): Use lookup_name_nonclass instead of
2069 IDENTIFIER_GLOBAL_VALUE to check for non-member functions.
2070 (build_overload_call_real): Ditto.
2071
2072 * decl.c (duplicate_decls): Check for ambiguous overloads here.
2073 (push_overloaded_decl): Instead of here.
2074
2075 * decl.c (pushdecl): Back out Chip's last change.
2076
2077 * decl.c (grok_op_properties): operators cannot be static members.
2078
2079 * cp-tree.h (DECL_SYNTHESIZED): DECL_SOURCE_LINE == 0
2080 (SET_DECL_SYNTHESIZED): DECL_SOURCE_LINE = 0
2081 * lex.c (cons_up_default_function): Use SET_DECL_SYNTHESIZED.
2082
2083 * method.c (do_inline_function_hair): Don't put friends of local
2084 classes into global scope, either.
2085
2086 * typeck2.c (build_functional_cast): Don't look for a function call
2087 interpretation.
2088
39211cd5
MS
2089Thu Apr 28 15:19:46 1994 Mike Stump (mrs@cygnus.com)
2090
2091 * cp-tree.h: disable use of backend EH.
2092
15fa00e9
DE
2093Wed Apr 27 21:01:24 1994 Doug Evans (dje@canuck.cygnus.com)
2094
2095 * Make-lang.in (c++.distdir): mkdir tmp/cp first.
2096 * Makefile.in (INCLUDES): Move definition to same place as
2097 parent makefile.
2098 (ALLOCA): Define.
2099 (OLDAR_FLAGS): Delete.
2100 (OLDCC): Define.
2101 (DIR): Delete.
2102 (CLIB): Define.
2103 (####site): Delete.
2104 (SUBDIR_USE_ALLOCA): Don't use ALLOCA if compiling with gcc.
2105
39211cd5
MS
2106Wed Apr 27 19:10:04 1994 Kung Hsu (kung@mexican.cygnus.com)
2107
2108 * decl.c (xref_tag): not to use strstr(), it's not available on
2109 all platforms.
2110
2111Wed Apr 27 18:10:12 1994 Jason Merrill (jason@deneb.cygnus.com)
2112
2113 * class.c (finish_struct): Resolve yet another class/pmf confusion.
2114
2115 * call.c (build_overload_call_real): Don't take the single-function
2116 shortcut if we're dealing with an overloaded operator.
2117
2118Wed Apr 27 17:35:37 1994 Mike Stump (mrs@cygnus.com)
2119
2120 * search.c (get_base_distance): Search the virtual base class
2121 binfos, incase someone wants to convert to a real virtual base
2122 class.
2123 * search.c (expand_indirect_vtbls_init): Use convert_pointer_to_real
2124 instead of convert_pointer_to, as it now will work.
2125
2126Wed Apr 27 15:36:49 1994 Jason Merrill (jason@deneb.cygnus.com)
2127
2128 * cvt.c (convert_to_reference): Don't complain about casting away
2129 const and volatile.
2130
2131 * typeck.c (build_unary_op): References are too lvalues.
2132
2133Wed Apr 27 13:58:05 1994 Mike Stump (mrs@cygnus.com)
2134
2135 * class.c (override_one_vtable): We have to prepare_fresh_vtable
2136 before we modify it, not after, also, we cannot reuse an old vtable,
2137 once we commit to a new vtable. Implement ambiguous overrides in
2138 virtual bases as abstract. Hack until we make the class
2139 ill-formed.
2140
2141Wed Apr 27 01:17:08 1994 Jason Merrill (jason@deneb.cygnus.com)
2142
2143 * parse.y (unary_expr): Expand new_placement[opt] and
2144 new_initializer[opt] inline.
2145
2146 * search.c (lookup_fnfields): Don't throw away the inheritance
2147 information here, either.
2148 (compute_access): Handle static members properly.
2149
2150 * init.c (build_member_call): Always set basetype_path, and pass it
2151 to lookup_fnfields.
2152
2153 * search.c (lookup_field): Deal properly with the case where
2154 xbasetype is a chain of binfos; don't throw away the inheritance
2155 information.
2156 (compute_access): protected_ok always starts out at 0.
2157
2158 * init.c (resolve_offset_ref): Don't cast `this' to the base type
2159 until we've got our basetype_path.
2160
2161 * cp-tree.h (IS_OVERLOAD_TYPE): aggregate or enum.
2162
2163 * cvt.c (build_up_reference): Use build_pointer_type rather than
2164 TYPE_POINTER_TO.
2165
2166 * call.c (convert_harshness_ansi): Call type_promotes_to for reals
2167 as well.
2168
2169 * cvt.c (type_promotes_to): Retain const and volatile, add
2170 float->double promotion.
2171
2172 * decl.c (grokdeclarator): Don't bash references to arrays into
2173 references to pointers in function parms. Use type_promotes_to.
2174
2175Tue Apr 26 23:44:36 1994 Mike Stump (mrs@cygnus.com)
2176
2177 Finish off Apr 19th work.
2178
2179 * class.c (finish_struct_bits): Rename has_abstract_virtuals to
2180 might_have_abstract_virtuals.
2181 * class.c (strictly_overrides, override_one_vtable,
2182 merge_overrides): New routines to handle virtual base overrides.
2183 * class.c (finish_struct): Call merge_overrides to handle overrides
2184 in virtual bases.
2185
2186Tue Apr 26 12:45:53 1994 Jason Merrill (jason@deneb.cygnus.com)
2187
2188 * typeck.c (build_function_call): Call build_function_call_real with
2189 LOOKUP_NORMAL.
2190
2191 * *: Don't deal with TYPE_EXPRs.
2192
2193 * tree.c (lvalue_p): If the type of the expression is a reference,
2194 it's an lvalue.
2195
2196 * cvt.c (convert_to_reference): Complain about passing const
2197 lvalues to non-const references.
2198 (convert_from_reference): Don't arbitrarily throw away const and
2199 volatile on the target type.
2200
2201 * parse.y: Simplify and fix rules for `new'.
2202
2203 * decl.c (grok_op_properties): operator void is illegal.
2204
2205Mon Apr 25 02:36:28 1994 Jason Merrill (jason@deneb.cygnus.com)
2206
2207 * parse.y (components): Anonymous bitfields can still have declspecs.
2208
2209 * decl.c (pushdecl): Postpone handling of function templates like we
2210 do C functions.
2211
2212 * search.c (expand_indirect_vtbls_init): Fix infinite loop when
2213 convert_pointer_to fails.
2214
2215 * call.c (compute_conversion_costs_ansi): A user-defined conversion
2216 by itself is better than that UDC followed by standard conversions.
2217 Don't treat integers and reals specially.
2218
2219 * cp-tree.h: Declare flag_ansi.
2220
2221 * typeck.c (c_expand_return): pedwarn on return in void function
2222 even if the expression is of type void.
2223 (build_c_cast): Don't do as much checking for casts to void.
2224 (build_modify_expr): pedwarn about array assignment if this code
2225 wasn't generated by the compiler.
2226
2227 * tree.c (lvalue_p): A comma expression is an lvalue if its second
2228 operand is.
2229
2230 * typeck.c (default_conversion): Move code for promoting enums and
2231 ints from here.
2232 * cvt.c (type_promotes_to): To here.
2233 * call.c (convert_harshness_ansi): Use type_promotes_to. Also fix
2234 promotion semantics for reals.
2235
15fa00e9
DE
2236Sun Apr 24 16:52:51 1994 Doug Evans (dje@canuck.cygnus.com)
2237
2238 * Make-lang.in (c++.install-common): Check for g++-cross.
2239 * Makefile.in: Remove Cygnus cruft.
2240 (config.status): Delete.
2241 (RTL_H): Define.
2242 (TREE_H): Use complete pathname, some native makes have minimal
2243 VPATH support.
2244 (*.o): Use complete pathname to headers in parent dir.
2245 (doc, info, dvi): Delete.
2246
700f8a87
MS
2247Sun Apr 24 16:52:51 1994 Doug Evans (dje@canuck.cygnus.com)
2248
2249 * Make-lang.in (c++.install-common): Check for g++-cross.
2250 * Makefile.in: Remove Cygnus cruft.
2251 (config.status): Delete.
2252 (RTL_H): Define.
2253 (TREE_H): Use complete pathname, some native makes have minimal
2254 VPATH support.
2255 (*.o): Use complete pathname to headers in parent dir.
2256 (doc, info, dvi): Delete.
2257
39211cd5
MS
2258Sun Apr 24 00:47:49 1994 Jason Merrill (jason@deneb.cygnus.com)
2259
2260 * decl.c (pushdecl): Avoid redundant warning on redeclaring function
2261 with different return type.
2262 (decls_match): Compare return types strictly.
2263
2264Fri Apr 22 12:55:42 1994 Jason Merrill (jason@deneb.cygnus.com)
2265
2266 * cvt.c (build_type_conversion): Do try to convert through other
2267 pointers. This will fail if the class defines multiple pointer
2268 conversions.
2269
2270 * error.c (dump_type_prefix): Print out pointers to arrays properly.
2271 (dump_type_suffix): Ditto. (was 'int *[]', now 'int (*)[]')
2272
2273 * typeck.c (build_unary_op): Disallow ++/-- on pointers to
2274 incomplete type.
2275
2276 * decl.c (duplicate_decls): Check mismatched TREE_CODES after
2277 checking for shadowing a builtin. If we're redeclaring a builtin
2278 function, bash the old decl to avoid an ambiguous overload.
2279
2280 * cvt.c (convert_to_reference): Don't force arrays to decay here.
2281
2282 * tree.c (lvalue_p): A MODIFY_EXPR is an lvalue.
2283
2284 * decl.c (duplicate_decls): Don't assume that the decls will have
2285 types.
2286
2287 Mon Apr 18 11:35:32 1994 Chip Salzenberg (chip@fin.uucp)
2288
2289 [ cp/* changes propagated from c-* changes in 940318 snapshot ]
2290 * c-decl.c (pushdecl): Warn if type mismatch with another external decl
2291 in a global scope.
2292
2293 Fri Apr 22 06:38:56 1994 Chip Salzenberg (chip@fin.uucp)
2294
2295 * cp/typeck2.c (signature_error): Use cp_error for "%T".
2296
2297 Mon Apr 18 11:59:59 1994 Chip Salzenberg (chip@fin.uucp)
2298
2299 [ cp/* changes propagated from c-* changes in 940415 snapshot ]
2300 * cp/decl.c (duplicate_decls, pushdecl, builtin_function):
2301 Use DECL_FUNCTION_CODE instead of DECL_SET_FUNCTION_CODE.
2302
2303 Mon Apr 18 11:55:18 1994 Chip Salzenberg (chip@fin.uucp)
2304
2305 [ cp/* changes propagated from c-* changes in 940409 snapshot ]
2306 * cp/decl.c (duplicate_decls): Put new type in same obstack as
2307 old ones, or permanent if old ones in different obstacks.
2308
2309 Mon Apr 18 11:48:49 1994 Chip Salzenberg (chip@fin.uucp)
2310
2311 [ cp/* changes propagated from c-* changes in 940401 snapshot ]
2312 * cp/parse.y (attrib): Handle string args as expressions,
2313 merging the two rules. `mode' attribute now takes a string arg.
2314 Delete the rule for an identifier as arg.
2315
2316 Mon Apr 18 11:24:00 1994 Chip Salzenberg (chip@fin.uucp)
2317
2318 [ cp/* changes propagated from c-* changes in 940312 snapshot ]
2319 * cp/typeck.c (pointer_int_sum): Multiplication should be done signed.
2320 (pointer_diff): Likewise the division.
2321
2322 Sun Mar 6 19:43:39 1994 Chip Salzenberg (chip@fin.uucp)
2323
2324 [ cp/* changes propagated from c-* changes in 940304 snapshot ]
2325 * cp/decl.c (finish_decl): Issue warning for large objects,
2326 if requested.
2327
2328 Sat Feb 19 22:20:32 1994 Chip Salzenberg (chip@fin.uucp)
2329
2330 [ cp/* changes propagated from c-* changes in 940218 snapshot ]
2331 * cp/parse.y (attrib): Handle attribute ((section ("string"))).
2332 * cp/decl.c (duplicate_decls): Merge section name into new decl.
2333
2334 Tue Feb 8 09:49:17 1994 Chip Salzenberg (chip@fin.uucp)
2335
2336 [ cp/* changes propagated from c-* changes in 940206 snapshot ]
2337 * cp/typeck.c (signed_or_unsigned_type): Check for any
63718c49 2338 INTEGRAL_TYPE_P not just INTEGER_TYPE.
39211cd5
MS
2339
2340 Mon Dec 6 13:35:31 1993 Norbert Kiesel (norbert@i3.INformatik.rwth-aachen.DE)
2341
2342 * cp/decl.c (finish_enum): Start from 0 when determining precision
2343 for short enums.
2344
2345 Fri Dec 3 17:07:58 1993 Ralph Campbell (ralphc@pyramid.COM)
2346
2347 * cp/parse.y (unary_expr): Look at $1 for tree_code rather than
2348 casting $$.
2349
2350 Wed Nov 17 19:22:09 1993 Chip Salzenberg (chip@fin.uucp)
2351
2352 * cp/typeck.c (build_binary_op_nodefault): Propagate code
2353 from C front-end to optimize unsigned short division.
2354 (build_conditional_expr): Fix bug in "1 ? 42 : (void *) 8".
2355
2356 Wed Nov 17 19:17:18 1993 Chip Salzenberg (chip@fin.uucp)
2357
2358 * cp/call.c (convert_harshness_ansi): Given an (e.g.) char
2359 constant, prefer 'const char &' to 'int'.
2360
2361 Wed Feb 3 13:11:48 1993 Chip Salzenberg (chip@fin.uucp)
2362
2363 * cp/class.c (finish_struct_methods): Handle multiple
2364 constructors in fn_fields list.
2365
2366Fri Apr 22 12:48:10 1994 Kung Hsu (kung@mexican.cygnus.com)
2367
2368 * class.c (finish_struct): use TYPE_DECL_SUPPRESS_DEBUG to flag
2369 types not to be dumped in stabs, like types in #pragma interface.
2370 * decl.c (init_decl_processing): use TYPE_DECL_SUPPRESS_DEBUG to
2371 mark unknown type.
2372
15fa00e9
DE
2373Fri Apr 22 03:27:26 1994 Doug Evans (dje@cygnus.com)
2374
2375 * Language directory reorganization.
2376 See parent makefile.
2377
700f8a87
MS
2378Fri Apr 22 03:27:26 1994 Doug Evans (dje@cygnus.com)
2379
2380 * Language directory reorganization.
2381 See parent makefile.
2382
39211cd5
MS
2383Thu Apr 21 18:27:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
2384
2385 * cp-tree.h (THUNK_DELTA): It is normally negative, so
2386 use signed .i variant of frame_size rather than unsigned .u.
2387 * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks,
2388 use "VT" rather than "vt" due to binary incompatibility.
2389 * class.c (get_vtable_name): Use strlen of VTABLE_NAME_FORMAT,
2390 rather than sizeof, since it is now an expression.
2391 * class.c (modify_one_vtable): Modify to skip initial element
2392 containing a count of the vtable.
2393
7177d104
MS
2394Thu Apr 21 00:09:02 1994 Jason Merrill (jason@deneb.cygnus.com)
2395
2396 * lex.c (check_newline): Force interface_unknown on main input file.
2397
2398 * pt.c (do_pending_expansions): Always emit functions that have been
2399 explicitly instantiated.
2400 (do_function_instantiation): Set DECL_EXPLICITLY_INSTANTIATED.
2401 (do_type_instantiation): Set CLASSTYPE_VTABLE_NEEDS_WRITING and
2402 DECL_EXPLICITLY_INSTANTIATED on all my methods.
2403 * parse.y (explicit_instantiation): Call do_type_instantiation for
2404 types.
2405 * decl2.c (finish_vtable_vardecl): Call import_export_vtable.
2406 * decl.c (start_function): Don't set DECL_EXTERNAL on a function
2407 that has been explicitly instantiated.
2408 * cp-tree.h (DECL_EXPLICITLY_INSTANTIATED): Alias for
2409 DECL_LANG_FLAG_4.
2410 * class.c: Move import_export_vtable to decl2.c, and comment out all
2411 uses.
2412
2413Wed Apr 20 16:51:06 1994 Jason Merrill (jason@deneb.cygnus.com)
2414
2415 * lex.c (process_next_inline): Don't muck with DECL_INLINE.
2416 (do_pending_inlines): Ditto.
2417
2418Tue Apr 19 22:25:41 1994 Mike Stump (mrs@cygnus.com)
2419
2420 Reimplement vtable building, and most vtable pointer setting.
2421 Allows for earier maintenance, easier understandability, and most
2422 importantly, correct semantics.
2423
2424 * class.c (build_vtable): Removed unneeded
2425 SET_BINFO_VTABLE_PATH_MARKED.
2426 * class.c (prepare_fresh_vtable): Ditto. Added argument.
2427 * class.c (modify_vtable_entry): General cleanup.
2428 * class.c (related_vslot, is_normal, modify_other_vtable_entries,
2429 modify_vtable_entries): Removed.
2430 * class.c (add_virtual_function): General cleanup.
2431 * class.c (finish_base_struct): Setup BINFO_VTABLE and
2432 BINFO_VIRTUALS as early as we can, so that modify_all_vtables can
2433 work.
2434 * class.c (finish_vtbls): New routine, mostly from
2435 unmark_finished_struct.
2436 * class.c (overrides): New routine.
2437 * class.c (modify_one_vtable): New routine, mostly from
2438 modify_other_vtable_entries and modify_vtable_entries.
2439 * class.c (modify_all_direct_vtables, modify_all_indirect_vtables,
2440 modify_all_vtables): New routines.
2441 * class.c (finish_struct): Added arguemnt to prepare_fresh_vtable
2442 call. General cleanup on how pending_hard_virtuals are handled.
2443 General cleanup on modifying vtables. Use finish_vtbls, instead of
2444 unmark_finished_struct.
2445 * cp-tree.h (init_vtbl_ptrs, expand_direct_vtbls_init,
2446 get_first_matching_virtual, get_matching_virtual,
2447 expand_vbase_vtables_init, expand_indirect_vtbls_init): Update.
2448 * cvt.c (convert_pointer_to_real): cleanup error message.
2449 * decl.c (grokfndecl): General cleanup.
2450 * decl.c (finish_function): Change init_vtbl_ptrs call to
2451 expand_direct_vtbls_init. Change expand_vbase_vtables_init call to
2452 expand_indirect_vtbls_init.
2453 * init.c (expand_virtual_init): Remove unneeded argument.
2454 * init.c (init_vtbl_ptrs): Rename to expand_direct_vtbls_init, added
2455 two arguments to make more general. Made more general. Now can be
2456 used for vtable pointer initialization from virtual bases.
2457 * init.c (emit_base_init): Change expand_vbase_vtables_init call to
2458 expand_indirect_vtbls_init. Change init_vtbl_ptrs call to
2459 expand_direct_vtbls_init.
2460 * init.c (expand_virtual_init): General cleanup.
2461 * init.c (expand_default_init): Change expand_vbase_vtables_init
2462 call to expand_indirect_vtbls_init.
2463 * init.c (expand_recursive_init_1): Change expand_vbase_vtables_init
2464 call to expand_indirect_vtbls_init.
2465 * init.c (expand_recursive_init): Change expand_vbase_vtables_init
2466 call to expand_indirect_vtbls_init.
2467 * search.c (get_first_matching_virtual): Rename to
2468 get_matching_virtual. General cleanup and remove setting of
2469 DECL_CONTEXT. That is now done in a cleaner way in
2470 modify_vtable_entry and add_virtual_function.
2471 * search.c (expand_vbase_vtables_init): Rename to
2472 expand_indirect_vtbls_init. General cleanup. Use
2473 expand_direct_vtbls_init to do hard work. Ensures that _all_ vtable
2474 pointers from virtual bases are set up.
2475 * search.c (bfs_unmark_finished_struct, unmark_finished_struct):
2476 Removed.
2477
2478 * *.[chy]: Remove support for VTABLE_USES_MASK.
2479
2480Tue Apr 19 12:51:59 1994 Jason Merrill (jason@deneb.cygnus.com)
2481
2482 * cvt.c (convert_to_reference): Use NOP_EXPRs to switch between
2483 reference and pointer types instead of bashing the types directly.
2484
2485 * call.c (build_overload_call_real): Use the TREE_CODE to determine
2486 whether the function is overloaded or not, rather than
2487 TREE_OVERLOADED.
2488 * *: Remove all uses of TREE_OVERLOADED.
2489
2490 * decl.c (grokdeclarator): Only complain about initializing const
2491 fields when -ansi or -pedantic.
2492
2493Tue Apr 19 12:42:42 1994 Doug Evans (dje@canuck.cygnus.com)
2494
2495 * cp-tree.h (THUNK_DELTA): frame_size is now a union.
2496
2497Mon Apr 18 00:17:13 1994 Jason Merrill (jason@deneb.cygnus.com)
2498
2499 Do overloading on a block-by-block basis, not function-by-function.
2500 * decl.c: Lose overloads_to_forget.
2501 (struct binding_level): Add overloads_shadowed field.
2502 (poplevel): Restore overloads_shadowed.
2503 (push_overloaded_decl): Use overloads_shadowed instead of
2504 overloads_to_forget.
2505 (finish_function): Don't look at overloads_to_forget.
2506
2507 Copy enum_overflow logic from c-decl.c.
2508 * decl.c (start_enum): Initialize enum_overflow.
2509 (build_enumerator): Use enum_overflow. Also use current_scope().
2510
2511 * search.c (current_scope): Move Brendan's comment from
2512 build_enumerator here.
2513
2514 * typeck.c (convert_for_assignment): Change warnings to pedwarns for
2515 discarding const/volatile.
2516
2517Sat Apr 16 01:18:21 1994 Jason Merrill (jason@deneb.cygnus.com)
2518
2519 * typeck.c (comp_target_parms): Accept TEMPLATE_TYPE_PARMs on the rhs.
2520 (comp_target_types): Ditto.
2521
2522 * decl.c (lookup_name): Don't unset got_scope here.
2523
2524 * spew.c (yylex): Only replace yylval with the TYPE_NESTED_NAME if
2525 got_scope != NULL_TREE.
2526
2527Fri Apr 15 16:36:33 1994 Jason Merrill (jason@deneb.cygnus.com)
2528
2529 Horrible kludge to prevent templates from being instantiated by
2530 their base classes.
2531 * parse.y (template_instantiate_once): Unset TYPE_BEING_DEFINED
2532 before we get to left_curly.
2533 * pt.c (instantiate_class_template): Set TYPE_BEING_DEFINED.
2534
2535 * error.c (dump_decl): If it's a typedef, print out the name of the
2536 decl, not just the underlying type.
2537
2538 * decl.c (pushdecl): If the old duplicate decl was a TYPE_DECL,
2539 update the IDENTIFIER_TYPE_VALUE of its name.
2540
2541 * decl2.c (finish_file): When processing the initializer for a
2542 static member, pretend that the dummy function is a member of the
2543 same class.
2544
2545Fri Apr 15 15:56:35 1994 Kung Hsu (kung@mexican.cygnus.com)
2546
63718c49
GB
2547 * class.c (build_vtable_entry): revert Apr 4 change.
2548 * decl2.c (mark_vtable_entries): replace pure virtual function
2549 decl with abort's.
7177d104
MS
2550
2551Fri Apr 15 13:49:33 1994 Jason Merrill (jason@deneb.cygnus.com)
2552
2553 * typeck.c (build_conditional_expr): Pedwarn on pointer/integer
2554 mismatch, and don't pedwarn on 0/function pointer mismatch.
2555
2556 * typeck2.c (digest_init): Lose code for special handling of unions.
2557 (process_init_constructor): Since they're handled just fine here.
2558 Pedwarn on excess elements.
2559
2560 * decl2.c (grokfield): Complain about local class method declaration
2561 without definition.
2562
2563Fri Apr 15 13:19:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
2564
2565 * method.c (emit_thunk): Add extern declaration for
2566 current_call_is_indirect (needed for hppa).
2567
2568Thu Apr 14 16:12:31 1994 Jason Merrill (jason@deneb.cygnus.com)
2569
2570 Improve local class support; allow classes in different blocks to
2571 have the same name.
2572 * decl.c (pushtag): Support local classes better.
2573 (pushdecl_nonclass_level): New function for pushing mangled decls of
2574 nested types into the appropriate scope.
2575 (xref_defn_tag): Use pushdecl_nonclass_level instead of
2576 pushdecl_top_level.
2577 (grokfndecl): Don't mess with IDENTIFIER_GLOBAL_VALUE for local
2578 class methods.
2579 * method.c (do_inline_function_hair): Ditto.
2580
2581 * class.c (finish_struct): It is legal for a class with no
2582 constructors to have nonstatic const and reference members.
2583
2584Thu Apr 14 07:15:11 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
2585
2586 * decl.c (push_overloaded_decl): Avoid giving errors about
2587 built-ins, since duplicate_decls will have given warnings/errors
2588 for them.
2589
2590Thu Apr 14 03:45:12 1994 Jason Merrill (jason@deneb.cygnus.com)
2591
2592 * cvt.c (convert_to_reference): Warn about casting pointer type to
2593 reference type when this is probably not what they wanted.
2594
2595Wed Apr 13 13:12:35 1994 Per Bothner (bothner@kalessin.cygnus.com)
2596
2597 * decl.c (finish_decl): Don't mindlessly set TREE_USED for
2598 static consts any more (toplev.c has now been modified to
2599 not emit warnings if they are unused).
2600
2601Wed Apr 13 00:22:35 1994 Jason Merrill (jason@deneb.cygnus.com)
2602
2603 * decl.c (grok_op_properties): If op new/delete get here with
2604 METHOD_TYPEs, do a revert_static_member_fn.
2605
2606 * cp-tree.h (IDENTIFIER_CLASS_TYPE_VALUE): Lose.
2607 * init.c (is_aggr_typedef): Don't look at
2608 IDENTIFIER_CLASS_TYPE_VALUE.
2609 (get_aggr_from_typedef): Ditto.
2610 (get_type_value): Ditto.
2611 * call.c (build_scoped_method_call): Don't rely on overloaded
2612 template names having IDENTIFIER_CLASS_VALUE set.
2613
2614 * parse.y (component_decl_1, fn.def2): Revert rules for
2615 constructors.
2616 (component_decl_1, fn.def2): Use $1 instead of $$, since $$ is being
2617 clobbered.
2618
2619 * decl.c (start_function): Only warn about `void main()' if pedantic
2620 || warn_return_type.
2621
2622Tue Apr 12 02:14:17 1994 Jason Merrill (jason@deneb.cygnus.com)
2623
2624 Clean up overloading of the template name.
2625 * class.c (pushclass): overload the template name whenever pushing
2626 into the scope of a template class, not just if it is
2627 uninstantiated.
2628 (popclass): Correspondingly.
2629 * search.c (push_class_decls): Don't overload_template_name.
2630 * pt.c (overload_template_name): Don't set IDENTIFIER_LOCAL_VALUE or
2631 DECL_CONTEXT on things.
2632 * parse.y (left_curly): Don't overload_template_name.
2633 * class.c (finish_struct): Don't undo_template_name_overload.
2634
2635 * method.c (build_opfncall): Only pass one argument to global op
2636 delete.
2637
2638 * call.c (build_method_call): Use TYPE_VEC_DELETE_TAKES_SIZE to
2639 decide how many arguments to use for vec delete.
2640
2641 * decl.c (grok_op_properties): Be consistent in modifying
2642 current_class_type.
2643 (grokdeclarator): Only complain about function decls with no return
2644 type if we're being pedantic.
2645
2646Mon Apr 11 00:10:53 1994 Jason Merrill (jason@deneb.cygnus.com)
2647
2648 Add support for operator new [] and operator delete [].
2649
2650 * tree.def: Add VEC_NEW_EXPR and VEC_DELETE_EXPR.
2651 * ptree.c (print_lang_type): Indicate vec new/delete.
2652 * parse.y: Support vec new/delete.
2653 * method.c (build_decl_overload): Deal with vec new/delete.
2654 (build_opfncall): Ditto.
2655 * lex.c (init_lex): Set up values of ansi_opname and opname_tab for
2656 vec new/delete. vec new uses "__vn", and vec delete uses "__vd".
2657 * init.c (init_init_processing): Set up BIVN and BIVD.
2658 (do_friend): Don't clean up after mistaken setting of TREE_GETS_NEW,
2659 since it doesn't happen any more.
2660 (build_new): Support vec new. Always call something.
2661 (build_x_delete): Support vec delete.
2662 (build_vec_delete): Lose dtor_dummy argument, add use_global_delete,
2663 and pass it to build_x_delete.
2664 * decl2.c (delete_sanity): Don't change behavior by whether or not
2665 the type has a destructor. Pass use_global_delete to
2666 build_vec_delete.
2667 (coerce_delete_type): Make sure that the type returned has a first
2668 argument of ptr_type_node.
2669 * decl.c (init_decl_processing): Also declare the global vec
2670 new/delete.
2671 (grokdeclarator): Also force vec new/delete to be static.
2672 (grok_op_properties): Note presence of vec new/delete, and play with
2673 their args. If vec delete takes the optional size_t argument, set
2674 TYPE_VEC_DELETE_TAKES_SIZE.
2675 * cp-tree.h (TYPE_GETS_{REG,VEC}_DELETE): New macros to simplify
2676 checking for one delete or the other.
2677 (lang_type): gets_new and gets_delete are now two bits long. The
2678 low bit is for the non-array version. Lose gets_placed_new.
2679 (TYPE_VEC_DELETE_TAKES_SIZE): New macro indicating that the vec
2680 delete defined by this class wants to know how much space it is
2681 deleting.
2682 (TYPE_VEC_NEW_USES_COOKIE): New macro to indicate when vec new must
2683 add a header containing the number of elements in the vector; i.e.
2684 when the elements need to be destroyed or vec delete wants to know
2685 the size.
2686 * class.c (finish_struct_methods): Also check for overloading vec
2687 delete.
2688 * call.c (build_method_call): Also delete second argument for vec
2689 delete.
2690
2691 * decl.c (grokdeclarator): Correct complaints again.
2692 (grokdeclarator): Fix segfault on null declarator.
2693 (decls_match): Also accept redeclaration with no arguments if both
2694 declarations were in C context. Bash TREE_TYPE (newdecl) here.
2695 (duplicate_decls): Instead of here.
2696
2697 * parse.y (nested_name_specifier_1): Lose rules for dealing with
2698 syntax errors nicely, since they break parsing of 'const i;'.
2699
2700 * decl.c (lookup_name): if (got_scope == current_class_type)
2701 val = IDENTIFIER_CLASS_VALUE (name).
2702
2703 * search.c (lookup_nested_tag): Look in enclosing classes, too.
2704
2705 * spew.c (yylex): Only look one character ahead when checking for a
2706 SCOPE.
2707
2708 * lex.c (check_newline): Read first nonwhite char before
2709 incrementing lineno.
2710
2711 * decl.c (grokdeclarator): Don't claim that typedefs are variables
2712 in warning.
2713
2714 * parse.y: Divide up uses of unqualified_id into
2715 notype_unqualified_id and unqualified_id, so that TYPENAME can be
2716 used as an identifier after an object.
2717
2718 * class.c (push_nested_class): Don't push into non-class scope.
2719
2720 * decl.c (grokdeclarator): If an identifier could be a type
2721 conversion operator, but has no associated type, it's not a type
2722 conversion operator.
2723
2724 * pt.c (unify): Check for equality of constants better.
2725
2726 * decl.c (grokdeclarator): Don't complain about access decls.
2727
2728Sun Apr 10 02:39:55 1994 Jason Merrill (jason@deneb.cygnus.com)
2729
2730 * decl.c (grokdeclarator): pedwarn about data definitions without
2731 types here.
2732
2733 * parse.y (datadef): Don't pedwarn about decls without types here,
2734 since that is valid for functions.
2735 (fn.def2, component_decl): Support constructors with declmods again.
2736 (nomods_initdecls): For decls without any mods, so that we don't try
2737 to get declspecs from some arbitrary $0.
2738
2739 * search.c (lookup_field): Use cp_error.
2740
2741 * parse.y (nested_name_specifier_1): Don't check aggr/non-aggr type
2742 here; it breaks destructors for non-aggr types.
2743
2744 * decl.c (lookup_name): Only look for TYPE_DECLs in base classes of
2745 a type being defined, like the comment says.
2746 If got_scope is not an aggregate, just return NULL_TREE.
2747
2748 * pt.c (create_nested_upt): Kung's code for creating types nested
2749 within uninstantiated templates now lives here (it used to live in
2750 hack_more_ids). It needs to be expanded.
2751
2752 * parse.y: Stop calling see_typename so much.
2753
2754 * decl.c (lookup_name): Deal with TTPs and UPTs.
2755
2756 * lex.c (real_yylex): Don't set looking_for_typename just because we
2757 saw a 'new'.
2758 (dont_see_typename): #if 0 out.
2759
2760 * spew.c (yylex): Increment looking_for_typename if the next
2761 character is SCOPE, rather than setting it to 1; this way, the value
2762 from seeing an aggr specifier will not be lost. This kinda relies
2763 on looking_for_typename never being < 0, which is now true.
2764
2765 * parse.y (nested_name_specifier_1): Accept TEMPLATE_TYPE_PARMs,
2766 too.
2767 (named_class_head_sans_basetype): Accept template types, too. Oops.
2768
2769Fri Apr 8 16:39:35 1994 Jason Merrill (jason@deneb.cygnus.com)
2770
2771 * decl2.c (reparse_decl_as_expr1): Handle SCOPE_REFs.
2772
2773 * parse.y: Lose START_DECLARATOR.
2774
2775 * search.c (lookup_nested_tag): New function to scan CLASSTYPE_TAGS
2776 for a class.
2777
2778 * parse.y: Simplify fn.def2 and component_decl. Support 'enum
2779 A::foo' syntax. Catch invalid scopes better.
2780
2781 * parse.y, lex.c: lose TYPENAME_COLON.
2782
2783 * decl2.c (groktypefield): #if 0 out.
2784
2785 * decl.c (lookup_name): If the type denoted by got_scope is
2786 currently being defined, look in CLASSTYPE_TAGS rather than FIELDS.
2787
2788 * class.c (push_nested_class): Don't try to push into
2789 error_mark_node.
2790
2791Fri Apr 8 07:26:36 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
2792
2793 * Makefile.in (stamp-parse): Update count of conflicts to 33.
2794
2795Thu Apr 7 17:47:53 1994 Jason Merrill (jason@deneb.cygnus.com)
2796
2797 A saner implementation of nested types that treats template types
2798 no differently from non-template types. There are still some
2799 shortcomings of our system; most notably, it is difficult to look
2800 for a nested type that is hidden by another name, because of the way
2801 we keep track of hidden types. But this shouldn't be a problem for
2802 just about anyone. Perhaps lookup_field should be fixed up a bit.
2803
2804 * spew.c: Moved handling of nested types/scoping from the lexer
2805 into the parser. Removed variable template_type_seen_before_scope.
2806 Removed functions frob_identifier, hack_more_ids, and various cruft
2807 that was #if 0'd out in the past, reducing the size of the file from
2808 1146 lines to 450 lines. We can't quite do away with spew.c yet,
2809 though; we still need it for do_aggr () and checking for SCOPE after
2810 the current identifier. And setting lastiddecl.
2811
2812 * parse.y: Moved handling of nested types/scoping from the lexer
2813 into the parser, using a new global variable `got_scope'. Reduced
2814 the number of states by 53. Implemented all uses of explicit global
2815 scope. Removed terminals SCOPED_TYPENAME and SCOPED_NAME. Removed
2816 nonterminals tmpl.1, scoped_base_class, id_scope, typename_scope,
2817 scoped_typename. Added nonterminals nested_type,
2818 qualified_type_name, complete_type_name, qualified_id, ptr_to_mem,
2819 nested_name_specifier, global_scope, overqualified_id, type_name.
2820 Changed many others. Added 9 new reduce/reduce conflicts, which are
2821 nested type parallels of 9 that were already in the grammar for
2822 non-nested types. Eight of the now 33 conflicts should be removed
2823 in the process of resolving the late binding between variable and
2824 function decls.
2825
2826 * gxxint.texi (Parser): Update.
2827
2828 * cp-tree.h (IS_AGGR_TYPE_CODE): Add UNINSTANTIATED_P_TYPE.
2829
2830 * lex.h: Add decl for got_scope.
2831
2832 * lex.c (see_typename): Claim to be the lexer when calling
2833 lookup_name.
2834
2835 * decl.c (lookup_name): When called from the lexer, look at
2836 got_scope and looking_at_typename; otherwise don't.
2837
2838Thu Apr 7 22:05:47 1994 Mike Stump (mrs@cygnus.com)
2839
2840 31th Cygnus<->FSF merge.
2841
2842Thu Apr 7 17:47:53 1994 Jason Merrill (jason@deneb.cygnus.com)
2843
2844 * decl2.c (mark_vtable_entries): Call this to mark all the
2845 entries in the vtable addressable.
2846 (finish_decl_parsing): Handle SCOPE_REFs.
2847
2848 * decl.c (decls_match): Always call compparms with strict == 1.
2849 Handle the special case of C function redecl here.
2850 (duplicate_decls): Only keep the old type if the new decl takes no
2851 arguments.
2852
2853 * typeck.c (compparms): Also allow t1 to be ... if strict == 0.
2854
2855Thu Apr 7 16:17:50 1994 Mike Stump (mrs@cygnus.com)
2856
2857 * class.c (build_vtable_entry): Fix breakage introduced Apr 5
2858 17:48:41.
2859
2860Wed Apr 6 16:05:10 1994 Per Bothner (bothner@kalessin.cygnus.com)
2861
2862 * init.c (build_virtual_init), search.c (build_vbase_vtables_init),
2863 ch-tree.h: Every place these functions were called, the result was
2864 immediately passed to expand_expr_stmt. Reduce redundancy by
2865 calling expand_expr_init *inside* these functions. These
2866 makes for a simpler interface, and we don't have to build
2867 compound expressions. Hence, rename these function to:
2868 expand_virtual_init and expand_vbase_vtables_init respectively.
2869 * init.c, decl.c: Change callers of these functions.
2870 * init.c, cp-tree.h (expand_virtual_init): Make static.
2871
2872 * decl2.c (finish_file): Check TREE_PUBLIC||TREE_ADDRESSABLE
2873 rather than DECL_SAVED_INSNS before emitting inlines.
2874
2875Wed Apr 6 13:06:39 1994 Jason Merrill (jason@deneb.cygnus.com)
2876
2877 * spew.c (init_spew): #if 0 out stuff used by arbitrate_lookup.
2878
2879 * decl.c (duplicate_decls): If this is a new declaration of an
2880 extern "C" function, keep the type (for the argtypes).
2881 (redeclaration_error_message): Don't check DECL_LANGUAGE here.
2882 (decls_match): Call compparms with a value of strict dependent on
2883 the value of strict_prototypes for DECL_LANGUAGE (oldecl).
2884
2885 * typeck.c (compparms): ... is only equivalent to non-promoting
2886 parms if we're not being strict.
2887
2888 * parse.y (empty_parms): Don't check flag_ansi || pedantic here.
2889
2890 * decl.c (init_decl_processing): if (flag_ansi || pedantic)
2891 strict_prototypes_lang_c = strict_prototypes_lang_cplusplus;
2892
2893 * decl2.c (grok_function_init): Don't set DECL_INITIAL on pure
2894 virtuals.
2895
2896Tue Apr 5 17:48:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
2897
2898 Support for implementing vtables with thunks.
2899 * tree.def (THUNK_DECL): New TREE_CODE.
2900 * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY), tree.c
2901 (fnaddr_from_vtable_entry): Handle flag_vtable_thunks case.
2902 * cp-tree.h (memptr_type): New variable.
2903 * class.c (build_vtable_entry): Build thunk if necessary.
2904 * class.c (build_vfn_ref): If using thunks, don't need
2905 to add delta field from vtable (there is none!).
2906 * decl.c: Add memptr_type as well as vtable_entry_type.
2907 If using thunks, the latter is just ptr_type_node.
2908 * gc.c, typeck.c: Use memptr_typeChange, not vtable_entry_type.
2909 * decl2.c (finish_vtable_vardecl): Handle thunks.
2910 * expr.c (cplus_expand_expr): Support THUNK_DECL.
2911
2912 * decl.c (grokdeclarator): Set DECL_THIS_EXTERN if "extern".
2913 * decl.c (start_function): Set current_extern_inline based on
2914 DECL_THIS_EXTERN, not TREE_PUBLIC.
2915 * decl.c (finish_function): Call mark_inline_for_output if needed,
2916
2917 Improve intelligence about when to emit inlines.
2918 * cp-tree.h (lang_decl_flags): New field saved_inline.
2919 * cp-tree.h (DECL_SAVED_INLINE): New macro.
2920 * class.c (add_virtual_function): Don't set TREE_ADDRESSABLE.
2921 * decl.h, decl.c (pending_addressable_inlines): Removed.
2922 * decl2.c (pending_addressable_inlines): Renamed to saved_inlines.
2923 * decl2.c (mark_inline_for_output): Do nothing if
2924 DECL_SAVED_INLINE; otherwise set it (and add to saved_inlines list).
2925 * decl2.c (finish_vtable_vardecl): SET_CLASSTYPE_INTERFACE_KNOWN
2926 and set CLASSTYPE_INTERFACE_ONLY if there is a non-inline virtual.
2927 * decl2.c (finish_file): Writing out inlines later, so we can
2928 also handle the ones needed for vtbales.
2929 * decl2.c (write_vtable_entries, finish_vtable_typedecl): Removed.
2930
2931 * cp-tree.h, class.c, decl2.c, search.c: Remove -fvtable-hack
2932 and flag_vtable_hack. Use -fvtable-thunks and flag_vtable_thunks
2933 instead. (The rationale is that these optimizations both break binary
2934 compatibility, but should become the default in a future release.)
2935
2936Wed Apr 6 10:53:56 1994 Mike Stump (mrs@cygnus.com)
2937
2938 * class.c (modify_vtable_entries): Never reset the DECL_CONTEXT
2939 of a fndecl, as we might not be from that vfield.
2940
2941Tue Apr 5 17:43:35 1994 Kung Hsu (kung@mexican.cygnus.com)
2942
2943 * class.c (add_virtual_function): fix bug for pure virtual, so
2944 that DECL_VINDEX of the dummy decl copied won't be error.
2945 (see also Apr 4 change)
2946
2947Tue Apr 5 17:23:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
2948
2949 * typeck.c (c_expand_return): Before checking that we're not
2950 returning the address of a local, make sure it's a VAR_DECL.
2951 (And don't worry about it being a TREE_LIST.)
2952
2953Tue Apr 5 13:26:42 1994 Jason Merrill (jason@deneb.cygnus.com)
2954
2955 * parse.y (YYDEBUG): Always define.
2956 * lex.c (YYDEBUG): Ditto.
2957
2958Mon Apr 4 11:28:17 1994 Kung Hsu (kung@mexican.cygnus.com)
2959
2960 * class.c (finish_struct): backup out the change below, put the
2961 new change for the same purpose. The change below breaks code.
2962
2963 * class.c (finish_struct): if pure virtual, copy node and make
2964 RTL point to abort, then put in virtual table.
2965 * decl2.c (grok_function_iit): reinstate Mar 31 change.
2966
2967Sat Apr 2 03:12:58 1994 Jason Merrill (jason@deneb.cygnus.com)
2968
2969 * init.c (build_new): pedwarn about newing const and volatile
2970 types.
2971
2972 * tree.c (get_identifier_list): Only do the special handling
2973 thing if we're dealing with the main variant of the record type.
2974
2975 * cvt.c (convert_to_reference): When converting between
2976 compatible reference types, use the pointer conversion machinery.
2977 Don't just blindly overwrite the old type.
2978
2979Fri Apr 1 17:14:42 1994 Jason Merrill (jason@deneb.cygnus.com)
2980
2981 * call.c (build_method_call): When looking at global functions,
2982 be sure to use instance_ptr for the first argument, not some version
2983 of it that has been cast to a base class. Also do this before
2984 comparing candidates.
2985
2986Thu Mar 31 19:50:35 1994 Jason Merrill (jason@deneb.cygnus.com)
2987
2988 * call.c (build_method_call): Constructors can be called for
2989 const objects.
2990
2991Thu Mar 31 16:20:16 1994 Kung Hsu (kung@mexican.cygnus.com)
2992
2993 * decl2.c (grok_func_init): do not abort as rtl for pur virtual
2994 fucntions. They can be defined somewhere else.
2995
2996Sat Jan 23 23:23:26 1994 Stephen R. van den Berg (berg@pool.informatik.rwth-aachen.de)
2997
2998 * decl.c (init_decl_processing): Declare __builtin_return_address
2999 and __builtin_frame_address for C++ as well.
3000
3001Thu Mar 31 12:35:49 1994 Mike Stump (mrs@cygnus.com)
3002
3003 * typeck2.c (store_init_value): Integral constant variables are
3004 always constant, even when doing -fpic.
3005
3006Sat Jan 23 23:23:26 1994 Stephen R. van den Berg (berg@pool.informatik.rwth-aachen.de)
3007
3008 * decl.c (redeclaration_error_message): Pass the types to
3009 comptypes.
3010
3011Wed Mar 30 21:29:25 1994 Mike Stump (mrs@cygnus.com)
3012
3013 Cures incorrect errors about pure virtuals in a class, when they
3014 have been overridden in a derived class.
3015
3016 * search.c (get_abstract_virtuals): Reimplement.
3017 * search.c (get_abstract_virtuals_1): New routine.
3018
3019Wed Mar 30 14:10:04 1994 Jason Merrill (jason@deneb.cygnus.com)
3020
3021 * pt.c (push_template_decls): Make the pushed level pseudo
3022 global.
3023
3024 * parse.y (extdefs): Don't pop everything if the current binding
3025 level is pseudo_global.
3026
3027 * decl.c (pop_everything): Stop on reaching a pseudo-global
3028 binding level.
3029
3030 * cp-tree.h (DECL_FUNCTION_MEMBER_P): Change to more reliable test.
3031
3032 * decl.c (duplicate_decls): Only copy DECL_SOURCE_{FILE_LINE} if
3033 the old decl actually had an initializer.
3034
3035 * {various}: Clean up gcc -W complaints.
3036
3037 * cp-tree.h (DECL_FUNCTION_MEMBER_P): Currently defined to be
3038 (DECL_CONTEXT (NODE) != NULL_TREE).
3039
3040 * parse.y (lang_extdef): Call pop_everything if necessary.
3041
3042 * decl.c (pop_everything): New function for popping binding
3043 levels left over after a syntax error.
3044 (pushdecl): Use DECL_FUNCTION_MEMBER_P to decide whether or not
3045 a function is a member.
3046
3047Wed Mar 30 14:20:50 1994 Mike Stump (mrs@cygnus.com)
3048
3049 Cures calling a more base base class function, when a more derived
3050 base class member should be called in some MI situations.
3051
3052 * search.c (make_binfo): Use more the more specialized base
63718c49
GB
3053 binfos from the binfo given as the second argument to make_binfo,
3054 instead of the unspecialized ones from the TYPE_BINFO.
7177d104
MS
3055 * class.c (finish_base_struct): Ditto, update callers.
3056 * search.c (dfs_get_vbase_types): Ditto.
3057 * tree.c (propagate_binfo_offsets, layout_vbasetypes): Ditto.
3058 * decl.c (xref_tag): Use NULL_TREE instead of 0.
3059 * lex.c (make_lang_type): Ditto.
3060
3061Wed Mar 30 14:10:04 1994 Jason Merrill (jason@deneb.cygnus.com)
3062
3063 * decl.c (pushdecl): If pushing a C-linkage function, only do a
3064 push_overloaded_decl.
3065 (duplicate_decls): Standard overloading does not shadow built-ins.
3066
3067Tue Mar 29 00:54:18 1994 Jason Merrill (jason@deneb.cygnus.com)
3068
3069 * pt.c (end_template_decl): Don't call push_overloaded_decl.
3070
3071 * init.c (do_friend): Don't call push_overloaded_decl.
3072
3073 * decl.c (pushdecl): Call push_overloaded_decl for functions and
3074 function templates.
3075 (duplicate_decls): functions and function templates are not
3076 duplicates, but don't complain about calling this function to
3077 compare them.
3078 (push_overloaded_decl): Don't deal with linkage. Call
3079 duplicate_decls.
3080 (redeclaration_error_message): Deal with linkage.
3081
3082 * decl.c (start_function): If push_overloaded_decl returns an
3083 older version of the function, deal with it.
3084
3085 * decl.c (start_function): Be sure only to push_overloaded_decl
3086 for non-members.
3087
3088 * decl.c (grokfndecl): Put back clearing of DECL_CHAIN for
3089 methods.
3090 (start_function): Lose broken and redundant code for checking old
3091 decl.
3092
3093 * init.c (add_friend): Give line numbers of both friend decls
3094 when warning about re-friending.
3095
3096 * pt.c (tsubst): Use comptypes rather than == to compare the
3097 types of the method as declared and as defined, since default
3098 parameters may be different.
3099
3100 * call.c (build_method_call): Use brendan's candidate printing
3101 routine.
3102
3103 * decl.c (start_method): Methods defined in the class body are
3104 inline whether or not it's a template class.
3105
3106Mon Mar 28 16:39:26 1994 Jason Merrill (jason@deneb.cygnus.com)
3107
3108 * parse.y (initdcl0): Add "extern" to current_declspecs if
3109 have_extern_spec && ! used_extern_spcec.
3110
3111 * tree.c (really_overloaded_fn): A fn with more than one
3112 overload.
3113
3114 * pt.c (end_template_decl): Use really_overloaded_fn.
3115
3116 * decl.c (duplicate_decls): When smashing a decl into a previous
3117 definition, keep the old file and line.
3118 Don't deal with overloaded functions.
3119 Lose old code for checking arg types of functions.
3120 Check for overloaded C functions.
3121 (pushdecl): Deal with overloaded functions.
3122 (start_decl): Expect pushdecl to return an appropriate function decl.
3123 (start_function): Ditto.
3124 (push_overloaded_decl): Don't check for overloaded C functions.
3125
3126 * *.c: Stop using DECL_OVERLOADED, it being archaic.
3127 TREE_OVERLOADED should probably go, too.
3128
3129Mon Mar 28 14:00:45 1994 Ron Guilmette (rfg@netcom.com)
3130
3131 * typeck.c (comp_target_types): Call comp_target_parms with
3132 strict == 1.
3133
3134Sun Mar 27 00:07:45 1994 Jason Merrill (jason@deneb.cygnus.com)
3135
3136 * parse.y (empty_parms): Don't parse () as (...) in extern "C"
3137 sections if we're compiling with -ansi or -pedantic.
3138
3139 * decl.c (decls_match): Don't treat (int) and (int&) as matching.
3140
3141 * decl2.c (grokfield): Don't pedwarn twice about initializing
3142 field.
3143
3144 * decl.c (push_overloaded_decl): Warn about shadowing
3145 constructor.
3146 (redeclaration_error_message): Don't allow 'int a; int a;'
3147
3148 * cvt.c (build_up_reference): Only check for valid upcast if
3149 LOOKUP_PROTECT is set, not just any flag.
3150
3151Fri Mar 25 01:22:31 1994 Jason Merrill (jason@deneb.cygnus.com)
3152
3153 * lex.c (check_newline): When we see a #pragma implementation,
3154 also set it for the main input file.
3155
3156 * init.c (build_new): Convert array size argument to size_t.
3157
3158 * parse.y (primary): If we're doing a parenthesized type-id, call
3159 groktypename before passing it to build_new.
3160
3161 * call.c (build_method_call): Deal properly with const and
3162 volatile for instances of reference type.
3163
3164 * decl.c (store_return_init): Change 'if (pedantic) error' to 'if
3165 (pedantic) pedwarn'.
3166
3167 * decl.c (grokdeclarator): Don't complain about putting `static'
3168 and `inline' on template function decls.
3169
3170Thu Mar 24 23:18:19 1994 Jason Merrill (jason@deneb.cygnus.com)
3171
3172 * call.c (build_method_call): Preserve const & volatile on
3173 `this'.
3174
3175Thu Mar 24 16:21:52 1994 Mike Stump (mrs@cygnus.com)
3176
3177 * init.c (build_new, build_vec_delete): Use global new and delete
3178 for arrays.
3179 * decl2.c (delete_sanity): Ditto.
3180
3181Thu Mar 24 02:10:46 1994 Jason Merrill (jason@deneb.cygnus.com)
3182
3183 * cvt.c (convert_to_reference): If i is an lvalue,
3184 (int &)i -> *(int*)&i, as per 5.2.8p9 of the latest WP.
3185 (convert_force): Call convert_to_reference with LOOKUP_COMPLAIN.
3186
3187Wed Mar 23 17:45:37 1994 Jason Merrill (jason@deneb.cygnus.com)
3188
3189 * decl.c (duplicate_decls): Also propagate DECL_TEMPLATE_MEMBERS
3190 and DECL_TEMPLATE_INSTANTIATIONS.
3191
3192 * init.c (build_new): Handle array typedefs properly.
3193
3194Wed Mar 23 18:23:33 1994 Mike Stump (mrs@cygnus.com)
3195
3196 30th Cygnus<->FSF merge.
3197
3198Wed Mar 23 00:46:24 1994 Mike Stump (mrs@cygnus.com)
3199
3200 * class.c (modify_vtable_entries): Avoid running off the end of the
3201 virtuals list when processing a virtual destructor.
3202 * class.c (get_vtable_entry): Ditto.
3203
3204Wed Mar 23 00:23:59 1994 Jason Merrill (jason@deneb.cygnus.com)
3205
3206 * decl.c (duplicate_decls): If two template decls don't match,
3207 just return 0.
3208
3209Tue Mar 22 23:49:41 1994 Jason Merrill (jason@deneb.cygnus.com)
3210
3211 * typeck.c (convert_for_assignment): Don't pedwarn about
3212 converting function pointer to void *.
3213
3214Tue Mar 22 22:23:19 1994 Mike Stump (mrs@cygnus.com)
3215
3216 Major revamp of pointer to member functions. Cures major
3217 nonfunctionality when used in casts, and MI situations.
3218
3219 * cvt.c (convert_force): Update call site of build_ptrmemfunc.
3220 * typeck.c (convert_for_assignment): Ditto.
3221 * typeck2.c (digest_init): Ditto.
3222 * typeck2.c (process_init_constructor): Simplify by moving code into
3223 digest_init.
3224 * typeck2.c (digest_init): Do default_conversions on init value, if
3225 we are processing pointer to member functions.
3226 * class.c (get_vfield_offset): Now non-static. Convert bit offset
3227 into byte offset.
3228 * cp-tree.h (get_vfield_offset): Ditto.
3229 * typeck.c (get_member_function_from_ptrfunc): Convert down to right
3230 instance, before fetching vtable pointer.
3231 * typeck.c (get_delta_difference): New routine.
3232 * typeck.c (build_ptrmemfunc): Revamp to handle casting better, also
3233 get vtable pointer out of right subobject.
3234
3235Tue Mar 22 17:56:48 1994 Mike Stump (mrs@cygnus.com)
3236
3237 * search.c (get_binfo): Return NULL instead of aborting, when
3238 passed a UNION_TYPE.
3239
3240Tue Mar 22 12:44:54 1994 Jason Merrill (jason@deneb.cygnus.com)
3241
3242 These patches implement handling of redefinition/redeclaration of
3243 templates.
3244
3245 * typeck.c (comptypes): Simplify. All TEMPLATE_TYPE_PARMs are
3246 considered compatible.
3247
3248 * parse.y (template_def): Pass defn argument to end_template_decl.
3249
3250 * pt.c (end_template_decl): Add defn argument. Check for
3251 redefinition. Simplify.
3252
3253 * error.c (OB_UNPUT): New macro, to remove mistakes.
3254 (aggr_variety): Subroutine of dump_aggr_type.
3255
3256 * decl.c (decls_match): Support templates.
3257 (duplicate_decls): No longer static. Don't try to lay out template
3258 decls.
3259 (pushdecl): Simplify.
3260
3261 * cp-tree.h (DECL_TEMPLATE_MEMBERS): Use DECL_SIZE instead of
3262 DECL_INITIAL.
3263
3264Mon Mar 21 11:46:55 1994 Jason Merrill (jason@deneb.cygnus.com)
3265
3266 * error.c (dump_decl): Support class template decls.
3267 (dump_type): Don't adorn template type parms.
3268
3269 * decl.c (duplicate_decls): Save DECL_TEMPLATE_INFO from old decl
3270 if it was a definition.
3271 (redeclaration_error_message): Do the cp_error thang, and reject
3272 redefinition of templates.
3273
3274Mon Mar 21 19:36:06 1994 Per Bothner (bothner@kalessin.cygnus.com)
3275
3276 * decl.c (grokdeclarator): Set TREE_PUBLIC for METHOD_TYPE
3277 in FIELD context, when appropriate. Also,
3278 CLASSTYPE_INTERFACE_ONLY is irrelevant to setting TREE_PUBLIC.
3279 Also, simplify check for bogus return specifiers.
3280
3281Mon Mar 21 11:46:55 1994 Jason Merrill (jason@deneb.cygnus.com)
3282
3283 * parse.y (after_type_declarator1): Expand type_quals.
3284 (notype_declarator1): Ditto.
3285 (absdcl1): Ditto.
3286
3287Sat Mar 19 01:05:17 1994 Jason Merrill (jason@deneb.cygnus.com)
3288
3289 * decl.c (grokdeclarator): Treat class-local typedefs like static
3290 members; i.e. 'typedef int f();' means that f is a function type,
3291 not a method type.
3292
3293 * parse.y (decl): Change direct_* back to *.
3294 (type_id): Change direct_abstract_declarator to absdcl.
3295 (direct_declarator, direct_initdecls, direct_initdcl0): Remove again.
3296
3297Fri Mar 18 12:47:59 1994 Jason Merrill (jason@deneb.cygnus.com)
3298
3299 These two patches fix crashes on instantiating a template inside a
3300 function with C linkage or containing labels.
3301
3302 * class.c (current_lang_stacksize): No longer static.
3303
3304 * decl.c (struct saved_scope): Add lang_base, lang_stack,
3305 lang_name, lang_stacksize, and named_labels.
3306 (push_to_top_level): Save them.
3307 (pop_from_top_level): Restore them.
3308
3309 * gxxint.texi (Parser): Update.
3310
3311 These two patches finish moving the task of expr/declarator
3312 ambiguity resolution from the lexer to the parser, and add one more
3313 r/r conflict. START_DECLARATOR can now be nuked.
3314
3315 * parse.y (decl): Add "direct_" in typespec X rules.
3316 (direct_declarator): New nonterminal for
3317 direct_after_type_declarator and direct_notype_declarator.
3318 (direct_initdecls): Like initdecls, but uses direct_initdcl0.
3319 (direct_initdcl0): Like initdcl0, but uses direct_declarator.
3320 (named_parm): Add typespec direct_declarator rule.
3321
3322 * spew.c (yylex): #if 0 out START_DECLARATOR insertion.
3323
3324 These two patches disable some excessive cleverness on the part of
3325 g++; a non-class declaration always hides a class declaration in the
3326 same scope, and g++ was trying to unhide it depending on the
3327 enclosing expression.
3328
3329 * spew.c (arbitrate_lookup): #if 0 out.
3330
3331 * decl.c (lookup_name): Never call arbitrate_lookup.
3332
3333 * parse.y (complex_notype_declarator1): Add '*'
3334 complex_notype_declarator1 and '&' complex_notype_declarator1 rules.
3335
3336 * parse.y (complex_direct_notype_declarator): Restore id_scope
3337 see_typename TYPENAME rule, remove all other rules beginning with
3338 those tokens.
3339 (notype_unqualified_id): Add '~' see_typename IDENTIFIER rule.
3340
3341Thu Mar 17 17:30:01 1994 Jason Merrill (jason@deneb.cygnus.com)
3342
3343 These changes fix the compiler's handling of the functional cast/
3344 object declaration ambiguities in section 6.8 of the ARM. They also
3345 add 11 reduce/reduce conflicts. Sigh.
3346
3347 * parse.y: Add precedence decls for OPERATOR and '~'.
3348 (notype_unqualified_id): New nonterminal, encompasses all of the
3349 ANSI unqualified-id nonterminal except TYPENAMEs.
3350 (expr_or_declarator): New nonterminal to delay parsing of code like
3351 `int (*a)'.
3352 (primary): Use notype_unqualified_id.
3353 (decl): Add typespec initdecls ';' and typespec declarator ';'
3354 rules.
3355 (initdcl0): Deal with the above.
3356 (complex_notype_declarator1): A notype_declarator that is not also
3357 an expr_or_declarator.
3358 (complex_direct_notype_declarator): A direct_notype_declarator that
3359 doesn't conflict with expr_or_declarator. Use
3360 notype_unqualified_id. Remove id_scope see_typename TYPENAME rule.
3361 (functional_cast): New nonterminal, for the three functional cast
3362 rules. So that they can be moved after
3363 complex_direct_notype_declarator.
3364 (see_typename): Don't accept type_quals any more.
3365
3366 * decl2.c (reparse_decl_as_expr): New function to deal with parse
3367 nodes for code like `int (*a)++;'.
3368 (reparse_decl_as_expr1): Recursive subroutine of the above.
3369 (finish_decl_parsing): New function to deal with parse nodes for
3370 code like `int (*a);'. See the difference?
3371
3372Thu Mar 17 12:16:10 1994 Mike Stump (mrs@cygnus.com)
3373
3374 These changes break binary compatibility in code with classes
3375 that use virtual bases.
3376
3377 * search.c (dfs_get_vbase_types): Simplify and correct to make
3378 sure virtual bases are initialized in dfs ordering.
3379 * search.c (get_vbase_types): Simplify and make readable.
3380
3381Thu Mar 17 12:01:10 1994 Jason Merrill (jason@deneb.cygnus.com)
3382
3383 * parse.y: s/ typename / type_id /g
3384
3385Wed Mar 16 17:42:52 1994 Kung Hsu (kung@mexican.cygnus.com)
3386
3387 * parse.y (typespec): add SCOPE TYPENAME for global scoped
3388 type. e.g. ::B x.
3389
3390 * decl.c (complete_array_type): fix a bug that in -pendantic
3391 mode even there's no initializer, it will continue to build
3392 default index.
3393
3394Wed Mar 16 17:43:07 1994 Jason Merrill (jason@deneb.cygnus.com)
3395
3396 * parse.y (direct_notype_declarator): Add PTYPENAME rule, remove
3397 all of the scoped PTYPENAME rules.
3398
3399Wed Mar 16 16:39:02 1994 Mike Stump (mrs@cygnus.com)
3400
3401 * init.c (build_offset_ref): The value of A::typedef_name is
3402 always the TYPE_DECL, and never an error.
3403
3404Tue Mar 15 20:02:35 1994 Jason Merrill (jason@deneb.cygnus.com)
3405
3406 * search.c (get_base_distance_recursive): Two binfos can only
3407 represent the same object if they are both via_virtual.
3408
3409 * class.c (finish_base_struct): Check vbases for ambiguity, too.
3410
3411 * search.c (get_vbase_types): Accept binfo argument, too.
3412
3413Tue Mar 15 19:22:05 1994 Kung Hsu (kung@mexican.cygnus.com)
3414
3415 * decl.c (complete_array_type): complete TYPE_DOMAIN of the
3416 initializer also, because back-end requires it.
3417
3418Tue Mar 15 15:33:31 1994 Jason Merrill (jason@deneb.cygnus.com)
3419
3420 * error.c (dump_expr): Support member functions (which show up as
3421 OFFSET_REFs).
3422
3423Mon Mar 14 16:24:36 1994 Mike Stump (mrs@cygnus.com)
3424
3425 * init.c (build_new): Set the return type of multidimensional
3426 news correctly.
3427
3428Fri Mar 11 15:35:39 1994 Kung Hsu (kung@mexican.cygnus.com)
3429
3430 * call.c (build_method_call): if basetype not equal to type
3431 of the instance, use the type of the instance in building
3432 destructor.
3433
3434Thu Mar 10 17:07:10 1994 Kung Hsu (kung@mexican.cygnus.com)
3435
3436 * parse.y (direct_notype_declarator): add push_nested_type for
3437 'template_type SCOPED_NAME' rule.
3438
3439Tue Mar 8 00:19:58 1994 Jason Merrill (jason@deneb.cygnus.com)
3440
3441 * parse.y (parm): Add typed_declspec1 {absdcl, epsilon} rules.
3442
3443Sat Mar 5 04:47:48 1994 Jason Merrill (jason@deneb.cygnus.com)
3444
3445 * parse.y (regcast_or_absdcl): New nonterminal to implement late
3446 reduction of constructs like `int ((int)(int)(int))'.
3447 (cast_expr): Use it.
3448 (sub_cast_expr): Everything that can come after a cast.
3449 (typed_declspecs1): typed_declspecs that are not typed_typespecs.
3450 (direct_after_type_declarator): Lose PAREN_STAR_PAREN rule.
3451 (direct_abstract_declarator): Replace '(' parmlist ')' rule with
3452 '(' complex_parmlist ')' and regcast_or_absdcl.
3453 (parmlist): Split
3454 (complex_parmlist): Parmlists that are not also typenames.
3455 (parms_comma): Enabler.
3456 (named_parm): A parm that is not also a typename. Use declarator
3457 rather than dont_see_typename abs_or_notype_decl. Expand
3458 typed_declspecs inline.
3459 (abs_or_notype_decl): Lose.
3460 (dont_see_typename): Comment out.
3461 (bad_parm): Break out abs_or_notype_decl into two rules.
3462
3463Fri Mar 4 18:22:39 1994 Jason Merrill (jason@deneb.cygnus.com)
3464
3465 * decl2.c (reparse_decl_as_casts): New function to change parse
3466 nodes for `(int)(int)(int)' from "function taking int and returning
3467 function taking int and returning function taking int" to "... cast
3468 to int, cast to int, cast to int".
3469
3470 * decl2.c (reparse_decl_as_expr): Recursive function to change
3471 parse nodes for `A()()' from "function returning function returning
3472 A" to "A().operator()".
3473
3474 * parse.y (primary): Replace `typespec LEFT_RIGHT' rule with
3475 `typespec fcast_or_absdcl' rule.
3476 (fcast_or_absdcl): New nonterminal to implement late reduction of
3477 constructs like `A()()()()'.
3478 (typename): Replace `typespec absdcl1' rule with
3479 `typespec direct_abstract_declarator' rule.
3480 (direct_abstract_declarator): Replace `LEFT_RIGHT type_quals' rule
3481 with `fcast_or_absdcl type_quals' rule.
3482
3483Fri Mar 4 16:18:03 1994 Mike Stump (mrs@cygnus.com)
3484
3485 * tree.c (lvalue_p): Improve OFFSET_REF handling, so that it
3486 matches Section 5.5.
3487
3488Fri Mar 4 14:01:59 1994 Jason Merrill (jason@deneb.cygnus.com)
3489
3490 * error.c (dump_type_prefix): Don't print basetype twice for
3491 pmfs.
3492
3493Fri Mar 4 13:24:33 1994 Mike Stump (mrs@cygnus.com)
3494
3495 * typeck.c (convert_arguments): Handle setHandler(A::handlerFn)
3496 so that it is like setHandler(&A::handlerFn). Cures an `invalid
3497 lvalue in unary `&''.
3498
3499Fri Mar 4 11:15:59 1994 Jason Merrill (jason@deneb.cygnus.com)
3500
3501 * gxxint.texi (Copying Objects): New section discussing default
3502 op= problems with virtual inheritance.
3503
3504 * decl2.c (grokoptypename): Just does grokdeclarator and
3505 build_typename_overload, since the parser can't call grokdeclarator
3506 directly.
3507
3508 * method.c (build_typename_overload): Set IDENTIFIER_GLOBAL_VALUE
3509 and TREE_TYPE on generated identifiers.
3510
3511 * decl.c (grokdeclarator): Don't deal with TYPE_EXPRs anymore.
3512
3513 * parse.y (parm): Convert `const char *' to `__opPCc' here.
3514
3515 * error.c (dump_decl): Say sorry rather than my_friendly_aborting
3516 if we can't figure out what to do.
3517 (dump_type*): Ditto.
3518
3519 * typeck2.c (build_m_component_ref): 'component' is an expr, not
3520 a decl. Also move the IS_AGGR_TYPE check after the stripping of
3521 REFERENCE_TYPE.
3522
3523Fri Mar 4 04:46:05 1994 Mike Stump (mrs@cygnus.com)
3524
3525 * call.c (build_method_call): Handle b->setHandler(A::handlerFn)
3526 so that it is like b->setHandler(&A::handlerFn). Cures an `invalid
3527 lvalue in unary `&''.
3528
3529Thu Mar 3 12:38:15 1994 Jason Merrill (jason@deneb.cygnus.com)
3530
3531 * parse.y: Add precedence specification for START_DECLARATOR.
3532 (type_quals): Move before primary.
3533 (typename): Move before typed_declspecs, add 'typespec absdcl1' rule.
3534
3535 * decl2.c (grokoptypename): Lose.
3536
3537 * decl.c (grokdeclarator): Parse TYPE_EXPRs in the initial scan,
3538 rather than waiting until later.
3539
3540Wed Mar 2 14:12:23 1994 Jason Merrill (jason@deneb.cygnus.com)
3541
3542 * parse.y (unary_expr): Use 'typename' in 'new' rules, rather
3543 than expanding it inline.
3544 (typename): Expand empty option of (former) absdcl inline.
3545 (abs_or_notype_decl): Ditto.
3546 (absdcl): Lose empty rule.
3547 (conversion_declarator): New nonterminal for 'typename' of 'operator
3548 typename'.
3549 (operator_name): Use it instead of absdcl.
3550
3551 * parse.y: Add precedence declarations for SCOPED_TYPENAME,
3552 TYPEOF, and SIGOF.
3553 (typed_declspecs): Accept typed_typespecs, rather than typespec
3554 directly. Add rules with reserved_typespecquals.
3555 (reserved_declspecs): Don't accept typespecqual_reserved at the
3556 beginning of the list. The typed_declspecs rule will deal with this
3557 omission.
3558 (declmods): Accept nonempty_type_quals, rather than TYPE_QUAL
3559 directly.
3560
3561 * parse.y (direct_notype_declarator,
3562 direct_after_type_declarator, direct_abstract_declarator): Split up
3563 the declarator1 nonterminals to match the draft standard and avoid
3564 ambiguities.
3565 (new_type_id, new_declarator, direct_new_declarator,
3566 new_member_declarator): New nonterminals to implement the subset of
3567 'typename' allowed in new expressions.
3568 (unary_expr): Use new_type_id instead of typename.
3569 (after_type_declarator1, absdcl1): Fix semantics of member pointers.
3570 (abs_member_declarator, after_type_member_declarator): Lose.
3571
3572 * parse.y (absdcl1): Don't require parens around
3573 abs_member_declarator.
3574 (abs_member_declarator): Lose see_typename from rules.
3575 (after_type_member_declarator): Ditto.
3576
3577 * tree.c (get_identifier_list): New function, containing code
3578 previously duplicated in get_decl_list and list_hash_lookup_or_cons.
3579 (get_decl_list): Use it.
3580 (list_hash_lookup_or_cons): Ditto.
3581
3582 * parse.y (typed_declspecs, declmods): It's not necessary to hash
3583 the declspecs on class_obstack, so don't. This way typed_typespecs
3584 can reduce to typed_declspecs.
3585
3586Wed Mar 2 14:29:18 1994 Jason Merrill (jason@cygnus.com)
3587
3588 * cvt.c (build_up_reference): If we aren't checking visibility,
3589 also allow base->derived conversions.
3590
3591Mon Feb 28 15:14:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
3592
3593 * typeck.c (build_c_cast): Remove bogus hack when converting
3594 to a reference type.
3595
3596 * cp-tree.h (lang_decl::vbase_init_list, DECL_VBASE_INIT_LIST):
3597 Removed, not used.
3598 (lang_stype::methods, lang_decl::next_method): New fields.
3599 (CLASSTYPE_METHODS, DECL_NEXT_METHOD): New macros.
3600 * decl.c (duplicate_decls): Preserve DECL_NEXT_METHOD.
3601
3602 * cp-tree.h, decl2.c (flag_vtable_hack): New flag.
3603 * decl2.c (finish_vtable_vardecl): If flag_vtable_hack,
3604 and !CLASSTYPE_INTERFACE_KNOWN, try to use the presence of
3605 a non-inline virtual function to control emitting of vtables.
3606 * class.c (finish_struct): Build CLASSTYPE_METHODS list.
3607 * search.c (build_vbase_vtables_init): Don't assemble_external
3608 (yet) if flag_vtable_hack.
3609 * class.c (build_vfn_ref): Ditto.
3610
3611Mon Feb 28 14:54:13 1994 Jason Merrill (jason@deneb.cygnus.com)
3612
3613 * parse.y (component_decl): Don't include "typed_declspecs
3614 declarator ';'" speedup, since it breaks enums.
3615
3616Fri Feb 25 15:43:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
3617
3618 * class.c (finish_struct): Minor optimization for building
3619 fn_fields list.
3620
3621Fri Feb 25 15:23:42 1994 Jason Merrill (jason@deneb.cygnus.com)
3622
3623 * decl.c (start_function): Fix detection of function overloading.
3624
3625Thu Feb 24 22:26:19 1994 Mike Stump (mrs@cygnus.com)
3626
3627 * lex.c (check_newline): #pragma interface can take a string
3628 argument, just like #pragma implementation. #pragma implementation
3629 checks for garbage on the line, line #pragma interface does. Main
3630 input files do not auto implement like named files, #pragma
3631 implementation must be used explicitly.
3632
3633Thu Feb 24 17:09:01 1994 Jason Merrill (jason@deneb.cygnus.com)
3634
3635 * parse.y (components): Handle list of one again.
3636 (notype_components): Ditto.
3637 (after_type_declarator1): Take maybe_raises out again.
3638
3639 * gxxint.texi (Parser): Document additional r/r conflict.
3640
3641Wed Feb 23 14:42:55 1994 Jason Merrill (jason@deneb.cygnus.com)
3642
3643 * gxxint.texi (Parser): Add node.
3644
3645 * Makefile.in (stamp-parse): Update expected conflict count.
3646
3647 * parse.y (various): Replace "declmods declarator" with "declmods
3648 notype_declarator". The comment saying that "declmods declarator ';'"
3649 corresponds to "int i;" was wrong; it corresponds to "const i;".
3650 (component_decl): Add "typed_declspecs declarator ';'" rule; this
3651 *does* correspond to "int i;". Change "declmods components" to
3652 "declmods notype_components".
3653 (components): Don't deal with a list of one anymore.
3654 (notype_components): New nonterminal, corresponds to notype_declarator.
3655 ({after_,no}type_component_decl{,0}): More new nonterminals.
3656 ({after_,no}type_declarator): Fold in START_DECLARATOR token.
3657 Eliminates four reduce/reduce conflicts.
3658
3659 (expr): Depend on nontrivial_exprlist instead of nonnull_exprlist.
3660 (nontrivial_exprlist): New nonterminal: A list of at least two
3661 expr_no_commas's.
3662 (nonnull_exprlist): Depend on nontrival_exprlist.
3663 Eliminates four reduce/reduce conflicts.
3664
3665 (named_class_head): Move intermediate code block into separate
3666 nonterminal so that we can stick %prec EMPTY on it.
3667
3668 Add more %prec EMPTY's to eliminate remaining shift/reduce
3669 conflicts.
3670
3671 (after_type_declarator): Add maybe_raises to fndecl rules.
3672 (after_type_declarator_no_typename): Remove.
3673 For correctness.
3674
3675 Document remaining reduce/reduce conflicts.
3676
3677Tue Feb 22 12:10:32 1994 Jason Merrill (jason@deneb.cygnus.com)
3678
3679 * search.c (get_base_distance): Only bash BINFO_INHERITANCE_CHAIN
3680 (TYPE_BINFO (type)) if we care about the path.
3681
3682 * tree.c (lvalue_p): A COND_EXPR is an lvalue if both of the
3683 options are.
3684
3685Mon Feb 21 19:59:40 1994 Mike Stump (mrs@cygnus.com)
3686
3687 * Makefile.in (mostlyclean): lex.c is a source file, don't
3688 remove.
3689
3690Sat Feb 19 01:27:14 1994 Jason Merrill (jason@deneb.cygnus.com)
3691
3692 * parse.y: Eliminate 20 shift/reduce conflicts.
3693
3694Fri Feb 18 11:49:42 1994 Jason Merrill (jason@deneb.cygnus.com)
3695
3696 * pt.c (type_unification): Add subr argument; if set, it means
3697 that we are calling ourselves recursively, so a partial match is OK.
3698 (unify): Support pointers to methods and functions.
3699 (tsubst): Support method pointers.
3700 * decl.c (build_ptrmemfunc_type): No longer static, so that
3701 tsubst can get at it.
3702
3703 * init.c (is_aggr_typedef): Pretend template type parms are
3704 aggregates.
3705 * decl2.c (build_push_scope): If cname refers to a template type
3706 parm, just grin and nod.
3707
3708 * call.c (build_overload_call_real): Pass subr argument to
3709 type_unification.
3710 * pt.c (do_function_instantiation): Ditto.
3711 * class.c (instantiate_type): Ditto.
3712
3713 * search.c (get_base_distance): If BINFO is a binfo, use it and
3714 don't mess with its BINFO_INHERITANCE_CHAIN.
3715
3716 * cvt.c (convert_to_reference): Fix temporary generation.
3717 If ambiguous, return error_mark_node.
3718
3719 * init.c (build_new): Put back some necessary code.
3720
3721Thu Feb 17 15:39:47 1994 Jason Merrill (jason@deneb.cygnus.com)
3722
3723 * init.c (build_new): Deal with array types properly.
3724
3725 * search.c (get_binfo): Become a shell for get_base_distance.
3726 (get_binfo_recursive): Lose.
3727 (get_base_distance_recursive): Find the path to the via_virtual base
3728 that provides the most access.
3729 (get_base_distance): Ditto.
3730
3731 * parse.y (explicit_instantiation): Syntax is 'template class
3732 A<int>', not 'template A<int>'.
3733
3734 * typeck.c (convert_for_initialization): Remove bogus warning.
3735
3736 * parse.y (datadef): Revert patch of Oct 27.
3737
3738Thu Feb 17 15:12:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
3739
3740 * class.c (build_vfn_ref): Cast delta field to ptrdiff_type_node,
3741 rather than integer_type_node. Does wonders for the Alpha.
3742
3743Thu Feb 17 13:36:21 1994 Jason Merrill (jason@deneb.cygnus.com)
3744
3745 * decl.c (build_ptrmemfunc_type): Make sure that the pmf type
3746 goes onto the same obstack as its target type.
3747
3748Wed Feb 16 00:34:46 1994 Jason Merrill (jason@deneb.cygnus.com)
3749
3750 * cvt.c (convert_to_reference): If converting via constructor
3751 on local level, go back to build_cplus_new approach.
3752
3753 * tree.c (build_cplus_new): If with_cleanup_p, set cleanup slot
3754 to error_mark_node to prevent expand_expr from building a cleanup
3755 for this variable.
3756
3757 * lex.c (default_assign_ref_body): Return *this from the memcpy
3758 version, too.
3759
3760 * decl.c (grok_reference_init): Just return if called with
3761 error_mark_node, don't worry about initializing non-const reference
3762 with temporary.
3763
3764 * cvt.c (convert_to_reference): Do the right thing for
3765 non-aggregate reference conversions, pedwarn when generating a
3766 non-const reference to a temporary.
3767
3768 * class.c (finish_struct): TYPE_HAS_COMPLEX_{INIT,ASSIGN}_REF and
3769 TYPE_NEEDS_CONSTRUCTING all depend on TYPE_USES_VIRTUAL_BASECLASSES
3770 again.
3771
3772Tue Feb 15 19:47:19 1994 Jason Merrill (jason@deneb.cygnus.com)
3773
3774 * decl.c (grok_reference_init): Pawn off a lot of the work on
3775 convert_to_reference. Generally do the right thing.
3776
3777 * cvt.c (convert_to_reference): Conform to the initial comment;
3778 i.e. don't create temps if decl != error_mark_node. Handle
3779 cleanups better for temps that do get created. Don't pretend
3780 that we can use an 'A' to initialize a 'const double &' just by
3781 tacking on a NOP_EXPR. Support LOOKUP_SPECULATIVELY.
3782
3783 * call.c (build_method_call): Set TREE_HAS_CONSTRUCTOR on
3784 constructor calls.
3785
3786Mon Feb 14 14:50:17 1994 Jason Merrill (jason@deneb.cygnus.com)
3787
3788 * decl.c (grok_reference_init): Make a temporary for initializing
3789 const reference from constant expression.
3790
3791Mon Feb 14 11:31:31 1994 Per Bothner (bothner@kalessin.cygnus.com)
3792
3793 * cp-tree.h, decl.c (set_identifier_local_value): Deleted function.
3794 * decl.c (pushdecl): Define decl in correct binding_level
3795 (which isn't always the inner_binding_level).
3796
3797 * cvt.c (build_up_reference): Don't ever call expand_aggr_init.
3798 It's ugly, and I don't think it's the right thing to do.
3799
3800 * cp-tree.h, class.c, decl.c, decl2.c, sp/search.c:
3801 Remove NEW_CLASS_SCOPING, assuming it is always 1.
3802 * decl.c (pop_decl_level): Removed; manually inlined.
3803
3804Sun Feb 13 19:04:56 1994 Jason Merrill (jason@deneb.cygnus.com)
3805
3806 * class.h (candidate): Add basetypes field.
3807
3808 * call.c (build_method_call): Do access checking after choosing a
3809 function, not before.
3810
3811 * Makefile.in (cvt.o, call.o, method.o): Depend on class.h.
3812 (mostlyclean): Remove ../cc1plus.
3813
3814Fri Feb 11 11:52:26 1994 Jason Merrill (jason@deneb.cygnus.com)
3815
3816 * class.c (finish_struct): Don't allow adjusting access to a field
3817 of a base class if a local field has the same name.
3818
3819 * error.c (dump_type_prefix): Output basetype for METHOD_TYPEs.
3820
3821hu Jan 13 17:55:51 EST 1994 Gnanasekaran Swaminathan (gs4t@virginia.edu)
3822
63718c49 3823 * cp-tree.h (DESTRUCTOR_NAME_P): do not confuse AUTO_TEMP names
7177d104
MS
3824 with destructor names when either NO_DOLLAR_IN_LABEL or
3825 NO_DOT_IN_LABEL are not defined.
3826
3827 Now `template <class T, T f(T&), const T*> class A {...}' works.
3828
3829 * pt.c (grok_template_type): substitute template parm types
3830 with actual types in complex type as well.
3831 (coerce_template_parms): update the grok_template_type ()
3832 function call.
3833
3834 * pt.c (tsubst): Traverse method list using DECL_CHAIN.
3835
3836 * decl.c (grok_op_properties): Allow operator++/-- to have
3837 default arguments.
3838
3839 * typeck2.c (store_init_value): Don't abort when called to
3840 initialize a type that needs constructing with a CONSTRUCTOR.
3841
3842 * init.c (expand_aggr_init_1, CONSTRUCTOR case): If
3843 store_init_value fails, build and expand an INIT_EXPR. If
3844 store_init_value succeeds, call expand_decl_init.
3845
3846Fri Feb 11 02:49:23 1994 Mike Stump (mrs@cygnus.com)
3847
3848 * class.c (build_vbase_path): Use complete_type_p instead of
3849 resolves_to_fixed_type_p to determine if the virtual bases are in
3850 their right place for the type of expr. Cures problem of thinking a
3851 virtual base class is one place, when it is in fact someplace else.
3852
3853Fri Feb 11 00:26:46 1994 Mike Stump (mrs@cygnus.com)
3854
3855 * init.c (resolve_offset_ref): Make sure we first convert to
3856 intermediate type, if given, when dealing with members off `this'.
3857 Solves an incorrrect `type `foo' is not a base type for type
3858 `multiple'' when it is infact, a base type.
3859
3860Thu Feb 10 21:49:35 1994 Mike Stump (mrs@cygnus.com)
3861
3862 * class.c (modify_other_vtable_entries): Use get_binfo, instead
3863 of binfo_value. Solves problem with compiler giving a `base class
3864 `B' ambiguous in binfo_value (compiler error)' on complex MI
3865 herarchies, when a virtual function is first defied in a virtual
3866 base class.
3867
3868Thu Feb 10 17:19:32 1994 Mike Stump (mrs@cygnus.com)
3869
3870 * class.c (build_vbase_path): Don't complain about ambiguous
3871 intermediate conversion when converting down to a virtual base
3872 class, even if they might seem to be ambiguous.
3873
3874Thu Feb 10 12:18:26 1994 Jason Merrill (jason@deneb.cygnus.com)
3875
3876 * typeck2.c (build_functional_cast): #if 0 out constructor
3877 inheritance code, improve error messages.
3878
3879 * class.c (finish_base_struct): Complain about base with only
3880 non-default constructors in derived class with no constructors.
3881
3882 * decl.c (grokdeclarator): Fix detection of virtual new/delete.
3883
3884Wed Feb 9 22:02:32 1994 Mike Stump (mrs@cygnus.com)
3885
3886 * search.c (build_mi_virtuals, add_mi_virtuals,
3887 report_ambiguous_mi_virtuals): Removed unneeded code.
3888 * class.c (finish_struct_bits): Ditto.
3889
3890Wed Feb 9 11:27:17 1994 Jason Merrill (jason@deneb.cygnus.com)
3891
3892 * pt.c (end_template_instantiation): Push decl before
3893 pop_from_top_level.
3894
3895 * typeck2.c (build_m_component_ref): Make sure datum is of
3896 aggregate type.
3897
3898 * init.c (get_type_value): New function, returns
3899 IDENTIFIER_TYPE_VALUE or IDENTIFIER_CLASS_TYPE_VALUE or NULL_TREE.
3900
3901 * call.c (build_method_call): Don't die on call to destructor for
3902 non-type.
3903
3904 * decl.c (grokdeclarator): Complain about virtual op new and op
3905 delete, make static virtuals unvirtual instead of unstatic.
3906
3907 * typeck.c (build_c_cast): Also call default_conversion on
3908 methods.
3909
3910 * decl.c (grokdeclarator): Don't complain about anonymous
3911 bitfields.
3912
3913 * parse.y (simple_stmt, for loops): Move the continue point after
3914 the cleanups.
3915
3916 * class.c (finish_struct): Fix setting of
3917 TYPE_HAS_COMPLEX_INIT_REF.
3918
3919Tue Feb 8 13:21:40 1994 Jason Merrill (jason@deneb.cygnus.com)
3920
3921 * init.c (build_new): Deal with `new double (1)'.
3922
3923 * class.c (finish_struct): TYPE_HAS_COMPLEX_*_REF are supersets of
3924 TYPE_HAS_REAL_*_REF, but TYPE_HAS_COMPLEX_INIT_REF is independent of
3925 TYPE_NEEDS_CONSTRUCTING.
3926
3927 * decl.c (duplicate_decls): Propagate access decls.
3928
3929 * typeck2.c (process_init_constructor): Accept empty_init_node
3930 for initializing unions.
3931
3932 * class.c, lex.c, cp-tree.h: Use
3933 TYPE_HAS_COMPLEX_ASSIGN_REF where TYPE_HAS_REAL_ASSIGN_REF was used
3934 before, use TYPE_HAS_COMPLEX_INIT_REF for TYPE_NEEDS_CONSTRUCTING in
3935 some places.
3936
3937 * decl.c (finish_decl): Don't complain about uninitialized const
3938 if it was initialized before.
3939
3940Mon Feb 7 18:12:34 1994 Jason Merrill (jason@deneb.cygnus.com)
3941
3942 * lex.c (default_assign_ref_body): Don't deal with vbases for
3943 now.
3944
3945 * decl.c (finish_decl): Fix reversed logic for objects and other
3946 things that need to be constructed but have no initializer.
3947
3948 * class.c (finish_struct): Don't set TYPE_HAS_* flags that are
3949 set by grok_op_properties or finish_decl.
3950
3951 * decl.c: Don't warn about extern redeclared inline unless
3952 -Wextern-inline is given.
3953 * decl2.c (lang_decode_option): Ditto.
3954 * cp-tree.h: Ditto.
3955
3956Mon Feb 7 17:29:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
3957
3958 * decl.c (pushdecl_with_scope): Fix thinko. Add forward
3959 declaration.
3960
3961 * decl.c (pushdecl_with_scope): New function.
3962 * decl.c (pushdecl_top_level): Use new function.
3963 * decl.c (pushtag): Initialize newdecl.
3964 * decl.c (pushtag): Push new type decl into correct scope.
3965
3966Mon Feb 7 14:42:03 1994 Jason Merrill (jason@deneb.cygnus.com)
3967
3968 * call.c, cvt.c, init.c, search.c, cp-tree.h:
3969 Eradicate LOOKUP_PROTECTED_OK.
3970
3971Mon Feb 7 13:57:19 1994 Per Bothner (bothner@kalessin.cygnus.com)
3972
3973 * decl.c (pushtag, xref_tag), cp-tree.h: Add extra parameter
3974 'globalize' to signify implicit declarations.
3975 * decl.c (globalize_nested_type, maybe_globalize_type): Removed.
3976 * decl.c (set_identifier_type_value_with_scope): New function.
3977 * decl.c (set_identifier_local_value): Simplify.
3978 * spew.c (yylex, do_addr): Modify to return a _DEFN if a
3979 forward declaration (followed by ';' and not preceded by 'friend').
3980 * class.c, decl.c, except.c, init.c, parse.y,
3981 pt.c, search.c: Add new argument to calls to xref_tag and
3982 pushtag.
3983
3984Mon Feb 7 00:22:59 1994 Jason Merrill (jason@deneb.cygnus.com)
3985
3986 * cp-tree.h (ACCESSIBLY_UNIQUELY_DERIVED_P): New macro, means what
3987 ACCESSIBLY_DERIVED_FROM_P meant before.
3988 (ACCESSIBLY_DERIVED_FROM_P): Now disregards ambiguity.
3989
3990 * cvt.c (build_up_reference): Call get_binfo with PROTECT == 1.
3991
3992 * search.c (get_base_distance_recursive): Members and friends of
3993 a class X can implicitly convert an X* to a pointer to a private or
3994 protected immediate base class of X.
3995 (get_binfo_recursive): Ditto.
3996 (get_base_distance): Ignore ambiguity if PROTECT < 0.
3997 (get_binfo): Lose multiple values of PROTECT.
3998 (compute_access): Protected is OK if the start of the
3999 search is an accessible base class of current_class_type.
4000
4001 * method.c (build_opfncall): Do check access on operator new here.
4002
4003 * decl.c (finish_function): Don't check access on operator new
4004 here.
4005
4006Sun Feb 6 14:06:58 1994 Jason Merrill (jason@deneb.cygnus.com)
4007
4008 * decl.c (xref_tag): The base of a derived struct is NOT always
4009 public. Duh.
4010
4011 * pt.c (do_explicit_instantiation): New function, called from
4012 parser to do explicit function instantiation.
4013 (type_unification): Allow the args list to be terminated with
4014 void_list_node.
4015 (do_pending_expansions): Look at i->interface for non-member
4016 templates.
4017
4018 * parse.y (datadef): Move explicit_instantiation here.
4019 (structsp): From here.
4020 (datadef): Complain about `int;'.
4021
4022Sun Feb 6 12:33:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
4023
4024 * pt.c (end_template_instantiation), cp-tree.h: Remove unused
4025 second parameter, and simplify first from a TREE_LIST where
4026 we only care about its TREE_VALUE to just the value (an IDENTIFIER).
4027 * pt.c (instantiate_member_templates): Simplify argument list
4028 from a TREE_LIST to just an IDENTIFIER.
4029 * lex.c (yyprint): PRE_PARSED_CLASS_DECL is now just an IDENTIFIER.
4030 * parse.y (template_instantiate_once): Simplify accordingly.
4031 * decl.c (inner_binding_level): New. Use various places to
4032 simplify.
4033
4034Sun Feb 6 02:49:37 1994 Jason Merrill (jason@deneb.cygnus.com)
4035
4036 * typeck2.c (build_functional_cast): int() -> int(0).
4037
4038Sat Feb 5 00:53:21 1994 Jason Merrill (jason@deneb.cygnus.com)
4039
4040 * class.c (finish_struct): Don't do a bitwise copy for op= if the
4041 class has a virtual function table.
4042
4043 * typeck.c (convert_for_initialization): Restore warnings about
4044 not using defined op=. Should really be my_friendly_aborts, I
4045 s'pose.
4046
4047Fri Feb 4 14:21:00 1994 Jason Merrill (jason@deneb.cygnus.com)
4048
4049 * class.c (finish_struct): Tidy up conditions for doing bitwise
4050 copies of objects.
4051
4052 * decl.c (build_default_constructor): #if 0 out.
4053
4054 * *: Eradicate TYPE_GETS_{ASSIGNMENT,ASSIGN_REF,CONST_ASSIGN_REF,
4055 CONST_INIT_REF}, TYPE_HAS_REAL_CONSTRUCTOR.
4056
4057 * decl.c (grokdeclarator): Don't return void_type_node for
4058 friends being defined here.
4059
4060 * init.c (perform_member_init): Only do the init if it's useful.
4061
4062 * lex.c (default_copy_constructor_body): If we don't need to do
4063 memberwise init, just call __builtin_memcpy.
4064 (default_assign_ref_body): Ditto.
4065
4066 * decl.c (grokdeclarator): If friendp && virtualp, friendp = 0.
4067
4068Fri Feb 4 13:02:56 1994 Mike Stump (mrs@cygnus.com)
4069
4070 * lex.c (reinit_parse_for_method, cons_up_default_function):
4071 Don't give warn_if_unknown_interface warning when it came from a
4072 system header file.
4073 * pt.c (end_template_decl, instantiate_template): Ditto.
4074 * decl.c (start_decl): Ditto.
4075
4076Fri Feb 4 00:41:21 1994 Jason Merrill (jason@deneb.cygnus.com)
4077
4078 * decl.c (grokdeclarator): Don't try to set TYPE_WAS_ANONYMOUS on
4079 enums.
4080
4081 * decl2.c (constructor_name_full): Use IS_AGGR_TYPE_CODE instead of
4082 IS_AGGR_TYPE, since we don't know it's a type.
4083
4084Thu Feb 3 11:36:46 1994 Jason Merrill (jason@deneb.cygnus.com)
4085
4086 * decl.c (grokdeclarator): Don't complain about anonymous unions.
4087
4088 * cp-tree.h (TYPE_WAS_ANONYMOUS): This struct was originally
4089 anonymous, but had a name given to it by a typedef.
4090
4091 * decl.c (grokdeclarator): When renaming an anonymous struct, set
4092 TYPE_WAS_ANONYMOUS.
4093
4094 * decl2.c (constructor_name_full): Use TYPE_WAS_ANONYMOUS.
4095
4096 * cp-tree.h (DECL_UNDEFINED_FRIENDS): #if 0 out.
4097
4098 * init.c (xref_friend): Don't set up DECL_UNDEFINED_FRIENDS.
4099 (embrace_waiting_friends): Don't use DECL_UNDEFINED_FRIENDS.
4100
4101 * decl.c (grokdeclarator): Set TYPE_NESTED_NAME properly on nested
4102 anonymous structs that get typedef'd.
4103
4104 * decl.c (grokdeclarator): Always return void_type_node for
4105 friends.
4106
4107 * error.c (dump_function_decl): Don't use DECL_CLASS_CONTEXT for
4108 friends.
4109 (dump_function_decl): Don't print out default args for
4110 a function used in an expression.
4111
4112 * decl.c (grokdeclarator): Give error on abstract declarator used
4113 in an invalid context (i.e. `void (*)();').
4114
4115 * error.c (cp_line_of): Support _TYPE nodes.
4116 (cp_file_of): Ditto.
4117
4118 * cvt.c (build_up_reference): Don't abort if passed a SAVE_EXPR;
4119 it can happen for the RHS of an assignment stmt where the LHS is
4120 a COND_EXPR.
4121
4122 * init.c (expand_aggr_init_1): Deal with bracketed initializer
4123 lists properly.
4124
4125 * class.c (finish_struct): Deal with enumerators and typedefs
4126 again.
4127
4128Wed Feb 2 11:30:22 1994 Jason Merrill (jason@deneb.cygnus.com)
4129
4130 * class.c (finish_struct): Tidy up loop over fields.
4131
4132 * errfn.c (cp_thing): Don't advance twice after a format.
4133
4134 * class.c (finish_struct): Complain about needing a constructor
4135 if a member has only non-default constructors, and don't try to
4136 generate a default constructor.
4137
4138 * decl.c (finish_decl): Also do the constructor thing if
4139 TYPE_NEEDS_CONSTRUCTING is set (for arrays).
4140
4141 * search.c (unuse_fields): New function: mark all fields in this
4142 type unused.
4143 (dfs_unuse_fields): Helper function.
4144
4145 * class.c (pushclass): If the new class is the same as the old
4146 class, still unuse the fields.
4147 (unuse_fields): Move to search.c.
4148
4149 * decl.c (grok_op_properties): Add friendp argument.
4150 (grokfndecl): Pass it.
4151 (start_method): Ditto.
4152
4153 * decl2.c (delete_sanity): Add use_global_delete parameter to catch
4154 ::delete calls.
4155
4156 * parse.y (unary_expr): Pass new parameter to delete_sanity.
4157
4158 * lex.c (default_copy_constructor_body): Don't choke if the union
4159 has no fields.
4160 (default_assign_ref_body): Ditto.
4161
4162 * call.c (compute_conversion_costs_ansi): Do the right thing for
4163 ellipsis matches.
4164
4165 * decl.c (push_to_top_level): Optimize.
4166
4167 * decl.c (start_function): Look for the lexical scope of a friend
4168 in DECL_CLASS_CONTEXT.
4169
4170 * init.c (do_friend): Set DECL_CLASS_CONTEXT on global friends.
4171
4172Tue Feb 1 15:59:24 1994 Jason Merrill (jason@deneb.cygnus.com)
4173
4174 * cp-tree.h (TREE_GETS_PLACED_NEW): New macro.
4175
4176 * init.c (init_init_processing): Don't assign BIN/BID to the
4177 IDENTIFIER_GLOBAL_VALUEs of their respective operators.
4178 (build_new): Check TREE_GETS_PLACED_NEW.
4179
4180 * decl.c (grok_op_properties): Don't set TREE_GETS_NEW for a decl of
4181 op new with placement, set TREE_GETS_PLACED_NEW.
4182
4183 * cp-tree.h (ANON_UNION_P): New macro. Applies to decls.
4184
4185 * class.c (finish_struct): Don't treat anonymous unions like
4186 other aggregate members. Do synthesize methods for unions without
4187 a name, since they may or may not be "anonymous unions".
4188
4189 * decl2.c (grok_x_components): Wipe out memory of synthesized methods
4190 in anonymous unions.
4191
4192 * lex.c (default_copy_constructor_body): Support unions.
4193 (default_assign_ref_body): Ditto.
4194
4195Mon Jan 31 12:07:30 1994 Jason Merrill (jason@deneb.cygnus.com)
4196
4197 * cp-tree.h: Fix documentation of LOOKUP_GLOBAL, add prototypes.
4198
4199 * error.c (args_as_string): New function (%A), like type_as_string
4200 except NULL_TREE -> "..."
4201
4202 * call.c (build_overload_call_real): Fix for new overloading.
4203
4204 * decl.c (grok_op_properties): Set all of the TYPE_OVERLOADS_* flags
4205 here.
4206
4207 * parse.y (operator_name): Instead of here.
4208
4209 * typeck2.c (build_functional_cast): Treat a TREE_LIST as a list
4210 of functions.
4211
4212 * call.c (build_overload_call_real): Support LOOKUP_SPECULATIVELY.
4213
4214 * method.c (build_opfncall): Don't need to massage return value
4215 any more, call build_overload_call with all flags.
4216
4217 * typeck.c (build_x_binary_op): Put back speculative call to
4218 build_opfncall.
4219 (build_x_unary_op): Ditto.
4220 (build_x_conditional_expr): Ditto.
4221
4222Mon Jan 31 10:00:30 1994 Mike Stump (mrs@cygnus.com)
4223
4224 * cvt.c (build_type_conversion_1): Change call to pedwarn into
4225 warning, and conditionalize upon warn_cast_qual.
4226
4227Fri Jan 28 11:48:15 1994 Jason Merrill (jason@deneb.cygnus.com)
4228
4229 * search.c (lookup_field): If xbasetype is a binfo, copy it to
4230 avoid clobbering its inheritance info.
4231
4232 * call.c (build_method_call): Don't overwrite basetype_path with
4233 TYPE_BINFO (inst_ptr_basetype) if they have the same type.
4234
4235 * search.c (compute_access): Fix handling of protected inheritance
4236 and friendship with the enclosing class.
4237
4238 * typeck2.c (store_init_value): Allow passing of TREE_CHAIN for
4239 initialization of arbitrary variable.
4240
4241 * typeck2.c (build_functional_cast): Only try calling a method if
4242 one exists.
4243
4244 * decl.c (grokdeclarator): Move handling of constructor syntax
4245 initialization into first loop for generality.
4246 (parmlist_is_random): Lose.
4247
4248 * lex.c (cons_up_default_function): Set TREE_PARMLIST on arguments
4249 to default function.
4250
4251Thu Jan 27 19:26:51 1994 Jason Merrill (jason@deneb.cygnus.com)
4252
4253 * decl.c (grokparms): Abort if we get called with something we don't
4254 expect.
4255
4256Thu Jan 27 17:37:25 1994 Mike Stump (mrs@cygnus.com)
4257
4258 * call.c (build_overload_call_real): Change argument complain to
4259 flags to match style of rest of code. Pass it down to
4260 build_function_call_real as necessary.
4261 * call.c (build_overload_call, build_overload_call_maybe): Change
4262 argument complain to flags to match style of rest of code.
4263 * cp-tree.h (build_function_call_real): Added fourth flags
4264 argument.
4265 * cvt.c (convert_to_reference): Only give warning messages, if
4266 LOOKUP_COMPLAIN is set.
4267 * typeck.c (build_x_function_call): Change simple complain
4268 argument to build_overload_call_maybe and build_overload_call, to
4269 LOOKUP_COMPLAIN to match style of rest of code.
4270 * typeck2.c (build_functional_cast): Ditto.
4271 * typeck.c (build_function_call_real): Add flags, so that we can
4272 not complain, if we don't want to complain. Complain about
4273 arguments, if we are complaining, otherwise don't.
4274 * typeck.c (build_function_call, build_function_call_maybe):
4275 Stick in flags argument.
4276 * typeck.c (build_x_binary_op, build_x_unary_op,
4277 build_x_conditional_expr, build_x_compound_expr): Follow style of
4278 build_x_indirect_ref, as it is more correct and more common.
4279
4280Thu Jan 27 14:36:20 1994 Jason Merrill (jason@deneb.cygnus.com)
4281
4282 * call.c (build_method_call): Don't check for being called with
4283 a pointer.
4284
4285 * decl2.c (finish_file): Don't play with DECL_CLASS_CONTEXT for the
4286 static initializer function.
4287
4288 * init.c (build_member_call): Use convert_force here, too.
4289
4290 * search.c (compute_access): Only treat static members specially
4291 if they are referenced directly.
4292
4293Wed Jan 26 18:28:14 1994 Jason Merrill (jason@deneb.cygnus.com)
4294
4295 * gxxint.texi (Access Control): New node.
4296
4297 * search.c (current_scope): New function; returns whichever of
4298 current_class_type and current_function_decl is the most nested.
4299 (compute_access): Total overhaul to make it clearer and more
4300 correct. Don't use the cache for now; in the only situation where
4301 it was used before, it gained nothing. This frees up three of the
4302 DECL_LANG_FLAGs for possible other use!
4303
4304 * cp-tree.h: #if 0 out DECL_PUBLIC & friends.
4305
4306 * typeck.c (build_component_ref_1): Don't check DECL_PUBLIC.
4307
4308 * call.c (build_method_call): Use convert_force to cast `this' --
4309 rely on the access checking for the method itself.
4310
4311 * init.c (is_friend): Do the nesting thing, handle types. I am
4312 my own friend.
4313 (is_friend_type): Become a shell for is_friend.
4314 (add_friend): Never stick in ctype.
4315 Why are the friendship functions in init.c, anyway?
4316
4317Wed Jan 26 17:50:00 1994 Mike Stump (mrs@cygnus.com)
4318
4319 * cvt.c (build_type_conversion_1): Don't conditionalize call to
4320 pedwarn upon pedantic.
4321
4322Wed Jan 26 17:20:46 1994 Mike Stump (mrs@cygnus.com)
4323
4324 * cvt.c (convert_to_reference): Add 8.4.3 checking so that one
4325 gets a warning if one tries to initialize a non-const & from a
4326 non-lvalue.
4327 * cvt.c (convert_to_reference): Use %P format for argument
4328 numbers in warnings.
4329
4330Wed Jan 26 14:35:06 1994 Mike Stump (mrs@cygnus.com)
4331
4332 * init.c (build_delete): Follow style in call.c to construct the
4333 virtual call to the desctructor, as that code is right. Fixes a
4334 problem of the compiler saying a pointer conversion is ambiguous.
4335
4336Wed Jan 26 11:28:14 1994 Jason Merrill (jason@deneb.cygnus.com)
4337
4338 * cp-tree.h (VTABLE_NAME_P): Change other occurrence of
4339 VTABLE_NAME_FORMAT to VTABLE_NAME.
4340
4341 * *: s/visibility/access/g
4342
4343Tue Jan 25 18:39:12 1994 Jason Merrill (jason@deneb.cygnus.com)
4344
4345 * typeck.c (build_modify_expr): Don't smash references if INIT_EXPR.
4346
4347Tue Jan 25 13:54:29 1994 Mike Stump (mrs@cygnus.com)
4348
4349 * init.c (build_delete): Back out Jan 17th & 18th pacthes, as
4350 they break libg++.
4351
4352Tue Jan 25 13:11:45 1994 Jason Merrill (jason@deneb.cygnus.com)
4353
4354 * decl.c (duplicate_decls): Fix pointer arithmetic.
4355
4356Mon Jan 24 15:50:06 1994 Chip Salzenberg (chip@fin.uucp)
4357
4358 [ cp-* changes propagated from c-* changes in 940114 snapshot ]
4359 * cp-parse.y (maybe_attribute): Allow multiple __attribute__
4360 clauses on a declaration.
4361
4362Mon Jan 24 17:06:23 1994 Jason Merrill (jason@deneb.cygnus.com)
4363
4364 * class.c (finish_struct): Do synthesize methods for anon
4365 structs, just not unions.
4366
4367Mon Jan 24 13:50:13 1994 Kung Hsu (kung@mexican.cygnus.com)
4368
4369 * decl.c (xref_tag): handle anonymous nested type.
4370 * decl.c (globalize_nested_type): add no globalize bit check.
4371 * spew.c (hack_more_ids) : templated nested decl not push top
4372 level.
4373
4374 * parse.y : get rid of 'goto do_components'. It is much better
4375 for debugging.
4376
4377 * decl.c (is_anon_name): get rid of the function and use the
4378 macro ANON_AGGRNAME_P.
4379 * pt.c : ditto.
4380
4381Fri Jan 21 14:06:02 1994 Jason Merrill (jason@deneb.cygnus.com)
4382
4383 * class.c (finish_struct): Don't synthesize any methods for
4384 anonymous structs/unions.
4385
4386 * typeck.c (build_modify_expr): Don't treat pmf's as class objects.
4387
4388Thu Jan 20 18:56:46 1994 Jason Merrill (jason@deneb.cygnus.com)
4389
4390 * method.c (build_opfncall): Call build_indirect_ref on
4391 synthesized instance for operator delete.
4392
4393 * pt.c (type_unification): Don't abort if called with a list of
4394 types in ARGS.
4395
4396 * class.c (instantiate_type): Deal with function templates.
4397
4398Thu Jan 20 16:55:35 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
4399
4400 * Makefile.in (CC): Default to cc not gcc.
4401
4402Thu Jan 20 13:47:54 1994 Jason Merrill (jason@deneb.cygnus.com)
4403
4404 * typeck.c (build_modify_expr): Call constructor if appropriate.
4405
4406 * decl.c (push_to_top_level): Clear out class-level bindings cache.
4407
4408Wed Jan 19 13:51:22 1994 Jason Merrill (jason@deneb.cygnus.com)
4409
4410 * call.c (resolve_scope_to_name): Work recursively (previously only
4411 looked down one level).
4412
4413 * lex.c (do_pending_inlines): If we're still dealing with the last
4414 batch of inlines, don't start working on a new one.
4415
4416 * Makefile.in (stamp-parse): Update conflict count.
4417 (TAGS): Fix.
4418
4419 * parse.y (explicit_instantiation): New rule; implements
4420 'template A<int>' syntax (though not 'template foo(int)' yet).
4421 (structsp): Add explicit_instantiation.
4422
4423Tue Jan 18 13:53:05 1994 Jason Merrill (jason@deneb.cygnus.com)
4424
4425 * class.c (finish_struct, etc.): Simplify decision to synthesize
4426 a destructor.
4427
4428 * call.c, class.c, cp-tree.h, decl.c, init.c,
4429 ptree.c, search.c, typeck.c, typeck2.c: Nuke
4430 TYPE_NEEDS_CONSTRUCTOR (change all calls to TYPE_NEEDS_CONSTRUCTING).
4431 * init.c (expand_aggr_init_1): Don't try non-constructor methods
4432 of initializing objects.
4433 (build_new): Don't try other methods if the constructor lookup fails.
4434
4435 * class.c (finish_base_struct): Set cant_have_default_ctor and
4436 cant_synth_copy_ctor properly.
4437 (finish_struct): Ditto.
4438
4439Mon Jan 17 13:58:18 1994 Jason Merrill (jason@deneb.cygnus.com)
4440
4441 * typeck.c (build_modify_expr_1): #if 0 out again.
4442 (build_modify_expr): #if 0 out memberwise init code again.
4443
4444 * lex.c (default_copy_constructor_body): Be const-correct.
4445 (default_assign_ref_body): Ditto.
4446
4447 * init.c (perform_member_init): Use TYPE_HAS_CONSTRUCTOR to decide
4448 whether or not to use it, rather than TYPE_NEEDS_CONSTRUCTING.
4449 (expand_aggr_init): Disable silent conversion from initializer list
4450 to list of args for a constructor.
4451
4452 * class.c (base_info): Lose needs_default_ctor.
4453 (finish_base_struct): Ditto.
4454 (finish_struct): Ditto.
4455
4456 * decl.c (init_decl_processing): Don't turn off flag_default_inline
4457 just because flag_no_inline is on.
4458 (finish_decl): Use TYPE_HAS_CONSTRUCTOR to decide to use
4459 constructor.
4460
4461 * class.c (finish_struct): Synthesize default ctor whenever
4462 allowed.
4463
4464 * Makefile.in (TAGS): Don't try to run etags on cp-parse.y.
4465
4466Sat Jan 15 18:34:33 1994 Mike Stump (mrs@cygnus.com)
4467
4468 * Makefile.in, configure: Handle the C++ front-end in a
4469 subdirectory.
4470 * cp-*: Move C++ front-end to cp/*.
4471
4472Fri Jan 14 14:09:37 1994 Jason Merrill (jason@deneb.cygnus.com)
4473
4474 * cp-typeck.c (build_function_call_real): Modify to match other
4475 instances of taking the address of the function.
4476
4477 * cp-class.c (finish_struct): Set TYPE_HAS_REAL_CONSTRUCTOR to 1 if
4478 there are non-synthesized constructors.
4479 Only set TYPE_NEEDS_CONSTRUCTOR if TYPE_HAS_REAL_CONSTRUCTOR.
4480 Always generate copy constructor if possible.
4481
4482 * cp-tree.h (lang_type): Add has_real_constructor bitfield.
4483 (TYPE_HAS_REAL_CONSTRUCTOR): Define.
4484
4485 * cp-lex.c (default_copy_constructor_body): Use init syntax
4486 for all bases.
4487
4488 * cp-type2.c (store_init_value): Only give error for initializer list
4489 if TYPE_HAS_REAL_CONSTRUCTOR.
4490
4491Thu Jan 13 15:38:29 1994 Jason Merrill (jason@deneb.cygnus.com)
4492
4493 * cp-tree.h (DECL_SYNTHESIZED): Add defn.
4494 (lang_decl): Add synthesized bitfield to decl_flags.
4495
4496 * cp-lex.c (cons_up_default_function): Use DECL_SYNTHESIZED to mark
4497 artificial methods, rather than a line # of 0.
4498
4499Fri Jan 14 18:25:29 1994 Kung Hsu (kung@mexican.cygnus.com)
4500
4501 * cp-decl (xref_tag): fix a bug in conflict type.
4502 * cp-parse.y : add SCOPED_NAME for uninstantiated template nested
4503 type reference.
4504 * cp-spew.c (yylex) : generated SCOPED_NAME token.
4505 * cp-lex.c (yyprint): handle SCOPED_NAME.
4506
4507Fri Jan 14 17:00:29 1994 Mike Stump (mrs@cygnus.com)
4508
4509 * cp-decl.c (pushdecl): Revert patch from Jan 11 19:33:03, as it is
4510 not right.
4511
4512Thu Jan 13 14:00:35 1994 Kung Hsu (kung@mexican.cygnus.com)
4513
4514 * cp-decl2.c (grok_x_components): fix a bug that enum type does not
4515 have type_flags.
4516
4517Thu Jan 13 11:39:34 1994 Mike Stump (mrs@cygnus.com)
4518
4519 Ensure that all vtable pointers are initialized with all the right
4520 values.
4521
4522 * cp-class.c (is_normal): Changed to reflect new meaning of
4523 CLASSTYPE_VFIELD_PARENT.
4524 * cp-class.c (maybe_fixup_vptrs): Use of
4525 CLASSTYPE_NEEDS_VIRTUAL_REINIT here is misguided. Use
4526 BINFO_MODIFIED instead.
4527 * cp-class.c (finish_struct): Changed to reflect new meaning of
4528 CLASSTYPE_VFIELD_PARENT.
4529 * cp-decl.c (get_binfo_from_vfield): Removed, unneeded now.
4530 * cp-decl.c (finish_function): Use init_vtbl_ptrs, instead of open
4531 coding it here.
4532 * cp-init.c (init_vfields): Changed name to init_vtbl_ptrs, and
4533 re-implement.
4534 * cp-init.c (emit_base_init): Use new name init_vtbl_ptrs.
4535 * cp-tree.h (vfield_parent): Changed to integer.
4536 * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Changed docs to reflect new
4537 meaning.
4538 * cp-tree.h (init_vtbl_ptrs): Added init_vtbl_ptrs.
4539
4540Wed Jan 12 18:24:16 1994 Kung Hsu (kung@mexican.cygnus.com)
4541
4542 * cp-decl.c (xref_tag): re-implement globalize nested type.
4543 * cp-decl2.c (grok_x_components): ditto.
4544 * cp-parse.y: ditto.
4545 * cp-tree.h (lang_type): add no_globalize bit in type_flags.
4546
4547Wed Jan 12 14:08:09 1994 Jason Merrill (jason@deneb.cygnus.com)
4548
4549 * cp-decl.c (grokdeclarator): Don't set TREE_PUBLIC on friend
4550 decls with a definition attached.
4551
4552 * cp-typeck.c (build_modify_expr): Undo previous change in the case
4553 of INIT_EXPRs.
4554
4555Tue Jan 11 19:33:03 1994 Jason Merrill (jason@deneb.cygnus.com)
4556
4557 * cp-typeck.c (build_modify_expr): Replace code for generating
4558 assignment semantics for classes with an error.
4559 (build_modify_expr_1): #if 0 out.
4560
4561 * cp-decl.c (pushdecl): Patch bogus design of pushdecl
4562 behavior for overloaded functions (it doesn't push anything).
4563
4564 * cp-class.c (finish_struct): When generating default op=,
4565 set TYPE_HAS_ASSIGNMENT.
4566
4567Mon Jan 10 18:48:06 1994 Mike Stump (mrs@cygnus.com)
4568
4569 * cp-cvt.c (convert): Make {double, clashing enum} -> enum
4570 invalid.
4571 * cp-typeck.c (convert_for_assignment): Simplify.
4572 * cp-decl2.c (warn_enum_clash): Removed.
4573 * invoke.texi (-Wenum-clash): Removed.
4574 * toplev.c (-Wenum-clash): Removed.
4575
4576Mon Jan 10 17:48:37 1994 Kung Hsu (kung@mexican.cygnus.com)
4577
4578 * cp-decl.c (finish_decl): fix incorrect popclass call.
4579
4580 * cp-decl.c (is_anon_name): new function, check whether the name
4581 is anonymous name generated by compiler.
4582 * cp-decl.c (grokdeclarator): allow nested SCOPE_REF
4583 * cp-spew.c (hack_more_ids): handle nested type in template.
4584 * cp-parse.y : handle nested type reference in uninstantiated
4585 template.
4586 * cp-call.c (build_method_call): handle uninstantiated template
4587 case.
4588 * cp-pt.c (search_nested_type_in_tmpl): new function, search nested
4589 type in template.
4590 * cp-pt.c (lookup_nested_type_by_name): new function, lookup nested
4591 type by name.
4592 * cp-pt.c (tsubst): handle nested type search by name.
4593
4594Mon Jan 10 14:32:18 1994 Jason Merrill (jason@deneb.cygnus.com)
4595
4596 * cp-init.c (build_member_call): Propagate qualifiers to new type.
4597
4598 * cp-call.c (build_method_call): Count functions the new way.
4599
4600Fri Jan 7 19:03:26 1994 Jason Merrill (jason@deneb.cygnus.com)
4601
4602 * cp-decl.c (pushtag): Set DECL_ASSEMBLER_NAME for nested classes,
4603 too.
4604
4605Tue Jan 4 16:45:51 1994 Kung Hsu (kung@cirdan.cygnus.com)
4606
4607 * cp-parse.y: change to handle whether to globalize nested class.
4608 * cp-decl.c(xref_tag, maybe_globalize_type): Ditto.
4609
4610Mon Jan 3 22:22:32 1994 Gerald Baumgartner (gb@cygnus.com)
4611
4612 * Makefile.in cp-call.c cp-class.c cp-cvt.c cp-decl.c cp-decl2.c
4613 cp-error.c cp-init.c cp-lex.c cp-lex.h cp-method.c cp-parse.y
4614 cp-spew.c cp-tree.c cp-tree.h cp-type2.c cp-typeck.c cp-xref.c
4615 gplus.gperf toplev.c: Incorporated C++ signature extension.
4616 * cp-sig.c: New file, contains most of signature processing.
4617 * cp-hash.h: Regenerated from gplus.gperf.
4618
4619 * gcc.1 g++.1: Added explanation for the `-fhandle-signatures'
4620 and `-fno-handle-signatures' command line flags.
4621
4622 * gcc.texi: Changed the last-modification date.
4623 * invoke.texi: Added `-fhandle-signatures' in the list of
4624 C++ language options. Added explanation for this option.
4625
4626Tue Dec 28 21:10:03 1993 Mike Stump (mrs@cygnus.com)
4627
4628 * cp-init.c (expand_vec_init): Remove comptypes test, as it is too
4629 harsh here.
4630
4631Tue Dec 28 13:42:22 1993 Mike Stump (mrs@cygnus.com)
4632
4633 * cp-pt.c (do_pending_expansions): Decide to expand a template
4634 member function, based upon it's class type, not the class type of
4635 the first place it was declared.
4636
4637Tue Dec 28 05:42:31 1993 Mike Stump (mrs@cygnus.com)
4638
4639 * cp-class.c (is_normal): New routine, use to determine when the
4640 given binfo is the normal one. (The one that should have the simple
4641 vtable name.)
4642 * cp-class.c (modify_other_vtable_entries): Use DECL_ASSEMBLER_NAME
4643 to check if two fndecls are `the same'. Sometimes this routine can
4644 modify the main vtable, and normal should be 1, in that case, so use
4645 is_normal() to determine if this is the main vtable for the class.
4646 Don't recurse down virtual bases, as they are shared, and we take
4647 care of them elsewhere.
4648 * cp-class.c (modify_vtable_entries): If we have already updated the
4649 vtable with the new virtual, don't do it again.
4650 * cp-class.c (finish_struct): Set CLASSTYPE_VFIELD_PARENT as
4651 appropriate. Do virtual function overriding in virtual bases, after
4652 normal overriding, so that the base function list in DECL_VINDEX is
4653 not overridden, before we have a chance to run through the list.
4654 Use DECL_ASSEMBLER_NAME to check if two fndecls are `the same'.
4655 Make sure we pass the right address into modify_vtable_entries.
4656 * cp-tree.h (CLASSTYPE_VFIELD_PARENT): New field to indicate which
4657 binfo is the one that has the vtable that we based our vtable on.
4658
4659Fri Dec 24 09:40:52 1993 Michael Tiemann (tiemann@blues.cygnus.com)
4660
4661 * cp-typeck.c (c_expand_start_case): Use default_conversion to
4662 convert expression from reference type if necessary.
4663
4664Wed Dec 22 17:58:43 1993 Jason Merrill (jason@deneb.cygnus.com)
4665
4666 * cp-typeck.c (build_unary_op): Make sure that it's a TREE_LIST before
4667 trying to read its TREE_VALUE.
4668
4669 * cp-class.c (finish_struct_methods): Clear DECL_IN_AGGR_P here.
4670 (finish_struct): Instead of here.
4671
4672Tue Dec 21 14:34:25 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4673
4674 * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't
4675 have TYPE_PTRMEMFUNC_P set before we try to build its
4676 CLASSTYPE_ID_AS_LIST.
4677 (get_decl_list): Likewise, when trying to read it.
4678
4679 * cp-tree.h (VTABLE_NAME): No def with NO_{DOLLAR,DOT} defined.
4680 (VTABLE_NAME_P): Use it instead of VTABLE_NAME_FORMAT.
4681
4682Mon Dec 20 13:35:03 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4683
4684 * cp-typeck.c (rationalize_conditional_expr): New function.
4685 (unary_complex_lvalue): Use it.
4686 (build_modify_expr): Use it, since trying to do an ADDR_EXPR of it
4687 with build_unary_op won't cut it. Don't wrap the COND_EXPR with a
4688 SAVE_EXPR either.
4689
4690 * cp-decl2.c (explicit_warn_return_type): Deleted variable.
4691 (lang_decode_option): Set warn_return_type, not explicit_*, for
4692 -Wreturn-type and -Wall. This is what rest_of_compilation uses to
4693 decide if it should go into jump_optimize or not.
4694 * cp-tree.h (explicit_warn_return_type): Deleted.
4695 * cp-decl.c (grokdeclarator): Use warn_return_type, not explicit_*.
4696 (finish_function): Also complain about no return in a non-void fn if
4697 we're being pedantic (don't rely on use of -Wreturn-type).
4698
4699Fri Dec 17 15:45:46 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4700
4701 * cp-decl.c (grokdeclarator): Forbid declaration of a function as
4702 static if it's being done inside another function.
4703
4704 * cp-search.c (compute_visibility): Check for friendship both ways.
4705
4706Fri Dec 17 14:28:25 1993 Jason Merrill (jason@deneb.cygnus.com)
4707
4708 * cp-cvt.c (build_default_binary_type_conversion): Make error
4709 messages more helpful.
4710
4711 * cp-error.c (op_as_string): New function, returns "operator =="
4712 given EQ_EXPR or suchlike.
4713
4714Fri Dec 17 13:28:11 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4715
4716 * cp-call.c (print_n_candidates): New function.
4717 (build_overload_call_real): Use it when we complain about a call
4718 being ambiguous.
4719
4720Fri Dec 17 12:41:17 1993 Jason Merrill (jason@deneb.cygnus.com)
4721
4722 * cp-call.c (build_method_call): Fix checking for static call
4723 context.
4724
4725 * cp-method.c (build_opfncall): Call build_indirect_ref on argument
4726 to operator new.
4727
4728 * cp-init.c (build_new): Don't mess with rval when building
4729 indirect ref.
4730
4731Thu Dec 16 16:48:05 1993 Kung Hsu (kung@cirdan.cygnus.com)
4732
4733 * cp-lex.c (default_assign_ref_body): add check when TYPE_NESTED_
4734 NAME(type) may not be exist. It's not a problem for old compiler.
4735
4736Thu Dec 16 14:46:06 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4737
4738 * cp-tree.h (CLASSTYPE_ALTERS_VISIBILITIES_P): Delete macro, it's
4739 never used for anything.
4740 (struct lang_type, member type_flags): Delete field
4741 `alters_visibility', and up `dummy' by 1.
4742 * cp-class.c (finish_base_struct): Delete code that copies the
4743 setting of CLASSTYPE_ALTERS_VISIBILITIES_P.
4744 (finish_struct): Delete code that sets it.
4745
4746Thu Dec 16 14:44:39 1993 Jason Merrill (jason@deneb.cygnus.com)
4747
4748 * cp-decl.c, cp-init.c, cp-typeck.c: Fix arguments to
4749 build_method_call that I messed up before.
4750
4751 * cp-search.c (get_base_distance): If protect > 1, allow immediate
4752 private base.
4753
4754 * cp-class.c (finish_base_struct): Set cant_synth_* correctly.
4755 (finish_struct): Ditto. Well, nigh-correctly; it won't deal
4756 properly with the case where a class contains an object of an
4757 ambiguous base class which has a protected op=. Should be fixed
4758 when the access control code gets overhauled.
4759 (finish_struct_methods): Set TYPE_HAS_NONPUBLIC_* correctly.
4760
4761Thu Dec 16 12:17:06 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4762
4763 * cp-lex.c (real_yylex): Turn the code back on that deals with
4764 __FUNCTION__ and __PRETTY_FUNCTION__. Don't use lookup_name, to
4765 avoid the ambiguity problems that led to it being turned off in the
4766 first place.
4767
4768 * cp-method.c (hack_identifier): Also check for a TYPE_PTRMEMFUNC_P
4769 to see if something is a method.
4770
4771Wed Dec 15 18:35:58 1993 Mike Stump (mrs@cygnus.com)
4772
4773 * cp-typeck.c (build_modify_expr): Avoid error messages on small
4774 enum bit fields.
4775 * cp-typeck.c (convert_for_assignment): Add missing argument to
4776 cp_warning and cp_pedwarn calls.
4777
4778Wed Dec 15 18:25:32 1993 Jason Merrill (jason@deneb.cygnus.com)
4779
4780 * cp-parse.y (member_init): ANSI C++ doesn't forbid old-style base
4781 initializers; it's just anachronistic.
4782
4783 * cp-decl.c (finish_decl): Don't require external-linkage arrays
4784 to have a complete type at declaration time when pedantic.
4785
4786Tue Dec 14 11:37:23 1993 Jason Merrill (jason@deneb.cygnus.com)
4787
4788 * cp-decl.c (pushdecl): Don't set DECL_CONTEXT if it's already set.
4789
4790 * cp-call.c (build_method_call): Don't dereference pointer given
4791 as instance.
4792
4793 * cp-decl.c (finish_function): Don't pass pointer to
4794 build_method_call.
4795 (finish_function): Ditto.
4796
4797 * cp-typeck.c (build_x_function_call): Ditto.
4798
4799 * cp-method.c (build_component_type_expr): Ditto.
4800
4801 * cp-init.c (build_member_call): Ditto.
4802 (build_new): Ditto.
4803
4804Mon Dec 13 18:04:33 1993 Kung Hsu (kung@cirdan.cygnus.com)
4805
4806 * cp-decl.c (xref_tag): fix regression created by changes made
4807 in Dec. 7 1993.
4808 * cp-decl.c (xref_defn_tag): fix parallel nested class problem.
4809
4810Fri Dec 10 12:40:25 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4811
4812 * cp-call.c (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print
4813 out the final evaluation of the function, so we can see if ELLIPSIS,
4814 USER, and EVIL were set at the end.
4815
4816 * cp-call.c (convert_harshness_ansi): When the parm isn't an lvalue,
4817 only go for setting TRIVIAL_CODE if we are dealing with types that
4818 are compatible.
4819
4820Thu Dec 9 18:27:22 1993 Mike Stump (mrs@cygnus.com)
4821
4822 * cp-decl.c (flag_huge_objects): New flag to allow large objects.
4823 * toplev.c (lang_options): Ditto.
4824 * cp-decl2.c (flag_huge_objects, lang_f_options): Ditto.
4825 * cp-decl.c (delta_type_node): New type for delta entries.
4826 * cp-tree.h (delta_type_node): Ditto.
4827 * cp-decl.c (init_decl_processing): Setup delta_type_node.
4828 * cp-decl.c (init_decl_processing, build_ptrmemfunc_type): Use
4829 delta_type_node instead of short_integer_type_node.
4830 * cp-class.c (build_vtable_entry): Ditto.
4831
4832Thu Dec 9 16:19:05 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4833
4834 * cp-tree.h (OPERATOR_TYPENAME_P): Define outside of
4835 NO_{DOLLAR,DOT} macro checks, so it always gets defined.
4836 (VTABLE_NAME_P): Define for NO_DOT && NO_DOLLAR_IN_LABEL.
4837
4838Wed Dec 8 17:38:06 1993 Mike Stump (mrs@cygnus.com)
4839
4840 * cp-decl.c (finish_decl): Make sure things that can go into
4841 "common", do go into common, if -fcommon is given.
4842
4843Wed Dec 8 13:01:54 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4844
63718c49
GB
4845 * cp-call.c (print_harshness) [DEBUG_MATCHING]: New function.
4846 (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print out
4847 argument matching diagnostics to make instantly clear what the
4848 compiler is doing.
7177d104
MS
4849
4850 * cp-call.c (convert_harshness_ansi): If the parm isn't an lvalue,
4851 then check to see if the penalty was increased due to
4852 signed/unsigned mismatch, and use a TRIVIAL_CODE if it wasn't.
4853
4854Tue Dec 7 18:29:14 1993 Kung Hsu (kung@cirdan.cygnus.com)
4855
4856 * cp-decl.c (xref_tag, pushtag): Fix nested class search/resolution
4857 problem.
4858
4859Tue Dec 7 16:09:34 1993 Jason Merrill (jason@deneb.cygnus.com)
4860
4861 * cp-class.c (finish_struct): Before synthesizing methods, if no
4862 methods have yet been declared then set nonprivate_method. Don't
4863 set non_private method after synthesizing a method.
4864
4865 * cp-lex.c (extract_interface_info): If flag_alt_external_templates
4866 is set, tie emitted code to the location of template instantiation,
4867 rather than definition.
4868
4869 * cp-tree.h: Declare flag_alt_external_templates.
4870
4871 * cp-decl2.c (lang_decode_option): Support -falt-external-templates.
4872
4873 * toplev.c (lang_options): Ditto.
4874
4875 Mon Oct 4 12:50:02 1993 Chip Salzenberg (chip@fin.uucp)
4876
63718c49
GB
4877 [changes propagated from 930810 snapshot]
4878 * cp-decl.c (init_decl_processing): Make long long available for use
4879 as SIZE_TYPE and PTRDIFF_TYPE.
4880 (finish_decl): Allow file-scope static incomplete array.
4881 (grokdeclarator): Don't pass on const and volatile fron function
4882 value type to function type.
4883 Warn here for volatile fn returning non-void type.
4884 * cp-parse.y (attrib): Accept attributes `volatile' with alias
4885 `noreturn', and `const'.
4886 * cp-typeck.c (default_conversion): Don't lose const and volatile.
4887 (build_binary_op_nodefault): Generate pedantic warning for comparison
4888 of complete pointer type with incomplete pointer type.
4889 (build_c_cast): Be careful that null pointer constant be INTEGER_CST.
7177d104
MS
4890
4891Tue Dec 7 10:46:48 1993 Jason Merrill (jason@deneb.cygnus.com)
4892
4893 * cp-init.c (expand_vec_init): When creating a temporary for copying
4894 arrays, use the type of the source, not the target.
4895
4896 * cp-cvt.c (convert): Pass an argument for errtype to
4897 convert_to_reference.
4898
4899 * cp-error.c (dump_expr, COMPONENT_REF & CALL_EXPR): Deal with
4900 methods, -> and `this'.
4901
4902Mon Dec 6 17:12:33 1993 Jason Merrill (jason@deneb.cygnus.com)
4903
4904 * cp-error.c (parm_as_string): New function; returns `this' or arg
4905 number. Corresponds to %P.
4906 (dump_expr): Deal with method calls.
4907
4908 * cp-cvt.c (convert_to_reference): Stop using warn_for_assignment.
4909 * cp-typeck.c (convert_for_assignment): Ditto.
4910 (warn_for_assignment): Lose.
4911
4912Mon Dec 6 11:33:35 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4913
4914 * cp-call.c (ideal_candidate_ansi): Delete code that was never
4915 doing anything useful. Instead, sort once, and DO NOT wipe
4916 out any codes with EVIL_CODE, since that's what we use as a
4917 marker for the end of the list of candidates.
4918
4919 * cp-cvt.c (convert_to_aggr): Make sure to always set H_LEN.
4920
4921Mon Dec 6 12:49:17 1993 Jason Merrill (jason@deneb.cygnus.com)
4922
4923 * cp-init.c (get_aggr_from_typedef): New function, like
4924 is_aggr_typedef but returns the _TYPE.
4925
4926 * cp-call.c, cp-init.c, cp-method.c: Eradicate err_name.
4927
4928Sun Dec 5 18:12:48 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
4929
4930 * cp-lex.c (readescape): Pedwarn when a hex escape is out of range.
4931
4932Thu Nov 25 23:50:19 1993 Chip Salzenberg (chip@fin.uucp)
4933
4934 Delay language context change until beginning of next decl.
4935
4936 * cp-lex.h (c_header_level): Removed.
4937 (pending_lang_change): Declared.
4938 * cp-lex.c (c_header_level): Renamed from in_c_header, made static.
4939 (pending_lang_change): Defined.
4940 (check_newline): Rework code that recognizes line number and
4941 filename changes. Instead of pushing and popping lang context,
4942 increment and decrement pending_lang_change.
4943 (do_pending_lang_change): Push and pop lang context according
4944 to value of pending_lang_change.
4945 * cp-parse.y (extdefs): Use lang_extdef instead of extdef.
4946 (extdef): Same as extdef, but call do_pending_lang_change() first.
4947
4948Mon Nov 15 15:39:15 1993 Chip Salzenberg (chip@fin.uucp)
4949
4950 * cp-typeck.c (build_binary_op_nodefault): Warn for ordered
4951 compare of ptr with 0 only if pedantic in both cases.
4952
4953Thu Nov 25 13:31:37 1993 Chip Salzenberg (chip@fin.uucp)
4954
4955 Reinstate the below patch, which got lost in the Cygnus merge:
4956 Tue Nov 23 13:59:24 1993 Hallvard B Furuseth (hbf@durin.uio.no)
4957 * cp-parse.y (maybe_type_qual): Don't fail to set $$.
4958
4959Wed Nov 17 19:03:30 1993 Chip Salzenberg (chip@fin.uucp)
4960
4961 * cp-parse.y (attrib): Allow "ident(ident)" like the C front end.
4962
4963Fri Oct 22 20:43:37 1993 Paul Eggert (eggert@twinsun.com)
4964
4965 * cp-lex.c (real_yylex): Diagnose floating point constants
4966 that are too large.
4967
4968Wed Nov 17 19:10:37 1993 Chip Salzenberg (chip@fin.uucp)
4969
4970 * cp-type2.c (build_functional_cast): ARM page 16: When a class
4971 and an object, function or enumerator are declared in the same
4972 scope with the same name, the class name is hidden.
4973
4974Wed Nov 17 19:07:18 1993 Chip Salzenberg (chip@fin.uucp)
4975
4976 * cp-call.c (convert_harshness_ansi): Distinguish float, double,
4977 and long double from each other when overloading.
4978 (compute_conversion_costs_{ansi,old}, build_method_call,
4979 build_overlay_call_real, convert_to_aggr): Always set and
4980 always use H_LEN member of candidate structure.
4981
4982Mon Oct 11 23:10:53 1993 Chip Salzenberg (chip@fin.uucp)
4983
4984 * cp-decl.c (duplicate_decls): Note redeclarations of library
4985 functions, and generate distinct warnings for them.
4986
4987Mon Oct 4 12:26:49 1993 Chip Salzenberg (chip@fin.uucp)
4988
4989 Support format warnings in G++.
4990
4991 * cp-tree.h: Protect against multiple inclusion.
4992 Declare all public functions in c-common.c (copy from c-tree.h).
4993 (STDIO_PROTO): Define.
4994 (warn_format): Declare.
4995 (record_format_info): Remove declaration.
4996 * cp-decl.c (init_decl_processing): Call init_function_format_info.
4997 * cp-decl2.c (lang_decode_option): Make "-Wall" include warn_format.
4998 * cp-typeck.c (build_function_call_real): Call check_function_format.
4999 (record_format_info): Remove -- obsolete stub.
5000
5001Sat Jul 24 12:04:29 1993 Chip Salzenberg (chip@fin.uucp)
5002
5003 * cp-decl.c (duplicate_decls): Don't warn for non-extern var decl
5004 following an extern one (for -Wredundant-decls).
5005 * cp-parse.y (primary): In statement expression case, if compstmt
5006 returns something other than a BLOCK, return it unchanged.
5007
5008Thu Dec 2 20:44:58 1993 Chip Salzenberg (chip@fin.uucp)
5009
5010 * cp-decl.c (warn_extern_redeclared_static): New function made
5011 from code extracted from pushdecl.
5012 (duplicate_decls, pushdecl): Call new function.
5013 (lookup_name_current_level): Allow for IDENTIFIER_GLOBAL_VALUE
5014 to be a TREE_LIST when function is declared in 'extern "C" {}'.
5015
5016Fri Dec 3 16:01:10 1993 Jason Merrill (jason@deneb.cygnus.com)
5017
5018 * cp-class.c (duplicate_tag_error): Use cp_error.
5019 (finish_base_struct): Check for ambiguity with direct base, and don't
5020 generate op= or copy ctor if it exists.
5021
5022Fri Dec 3 15:32:34 1993 Kung Hsu (kung@cirdan.cygnus.com)
5023
5024 * cp-init.c (expand_member_init): when initializer name is null,
5025 don't try to build it now because emit_base_init will handle it.
5026
5027Fri Dec 3 12:28:59 1993 Jason Merrill (jason@deneb.cygnus.com)
5028
5029 * cp-lex.c (init_lex): Initialize input_filename to "<internal>" for
5030 code such as ExceptionHandler::operator=.
5031
5032Fri Dec 3 10:32:08 1993 Jason Merrill (jason@deneb.cygnus.com)
5033
5034 * cp-decl.c (grokdeclarator): Don't try to print out dname when
5035 complaining about arrays of references if decl_context==TYPENAME,
5036 since it will be null.
5037
5038 * cp-decl2.c: Default to flag_ansi_overloading.
5039
5040Thu Dec 2 18:05:56 1993 Kung Hsu (kung@cirdan.cygnus.com)
5041
5042 * cp-call.c (build_method_call): use binfo from instance if it's
5043 different from binfo (basetype_path) passed from above.
5044
5045Thu Dec 2 12:48:36 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
5046
5047Wed Nov 17 19:14:29 1993 Chip Salzenberg (chip@fin.uucp)
5048
5049 cp-error.c (dump_expr): Use unsigned chars to output a
5050 TREE_REAL_CST in hex.
5051
5052Thu Dec 2 11:05:48 1993 Jason Merrill (jason@deneb.cygnus.com)
5053
5054 * cp-class.c (finish_struct): Fix typo in setting
5055 cant_synth_asn_ref.
5056
5057 * cp-tree.h (TYPE_NESTED_NAME): New macro, does
5058 DECL_NESTED_TYPENAME (TYPE_NAME (NODE)).
5059
5060 * cp-lex.c (default_copy_constructor_body): Change
5061 DECL_NAME (TYPE_NAME (btype)) to TYPE_NESTED_NAME (btype).
5062 (default_assign_ref_body): Ditto.
5063 (default_copy_constructor_body): Call operator= explicitly for
5064 base classes that have no constructor.
5065
5066Thu Dec 2 10:47:15 1993 Michael Tiemann (tiemann@blues.cygnus.com)
5067
5068 * cp-call.c (build_method_call): If the instance variable is
5069 converted to error_mark_node when we're trying to convert it to the
5070 base type of a method we're looking up, return error_mark_node.
5071
5072Thu Dec 2 10:41:16 1993 Torbjorn Granlund (tege@cygnus.com)
5073
5074 * cp-typeck.c (build_binary_op_nodefault): In *_DIV_EXPR *_MOD_EXPR
5075 cases, tests for unsigned operands by peeking inside a NOP_EXPR.
5076
5077Wed Dec 1 13:33:34 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
5078
5079 * cp-call.c (compute_conversion_costs_ansi): Use the size of struct
5080 harshness_code, not the size of short, for clearing out the
5081 ansi_harshness.
5082
5083 * cp-call.c (print_candidates): New function.
5084 (build_method_call): When we had some candidates, but didn't get a
5085 usable match, don't report that we got an error with the first
5086 candidate. Instead, say there were no matches, and list the
5087 candidates with print_candidates. In the second pass, make sure we
5088 clear out ever_seen, so we can accurately count the number of
5089 functions that qualified.
5090
5091Wed Dec 1 09:53:59 1993 Torbjorn Granlund (tege@cygnus.com)
5092
5093 * cp-typeck.c (build_binary_op_nodefault): Shorten for *_MOD_EXPR
5094 only if op1 is known to be != -1.
5095 (build_binary_op_nodefault): Handle *_DIV_EXPR likewise.
5096
5097Tue Nov 30 14:07:26 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
5098
5099 * cp-method.c (hack_identifier): If the field itself is private, and
5100 not from a private base class, say so.
5101
5102Mon Nov 29 03:00:56 1993 Jason Merrill (jason@deneb.cygnus.com)
5103
5104 * cp-decl.c (grokdeclarator): Always warn on initialization of
5105 const member.
5106
5107Wed Nov 24 00:49:35 1993 Jason Merrill (jason@deneb.cygnus.com)
5108
5109 * cp-class.c (finish_struct): Set TYPE_GETS_CONST_* properly.
5110 (finish_base_struct): Set cant_synth_asn_ref properly.
5111
5112 * cp-lex.c (cons_up_default_function): Add section for operator=.
5113 (default_assign_ref_body): New function, mostly cribbed from
5114 default_copy_constructor_body.
5115
5116 * cp-class.c (base_info): Add members cant_synth_copy_ctor,
5117 cant_synth_asn_ref, no_const_asn_ref.
5118 (finish_base_struct): Update no_const_asn_ref, note that you should
5119 update cant_synth_*, propagate TYPE_GETS_ASSIGN_REF.
5120 (finish_struct): Add decls for cant_synth_*, no_const_asn_ref, and
5121 initialize them properly. Set no_const_asn_ref properly. Set
5122 cant_synth_* in some of the situations where they should be set.
5123 Propagate TYPE_GETS_ASSIGN_REF. Use cant_synth_copy_ctor. Add call
5124 to cons_up_default_function for operator=.
5125
5126Tue Nov 23 20:24:58 1993 Mike Stump (mrs@cygnus.com)
5127
5128 * cp-cvt.c (convert_force): Add code to perform casting of pointer
5129 to member function types.
5130 * cp-typeck.c (build_ptrmemfunc): Add FORCE parameter to indicate
5131 when the conversion should be done, regardless.
5132 * cp-tree.h (build_ptrmemfunc): Ditto.
5133 * cp-type2.c (digest_init): Ditto.
5134 * cp-typeck.c (convert_for_assignment): Ditto.
5135
5136Tue Nov 23 18:06:58 1993 Jason Merrill (jason@deneb.cygnus.com)
5137
5138 * cp-error.c (dump_expr): Do the right thing for variables of
5139 reference type.
5140
5141 * cp-decl.c (grok_op_properties): Set TYPE_HAS_ASSIGN_REF
5142 and its kin properly.
5143 (xref_tag): Propagate TYPE_GETS_ASSIGN_REF.
5144
5145Tue Nov 23 12:26:13 1993 Mike Stump (mrs@cygnus.com)
5146
5147 * cp-method.c (build_opfncall): Don't count pointer to member
5148 functions as aggregates here, as we don't want to look up methods in
5149 them. The compiler would core dump if we did, as they don't have
5150 normal names.
5151 * cp-typeck.c (build_indirect_ref): Improve wording on error
5152 message.
5153
5154Mon Nov 22 14:22:23 1993 Jason Merrill (jason@deneb.cygnus.com)
5155
5156 * cp-decl.c (grok_op_properties): Allow operator?: with pedwarn
5157 (since it's supported in other compiler bits).
5158
5159 * cp-method.c (report_type_mismatch): Use cp_error; ignore err_name
5160 argument.
5161
5162 * cp-error.c (dump_function_decl): Don't print return type for
5163 constructors and destructors.
5164
5165 * cp-cvt.c (cp_convert_to_pointer): Import code from
5166 convert_to_pointer so we can return error_mark_node in the case of an
5167 error, and to allow more meaningful error messages.
5168 (build_type_conversion): Don't go through void* when trying
5169 to convert to a pointer type.
5170
5171 * cp-decl.c (grokfndecl): Move call to grok_op_properties back
5172 after grokclassfn so that it's dealing with the right decl.
63718c49 5173 (grok_op_properties): Don't assert !methodp for op new and op delete.
7177d104
MS
5174
5175 * cp-init.c (build_delete): Don't use TYPE_BUILT_IN (there are now
5176 no uses of it in the compiler).
5177
5178 * cp-call.c (build_scoped_method_call): Fix for destructors of simple
5179 types.
5180 (build_method_call): Ditto.
5181
5182Fri Nov 19 12:59:38 1993 Jason Merrill (jason@deneb.cygnus.com)
5183
5184 * cp-tree.c (count_functions): Abstraction function.
5185
5186 * cp-call.c (build_overload_call_real): Deal with new overloading
5187 properly, remove dead code.
5188
5189 * gcc.c (default_compilers): Generate and use .ii files in the
5190 intermediate stage of compiling C++ source.
5191
5192Fri Nov 19 11:26:09 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
5193
5194 * cp-expr.c (cplus_expand_expr): Make call_target a valid memory
5195 address before using it, so it can be later safely compared.
5196
5197Fri Nov 12 15:30:27 1993 Jason Merrill (jason@deneb.cygnus.com)
5198
5199 * cp-pt.c (tsubst): Deal with new overloading.
5200
5201 * cp-typeck.c (fntype_p): is the arg function type?
5202 (comp_target_parms): pedwarn on conversion from (anything) to (...).
5203 (build_x_function_call): Deal with new overloading.
5204
5205 * cp-tree.c (decl_list_length): Deal with new overloading.
5206 (decl_value_member): Like value_member, but for DECL_CHAINs.
5207
5208 * cp-decl.c (duplicate_decls): Deal with new overloading.
5209 (start_decl): Ditto.
5210
5211 * cp-class.c (instantiate_type): Deal with new overloading.
5212
5213 * cp-call.c (convert_harshness_ansi): Deal with new overloading.
5214 (convert_harshness_old): Deal with new overloading.
5215 (build_overload_call_real): Ditto.
5216
5217Mon Nov 8 13:50:49 1993 Jason Merrill (jason@deneb.cygnus.com)
5218
5219 * cp-tree.c (get_unique_fn): New function; returns FUNCTION_DECL
5220 if unambiguous, NULL_TREE otherwise.
5221 (get_first_fn): Returns the first appropriate FUNCTION_DECL.
5222 (is_overloaded_fn): Returns whether or not the passed tree is
5223 a function or list of functions.
5224
5225 * cp-init.c (init_init_processing): use `get_first_fn' to find
5226 the FUNCTION_DEFN for new and delete.
5227
5228 * cp-decl.c (push_overloaded_decl): Use new overloading strategy, cut
5229 code size in half (I spit on special cases).
5230
5231Tue Sep 7 20:03:33 1993 Jason Merrill (jason@deneb.cygnus.com)
5232
5233 * cp-decl.c: Allow references and template type parameters as well
5234
5235Local Variables:
5236eval: (auto-fill-mode)
5237left-margin: 8
5238fill-column: 76
5239End:
This page took 0.57074 seconds and 5 git commands to generate.