]> gcc.gnu.org Git - gcc.git/blame - gcc/cp/ChangeLog
error.c (interesting_scope_p): New fn.
[gcc.git] / gcc / cp / ChangeLog
CommitLineData
bbcec105
JM
11998-12-17 Jason Merrill <jason@yorick.cygnus.com>
2
3 * error.c (interesting_scope_p): New fn.
4 (dump_simple_decl): Use it.
5 (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
6 (dump_expr, case OFFSET_REF): Print ->* if appropriate.
7
50714e79
MM
81998-12-16 Mark Mitchell <mark@markmitchell.com>
9
10 * class.c (resolve_address_of_overloaded_function): Do conversion
11 to correct type here, rather than ...
12 (instantiate_type): Here.
13
14 * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
15 (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
16 (decl_template_parm_p): Remove.
17 * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
18 paramter.
19 * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
fc03edb3 20 * pt.c (push_inline_template_parms_recursive): Set it.
50714e79
MM
21 (decl_template_parm_p): Remove.
22 (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
23 (process_template_parm): Set it.
24
6163a7b2
DB
25Wed Dec 16 16:33:58 1998 Dave Brolley <brolley@cygnus.com>
26
27 * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
28 if configured with cpplib.
29
1caa11d3
MM
301998-12-15 Mark Mitchell <mark@markmitchell.com>
31
c7dda1e3
MM
32 * decl.c (poplevel): Make sure ns_binding is initialized.
33
1caa11d3
MM
34 * decl.c (finish_function): Undo inadvertant change in previous
35 patch.
36
d8f8dca1
MM
371998-12-14 Mark Mitchell <mark@markmitchell.com>
38
39 * class.c (pushclass): Tweak handling of class-level bindings.
40 (resolve_address_of_overloaded_function): Update pointer-to-member
41 handling.
42 (instantiate_type): Likewise.
43 * cvt.c (cp_convert_to_pointer): Likewise.
44 * decl.c (pop_binding): Take the DECL to pop, not just the name.
45 Deal with `struct stat' hack.
46 (binding_level): Add to documentation.
47 (push_binding): Clear BINDING_TYPE.
48 (add_binding): New function.
49 (push_local_binding): Use it.
50 (push_class_binding): Likewise.
51 (poplevel): Adjust calls to pop_binding.
52 (poplevel_class): Likewise.
53 (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
54 declarations to current binding level.
55 (push_class_level_binding): Likewise.
56 (push_overloaded_decl): Adjust handling of OVERLOADs in local
57 bindings.
58 (lookup_namespace_name): Don't crash when confronted with a
59 TEMPLATE_DECL.
60 (lookup_name_real): Do `struct stat' hack in local binding
61 contexts.
62 (build_ptrmemfunc_type): Adjust documentation.
63 (grokdeclarator): Don't avoid building real array types when
64 processing templates unless really necessary.
65 (finish_method): Adjust calls to pop_binding.
66 * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
67 not reparse_decl_as_expr.
68 (build_expr_from_tree): Deal with a template-id as the function to
69 call in a METHOD_CALL_EXPR.
70 * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
71 (maybe_adjust_types_For_deduction): Don't do peculiar things with
72 METHOD_TYPEs here.
73 (resolve_overloaded_unification): Handle COMPONENT_REFs. Build
74 pointer-to-member types where necessary.
75 * tree.c (build_cplus_array_type_1): Don't avoid building real
76 array types when processing templates unless really necessary.
77 (build_exception_variant): Compare the exception lists correctly.
78
f181d4ae
MM
791998-12-13 Mark Mitchell <mark@markmitchell.com>
80
81 * cp-tree.def (CPLUS_BINDING): Update documentation.
82 * cp-tree.h (LOCAL_BINDING_P): New macro.
83 (lang_identifier): Rename local_value to bindings.
84 (tree_binding): Make `scope' of type `void*', not `tree'.
85 (BINDING_SCOPE): Update documentation.
86 (IDENTIFIER_LOCAL_VALUE): Remove.
87 (IDENTIFIER_CLASS_VALUE): Document.
88 (IDENTIFIER_BINDING): New macro.
89 (IDENTIFIER_VALUE): Likewise.
90 (TIME_IDENTIFIER_TIME): Likewise.
91 (TIME_IDENTIFIER_FILEINFO): Likewise.
92 (IMPLICIT_TYPENAME_P): Likewise.
93 (set_identifier_local_value): Remove.
94 (push_local_binding): New function.
95 (push_class_binding): Likewise.
96 * class.c (pushclass): Update comments; use push_class_binding.
97 * decl.c (set_identifier_local_value_with_scope): Remove.
98 (set_identifier_local_value): Likewise.
99 (push_binding): New function.
100 (pop_binding): Likewise.
101 (binding_level): Update documentation. Remove shadowed.
102 (BINDING_LEVEL): New macro.
103 (free_binding_nodes): New variable.
104 (poplevel): Adjust for new name-lookup scheme. Don't mess up
105 BLOCK_VARs when doing for-scope extension. Remove effectively
106 dead code.
107 (pushlevel_class): Tweak formatting.
108 (poplevel_class): Adjust for new name-lookup scheme.
109 (print_binding_level): Likewise.
110 (store_bindings): Likewise.
111 (pushdecl): Likewise.
112 (pushdecl_class_level): Likewise.
113 (push_class_level_binding): Likewise.
114 (push_overloaded_decl): Update comments. Adjust for new
115 name-lookup scheme.
116 (lookup_name_real): Likewise.
117 (lookup_name_current_level): Likewise.
118 (cp_finish_decl): Likewise.
119 (require_complete_types_for_parms): Likewise. Remove misleading
120 #if 0'd code.
121 (grok_parms): Likewise. Don't call
122 require_complete_types_for_parms here.
123 (grok_ctor_properties): Don't treat templates as copy
124 constructors.
125 (grop_op_properties): Or as assignment operators.
126 (start_function): Document. Adjust for new name-lookup scheme.
127 (finish_function): Likewise.
128 * decl2.c (do_local_using_decl): Use push_local_binding.
129 * lex.c (begin_definition_of_inclass_inline): New function, split
130 out from ...
131 (do_pending_inlines): Here, and ...
132 (process_next_inline): Here.
133 (get_time_identifier): Use TIME_IDENTIFIER_* macros.
134 (init_filename_times): Likewise.
135 (extract_interface_info): Likewise.
136 (ste_typedecl_interface_info): Likewise.
137 (check_newline): Likewise.
138 (dump_time_statistics): Likewise.
139 (handle_cp_pragma): Likewise.
140 (do_identifier): Adjust for new name-lookup scheme.
141 * parse.y (function_try_block): Return ctor_initializer_opt value.
142 (fndef): Use it.
143 (fn.defpen): Pass appropriate values to start_function.
144 (pending_inline): Use functor_try_block value, and pass
145 appropriate values to finish_function.
146 * pt.c (is_member_template): Update documentation; remove handling
147 of FUNCTION_DECLs. As per name, this function should deal only in
148 TEMPLATE_DECLs.
149 (decl_template_parm_p): Change name of olddecl parameter to decl.
150 (check_template_shadow): Adjust for new name-lookup scheme.
151 (lookup_template_class): Likewise.
152 (tsubst_decl): Tweak so as not to confuse member templates with
153 copy constructors and assignment operators.
154 (unify): Handle UNION_TYPEs.
155 * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
156 (lang_print_xnode): Adjust for new name-lookup scheme.
157 * typeck.c (mark_addressable): Likewise.
158 (c_expand_return): Likewise.
159
4d7614e9
JM
1601998-12-08 Jason Merrill <jason@yorick.cygnus.com>
161
162 * decl.c (grokdeclarator): Allow field with same name as class
163 in extern "C".
164
165 * decl.c (lookup_name_real): Don't limit field lookup to types.
166 * class.c (check_member_decl_is_same_in_complete_scope): No error
167 if icv and x are the same.
168 * lex.c (do_identifier): Tweak error message.
169
ea585788
MM
1701998-12-10 Mark Mitchell <mark@markmitchell.com>
171
172 * decl.c (start_enum): Use push_obstacks, not
173 end_temporary_allocation.
174 (finish_enum): Call pop_obstacks.
175
513e9d13
MM
1761998-12-10 Mark Mitchell <mark@markmitchell.com>
177
178 * class.c (instantiate_type): Return error_mark_node rather than
179 junk.
180
104bf76a
MM
1811998-12-09 Mark Mitchell <mark@markmitchell.com>
182
183 * cp-tree.h (most_specialized_instantiation): New function.
184 (print_candidates): Likewise.
185 * class.c (validate_lhs): Remove.
186 (resolve_address_of_overloaded_function): New function, split out
187 and then substantially reworked, from ...
188 (instantiate_type): Use it. Simplify.
189 * cvt.c (convert_to_reference): Complain when caller has indicated
190 that's the right thing to do. Don't crash if instantiate_type
191 fails.
192 * pt.c: Substitute `parameters' for `paramters' throughout.
193 (print_candidates): Don't make it static.
194 (most_specialized_instantiation): Split out from ...
195 (most_specialized): Here.
196
dfb0fb1d
DB
197Wed Dec 9 15:33:01 1998 Dave Brolley <brolley@cygnus.com>
198
199 * lex.c (lang_init_options): Initialize cpplib.
200 * decl2.c (parse_options,cpp_initialized): Removed.
201 (lang_decode_option): Move initialization of cpplib to
202 lang_init_options.
203
33964bf4
MM
2041998-12-09 Mark Mitchell <mark@markmitchell.com>
205
206 * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
207 well as the TYPE_DECL, when a typedef name is assigned to a
208 previously anonymous type.
209
e6cfb550
AM
2101998-12-08 Andrew MacLeod <amacleod@cygnus.com>
211
212 * cp/except.c (call_eh_info): use __start_cp_handler instead of
213 __cp_eh_info for getting the eh info pointer. Add table_index to
214 field list.
215 (push_eh_cleanup): Don't increment 'handlers' data field.
216 (process_start_catch_block): Don't set the 'caught' field.
217
218 * cp/exception.cc (CP_EH_INFO): New macro for getting the
219 exception info pointer within library routines.
220 (__cp_eh_info): Use CP_EH_INFO.
221 (__start_cp_handler): Get exception info pointer, set caught field,
222 and increment the handlers field. Avoids this being done by handlers.
223 (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
224 (uncaught_exception): Use CP_EH_INFO macro.
225
f454109f
JL
226Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com)
227
228 * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
229
069f7cf2
MS
230Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
231
232 * lex.c (check_newline): Add support for \ as `natural'
233 characters in file names in #line to be consistent with #include
234 handling. We support escape prcessing in the # 1 "..." version of
235 the command. See also support in cp/lex.c.
236
3a5ac29d
ZW
2371998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
238
239 * cp/decl2.c: s/data/opts/ when initializing cpp_reader
240 structure.
241
2642b9bf
JM
2421998-12-07 Jason Merrill <jason@yorick.cygnus.com>
243
244 * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
245
246 * error.c (dump_simple_decl): Also print namespace context.
247 (dump_function_decl): Likewise.
248
249 * decl2.c (ambiguous_decl): Don't print old value if it's
250 error_mark_node.
251
252 * decl.c (lookup_name_real): Fix handling of local types shadowed
253 by a non-type decl. Remove obsolete code.
254 * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
255
256 * lang-options.h: Add -fpermissive.
257 * decl2.c: Likewise.
258 * cp-tree.h: Add flag_permissive.
259 * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
260 were specified, set flag_pedantic_errors.
261 * call.c (build_over_call): Turn dropped qualifier messages
262 back into pedwarns.
263 * cvt.c (convert_to_reference): Likewise.
264 * typeck.c (convert_for_assignment): Likewise.
265
ee996e9e
JM
2661998-12-05 Jason Merrill <jason@yorick.cygnus.com>
267
268 * decl2.c (coerce_new_type): Use same_type_p.
269 (coerce_delete_type): Likewise.
270
271 * call.c (check_dtor_name): Return 1, not error_mark_node.
272
f3400fe2
JM
2731998-12-04 Jason Merrill <jason@yorick.cygnus.com>
274
053a61cb
JM
275 * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
276 if MULTIPLE_SYMBOL_SPACES.
277
f3400fe2
JM
278 * pt.c (check_template_shadow): New fn.
279 * decl2.c (grokfield): Use it.
280 * decl.c (pushdecl): Likewise.
281 (pushdecl_class_level): Likewise.
282 (start_method): Likewise.
283 (xref_tag): Don't try to use 't' if we're defining.
284
285 * call.c (check_dtor_name): Just return an error_mark_node.
286 * pt.c (lookup_template_class): Complain about using non-template here.
287 * parse.y (apparent_template_type): Not here.
288
289 * pt.c (check_explicit_specialization): Complain about specialization
290 with C linkage.
291
292 * lang-options.h: Add -f{no-,}implicit-inline-templates.
293
294 * pt.c (convert_nontype_argument): Don't assume that any integer
295 argument is intended to be a constant-expression.
296
2036a15c
MM
2971998-12-03 Mark Mitchell <mark@markmitchell.com>
298
299 * class.c (handle_using_decl): Fix comment. Don't lookup
300 constructors in base classes.
301 (validate_lhs): Fix typo in comment.
302 * search.c (lookup_field_1): Don't return a USING_DECL.
303
304 * cp-tree.h (DECL_ACCESS): Improve documentation.
305
306 * decl.c (expand_static_init): Don't set the initialization-done
307 flag until the initialization is done.
308
066b4a1c
MM
3091998-12-02 Mark Mitchell <mark@markmitchell.com>
310
311 * decl2.c (validate_nonmember_using_decl): Complain about using
312 declarations for class members.
313
9f3d9e46
JM
3141998-11-29 Jason Merrill <jason@yorick.cygnus.com>
315
7e2067ca
JM
316 * typeck2.c (process_init_constructor): Use same_type_p.
317
318 * decl.c (check_tag_decl): Don't warn about null decl inside a
319 class.
320
9f3d9e46
JM
321 * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
322 UNIFY_ALLOW_NONE.
323 (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
324 (resolve_overloaded_unification): Strip baselinks.
325
9d483bc4
KG
326Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
327
328 * g++spec.c: Don't prototype xmalloc.
329
08b24bda
JM
3301998-11-25 Jason Merrill <jason@yorick.cygnus.com>
331
332 * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
333
334 * decl.c (check_tag_decl): Do complain about null friend decl at
335 file scope.
336
32201ce4
AS
3371998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
338
339 * lex.c (make_lang_type): Clear the whole struct lang_type, not
340 only the first multiple of sizeof (int).
341
83f660b7
JM
3421998-11-24 Jason Merrill <jason@yorick.cygnus.com>
343
84e6233f
JM
344 * decl.c (start_decl): An explicit specialization of a static data
345 member is only a definition if it has an initializer.
346
c37dc68e
JM
347 * except.c (expand_throw): Use cp_finish_decl for the throw temp.
348 * cvt.c (build_up_reference): Pass DIRECT_BIND down into
349 cp_finish_decl.
350 * init.c (expand_default_init): Check for DIRECT_BIND instead of
351 DECL_ARTIFICIAL.
352
353 * call.c (build_over_call): Use build_decl.
354
355 * except.c (expand_throw): Just use convert, not
356 build_reinterpret_cast.
357
83f660b7
JM
358 * lex.c (handle_generic_pragma): Use token_buffer.
359
360 * decl.c (check_tag_decl): Don't complain about null friend decl.
361
3621998-11-24 Dave Pitts <dpitts@cozx.com>
363
364 * Make-lang.in (DEMANGLER_PROG): Move the output argumnts to the
365 first position.
366 * lex.c (check_newline): Use ISALPHA.
367 (readescape): Use ISGRAPH.
368 (yyerror): Use ISGRAPH.
369
3701998-11-24 Nathan Sidwell <nathan@acm.org>
371
372 * search.c (get_abstract_virtuals): Do not use initial
373 CLASSTYPE_ABSTRACT_VIRTUALS.
374 * typeck2.c (abstract_virtuals_error): Show location of abstract
375 declaration.
376 * call.c (build_new_method_call): Use
377 CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
378 * class.c (finish_struct_bits): Don't bother working out whether
379 get_abstract_virtuals will do anything, just do it.
380
333a9f0a
JM
3811998-11-24 Graham <grahams@rcp.co.uk>
382
383 * typeck.c (build_component_ref): Remove unused statement.
384
37b6eb34
JM
3851998-11-24 Jason Merrill <jason@yorick.cygnus.com>
386
333a9f0a
JM
387 * class.c (add_method): Catch invalid overloads.
388
37b6eb34
JM
389 * class.c (add_method): Build up OVERLOADs properly for conversion ops.
390 * search.c (lookup_conversions): Handle getting real OVERLOADs.
391 (add_conversions): Likewise. Revert last change.
392 * call.c (add_conv_candidate): Pass totype to add_candidate instead
393 of fn. Don't add a new candidate if the last one was for the same
394 type.
395 (print_z_candidates): Handle getting a type as a function.
396 (joust): If we got two conversion candidates to the same type,
397 just pick one.
398 (build_object_call): Lose 'templates'.
399 (build_user_type_conversion_1): Handle getting real OVERLOADs.
400
e6267549
JM
4011998-11-23 Jason Merrill <jason@yorick.cygnus.com>
402
403 * typeck2.c (process_init_constructor): If there are elements
404 that don't have initializers and they need to have constructors
405 run, supply them with initializers.
406
407 * class.c (finish_struct_1): A class with a 0-width bitfield is
408 still empty.
409
6bdb985f
MM
4101998-11-23 Mark Mitchell <mark@markmitchell.com>
411
412 * pt.c (instantiate_class_template): Don't try to figure out what
413 specialization to use for a partial instantiation. Correct
414 typos in a couple of comments. Avoid calling uses_template_parms
415 multiple times.
416
388022e0
BK
4171998-11-23 Benjamin Kosnik <bkoz@cygnus.com>
418
419 * method.c (process_overload_item): Add call to
420 build_mangled_C9x_name for intTI_type_nodes.
421 (build_mangled_C9x_name): Add prototype, define.
422 * decl.c (init_decl_processing): Add names for
423 TImode_type_node.
424
72a93143
JM
4251998-11-23 Jason Merrill <jason@yorick.cygnus.com>
426
57cfc5dd
JM
427 * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
428
72a93143
JM
429 * class.c (finish_struct_1): Set things up for 0-width bitfields
430 like we do for others.
431
432 * decl.c (check_tag_decl): New fn.
433 (shadow_tag): Split out from here.
434 * decl2.c (grok_x_components): Call it.
435
094fe153
JM
4361998-11-22 Jason Merrill <jason@yorick.cygnus.com>
437
ff0cf464
JM
438 * decl.c: Lose warn_about_return_type.
439 (grokdeclarator): Always complain about implicit int, except for
440 `main () { ... }'.
441
094fe153
JM
442 * decl.c (tag_name): New fn.
443 (xref_tag): Complain about using typedef-name after class-key.
444
445 * init.c (expand_vec_init): Also keep going if from_array.
446
447 * tree.c (is_overloaded_fn): Also handle the output of
448 build_offset_ref.
449
450 * decl.c (grokdeclarator): Use constructor_name when comparing
451 field name against enclosing class.
452 * class.c (finish_struct_anon): Likewise.
453
536333d4
MM
4541998-11-22 Mark Mitchell <mark@markmitchell.com>
455
456 * decl.c (poplevel): Remove code to handle KEEP == 2.
457 (finish_function): Don't confuse BLOCK-order when
458 processing a destructor.
459
42f989ff
JM
4601998-11-21 Jason Merrill <jason@yorick.cygnus.com>
461
462 * decl.c (require_complete_types_for_parms): Call layout_decl
463 after we've completed the type.
464
75fbcb7d
ML
465