OSDN Git Service

* class.c: Fix comment typos.
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
2
3         * class.c: Fix comment typos.
4         * decl.c: Likewise.
5         * error.c: Likewise.
6         * parser.c: Likewise.
7         * pt.c: Likewise.
8         * search.c: Likewise.
9         * typeck.c: Likewise.
10
11 2004-01-30  Richard Henderson  <rth@redhat.com>
12
13         PR c++/13693
14         * method.c (use_thunk): Don't force_target_expr for void thunks.
15         * tree.c (build_target_expr_with_type): Assert non-void type.
16         (force_target_expr): Likewise.
17
18 2004-01-30  Michael Matz  <matz@suse.de>
19
20         * parser.c (cp_parser_labeled_statement): Accept case ranges.
21
22 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
23
24         DR206
25         PR c++/13813
26         * decl.c (grokdeclarator): Check immediatly type completeness for
27         non-dependent types.
28
29 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
30
31         PR c++/13683
32         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
33         a sizeof expression.block
34
35 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
36
37         PR c++/13883
38         * mangle.c (write_encoding): Correct encoding of member template
39         constructors.
40
41 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
42
43         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a 
44         template name as it was `<::' (digraph typo).
45         (cp_parser_nth_token_starts_template_argument_list_p): New function.
46         (cp_parser_id_expression): Use it.
47         (cp_parser_nested_name_specifier_opt): Likewise.
48         (cp_parser_template_name): Likewise.
49         (cp_parser_class_name): Likewise.
50         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
51
52 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
53
54         PR c++/13791
55         * typeck.c (merge_types): Do not merge attributes into
56         TYPENAME_TYPEs.
57
58         PR c++/13736
59         * parser.c (cp_parser_direct_declarator): Do not prevent
60         backtracking inside a parenthesized declarator.
61         (cp_parser_parameter_declaration): Fix typo in comment.
62
63 2004-01-28  Jan Hubicka  <jh@suse.cz>
64
65         * semantics.c (expand_body)  Do emit_associated_thunks before
66         expansion.
67
68 2004-01-27  Devang Patel  <dpatel@apple.com>
69
70         * name-lookup.c: Include "debug.h"
71         (do_namespace_alias): Invoke debug_hooks to emit debug info
72         for namespace alias.
73         (do_local_using_decl): Invoke debug_hooks to emit debug info 
74         for using decl.
75         (do_class_using_decl): Same.
76         (do_toplevel_using_decl): Same.
77         (do_using_directive): Same.
78         (cp_emit_debug_info_for_using): New function.
79         * Make-lang.in (cp/parser.o): Depend on debug.h
80         (cp/name-lookup.o): Same.
81
82 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
83
84         * cp-tree.h (language_function, lang_type_header): Use
85         BOOL_BITFIELD.
86         * name-lookup.h (cp_binding_level): Likewise.
87
88 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
89
90         PR c++/13663
91         * semantics.c (finish_for_expr): Check for unresolved overloaded
92         functions.
93
94         * class.c (add_method): Just check processing_template_decl to
95         determine whether or not we are within a template.
96         * decl2.c (maybe_retrofit_in_chrg): Likewise.
97         * init.c (decl_constant_value): Check the type of the declaration,
98         not TREE_READONLY.
99         * name-lookup.c (maybe_push_to_top_level): Rename to ...
100         (push_to_top_level): ... this.
101         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
102         * pt.c (push_template_decl_real): Reorder condition for speed.
103         (convert_template_argument): Use dependency-checking functions in
104         place of uses_template_parms.
105         (lookup_template_class): Avoid calling uses_template_parms more
106         than once.
107         (uses_template_parms): Reimplement, using dependency-checking
108         functions.
109         (instantiate_class_template): Use push_to_top_level, not
110         maybe_push_to_top_level.
111         (type_unification_real): Simplify.
112         (type_dependent_expression_p): Handle OFFSET_REFs and
113         TEMPLATE_DECLs.
114         (any_dependent_template_arguments_p): Handle multiple levels of
115         template argument.
116         * semantics.c (expand_or_defer_fn): Do not check
117         uses_template_parms for template instantiations.
118         * typeck.c (comptypes): Avoid calling cp_type_quals.
119
120 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
121
122         PR c++/13833
123         * call.c (build_over_call): Do not convert arguments when
124         processing a template.
125         * pt.c (build_non_dependent_expr): Do not build a
126         NON_DEPENDENT_EXPR for arithmetic constants.
127
128 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
129
130         PR c++/13810
131         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression 
132         returns a TYPE_DECL. no further lookup is required.
133         * semantics.c (check_template_template_default_arg): A TYPE_DECL
134         is invalid. Rework to give better diagnostics.
135
136 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
137
138         PR c++/13797
139         * pt.c (instantiate_class_template): Add an error_mark_node
140         check.
141         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
142
143 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
144
145         PR c++/13701
146         * decl.c (finish_function): Move the call to
147         finish_fname_decls below the call to
148         finish_eh_spec_block.
149
150 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
151
152         * optimize.c, typeck2.c: Update copyright.
153
154 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
155
156         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
157         init.c, mangle.c, typeck.c: Update copyright.
158
159 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
160
161         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
162
163 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
164
165         * Make-lang.in: Replace $(docdir) with doc.
166         (c++.info, c++.srcinfo): Dummy entry.
167         (c++.man, c++.srcman): New rules.
168         (c++.install-man): Revamp rule.
169
170 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
171
172         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME, 
173         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
174         immediate $(shell) instead of deferred backquote.
175
176 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
177
178         PR c++/13651
179         * parser.c (cp_parser_postfix_expression): When encountering
180         incomplete type on left-hand side of "->" or ".", treat the entire
181         expression as erroneous.
182
183         PR c++/13592
184         * call.c (build_field_call): Remove.
185         (n_build_method_call): Likewise.
186         (build_method_call): Likewise.
187         (build_new_method_call): Do not call build_field_call.
188         * class.c (n_build_method_call): Remove.
189         (print_class_statistics): Do not print it.
190         * cp-tree.h (build_method_call): Remove declaration.
191         (finish_object_call_expr): Likewise.
192         (build_new_1): Do not use build_method_call.
193         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
194         when the function appearing on the right-hand-side of "." or "->"
195         is not actually a function.
196         * pt.c (tsubst_copy_and_build): Likewise.
197         * semantics.c (finish_object_call_expr): Remove.
198
199 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
200
201         PR c++/13710
202         * pt.c (tsubst): Use finish_typeof.
203
204 2004-01-16  Jason Merrill  <jason@redhat.com>
205
206         PR c++/11725
207         * except.c (build_throw): In a template, set
208         current_function_returns_abnormally.
209
210 2004-01-17  Fred Fish  <fnf@intrinsity.com>
211
212         PR c++/11895
213         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
214         except don't call array_type_nelts() with a VECTOR_TYPE.
215
216 2004-01-16  Jan Hubicka  <jh@suse.cz>
217
218         * mangle.c (write_mangled_name): Remove inline modifier.
219
220 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
221
222         PR c++/13574
223         * decl.c (compute_array_index_type): Fix grammar in comment.
224         * init.c (build_zero_init): Handle zero-sized arrays correctly.
225
226         PR c++/13178
227         * call.c (name_as_c_string): Print conversion operator names
228         correctly.
229
230         PR c++/13478
231         * call.c (initialize_reference): Pass -1 for inner parameter to
232         convert_like_real.
233
234 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
235
236         PR c++/13407
237         * parser.c (cp_parser_base_specifier): Check for an invalid
238         keyword `typename' and emit an user-friendly error message.
239
240 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
241
242         PR pch/13361
243         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
244         (handle_pragma_implementation): Likewise.
245
246 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
247
248         PR c++/9259
249         * typeck.c (build_class_member_access_expr): Allow to access members
250         of the currently open class.
251         (finish_class_member_access_expr): Likewise.
252
253 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
254
255         PR c++/13659
256         * name-lookup.c (validate_nonmember_using_decl): Take scope and
257         name by value, instead of computing them.
258         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
259         arguments.  Pass them to validate_nonmember_using_decl.
260         * name-lookup.h (do_local_using_decl): Adjust.
261         (do_toplevel_using_decl): Likewise.
262         * parser.c (cp_parser_using_declaration): Likewise.
263         * pt.c (tsubst_expr): Likewise.
264
265 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
266
267         PR c++/13594
268         PR c++/13658
269         * name-lookup.c (qualified_lookup_using_namespace): Search
270         strongly-associated namespaces first, and only then try other
271         namespaces.
272
273 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
274
275         * Make-lang.in (c++.srcextra): Dummy entry.
276
277 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
278
279         PR c++/8856
280         * parser.c (cp_parser_template_name): Don't try to parse a 
281         conversion-function-id, as it cannot be a template-name.
282         (cp_parser_simple_type_specifier): Check for invalid template-ids
283         even after a built-in type.
284
285 2004-01-14  Jan Hubicka  <jh@suse.cz>
286
287         PR c++/12850
288         * pt.c (instantiate_decl):  Do not increase function_depth.
289
290 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
291
292         PR c++/9021
293         PR c++/11005
294         * parser.c (cp_parser_elaborated_type_specifier): Warn about
295         attributes and discard.
296         * decl.c (xref_tag): Don't overwite existing attributes with
297         NULL_TREE.
298
299 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
300
301         PR c++/12335
302         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
303         is no destructor while looking up a BIT_NOT_EXPR.
304
305 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
306
307         * cxxfilt.c: Remove unused file.
308
309 2004-01-14  Jan Hubicka  <jh@suse.cz>
310
311         Partial fix to PR c++/12850
312         * decl2.c (mark_used): Do not proactively instantiate templates
313         when compiling in unit-at-a-time or not optimizing.
314         * optimize.c (maybe_clone_body): Do not increase function depth.
315
316 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
317
318         PR c++/13474
319         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
320
321 2003-01-12  Steven Bosscher  <stevenb@suse.de>
322
323         PR c++/13558
324         * parser.c (cp_parser_member_declaration): Any non-type is also
325         not a class or a function.
326
327 2004-01-12  Jason Merrill  <jason@redhat.com>
328
329         PR c++/12815
330         * class.c (build_base_path): Do not mark vtable references as
331         TREE_CONSTANT.
332         (build_vtbl_ref_1): Likewise.
333
334 2004-01-12  Richard Henderson  <rth@redhat.com>
335
336         PR opt/10776
337         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
338         (store_init_value): Use it.
339         * decl.c (check_initializer): Expect full initialization code
340         from store_init_value.
341         * init.c (expand_aggr_init_1): Likewise.
342         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
343
344 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
345
346         * class.c (layout_class_type): For non-POD class types, also copy
347         the DECL_SIZE and DECL_MODE of fields to the base class type.
348
349 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
350
351         PR c++/13289
352         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
353         calling regenerate_decl_from_template.
354
355 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
356
357         PR c++/4100
358         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
359         decl-specifier occurring along with a class definition.
360
361 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
362
363         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
364         clauses to comments describing declares_class_or_enum.
365         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
366         false.
367
368 2004-01-12  Jan Hubicka  <jh@suse.cz>
369
370         * pt.c (for_each_template_parm): Do not check for duplicates.
371         (for_each_template_parm): Use walk_tree duplicate checking code.
372
373 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
374
375         PR c++/3478
376         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
377         is error_mark_node, don't add any more decl_specs.
378         (cp_parser_init_declarator): After committing to a declaration, if
379         the decl_specifiers start with error_mark_node, issue an error and
380         change the type to "int".
381
382 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
383
384         PR bootstrap/7817
385         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
386
387 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
388
389         DR 337
390         PR c++/9256
391         * pt.c (tsubst): Substitution must fail if we are attempting to 
392         create an array with element type that is an abstract class type.
393         * decl.c (cp_finish_decl): Strip pointers and array types recursively
394         before calling abstract_virtuals_error.
395
396 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
397
398         * name-lookup.c (qualified_lookup_using_namespace): Consider
399         strong using directives even if we've already found a binding.
400
401 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
402
403         * cp-tree.h (cxx_expand_expr): Change prototype.
404         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
405
406 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
407
408         PR c++/12573
409         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
410         looking into them recursively. They can be there because of the
411         new __offsetof__ extension.
412
413 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
414
415         * parser.c (cp_parser_save_member_function_body): Mark the
416         definition static.
417
418 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
419
420         PR c++/13057
421         * class.c (build_clone): Copy type attributes from the original
422         function to the clone.
423
424         PR c++/12815
425         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
426         references as constant.
427
428         PR c++/12132
429         * parser.c (cp_parser_explicit_instantiation): Improve error
430         recovery.
431         (cp_parser_require): Improve indication of the error location.
432
433         PR c++/13451
434         * parser.c (cp_parser_class_head): Reorder logic to check for
435         invalid qualification.
436
437 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
438
439         PR c++/13157
440         * name-lookup.c (lookup_using_namespace): Remove spacesp
441         parameter.
442         (unqualified_namespace_lookup): Likewise.
443         (lookup_qualified_name): Adjust accordingly.
444         (lookup_name_real): Likewise.
445         (lookup_arg_dependent): Do not eliminate the namespace of the
446         functions found by unqualified name lookup unless that is the
447         current namespace.
448
449 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
450
451         * semantics.c (push_deferring_access_checks): Fix format.
452         (resume_deferring_access_checks): Likewise.
453         (stop_deferring_access_checks): Likewise.
454         (pop_deferring_access_checks): Likewise.
455         (get_deferred_access_checks): Likewise.
456         (pop_to_parent_deferring_access_checks): Likewise.
457         (perform_deferred_access_checks): Likewise.
458         (perform_or_defer_access_check): Likewise.
459
460 2004-01-04  Richard Henderson  <rth@redhat.com>
461
462         * call.c (build_over_call): Don't create a save_expr of an
463         aggregate, but rather its address.
464
465 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
466
467         PR c++/13529
468         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
469         an offsetof expression.
470
471         * parser.c (cp_parser_parameter_declaration): Fix comment.
472
473         PR c++/12226
474         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
475         (reference_binding): Set it when appropriate.
476         (build_temp): New function, split out from ...
477         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
478         (initialize_reference): Likewise.
479
480         PR c++/13536
481         * parser.c (cp_parser): Add in_type_id_in_expr_p.
482         (cp_parser_new): Initialize it.
483         (cp_parser_postfix_expression): Set it.
484         (cp_parser_sizeof_operand): Likewise.
485         (cp_parser_parameteR_declaration): Do not commit early to tenative
486         parsers when in_type_id_in_expr_p is set.
487
488 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
489
490         PR c++/13094
491         * parser.c (cp_parser_template_argument): Don't call
492         make_unbound_class_template directly.
493         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
494         UNBOUND_CLASS_TEMPLATE tree node.
495
496 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
497
498         PR target/12729
499         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
500
501 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
502
503         PR c++/13520
504         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
505         (DECL_FUNCTION_TEMPLATE_P): Use it.
506         (DECL_CLASS_TEMPLATE_P): Likewise.
507         * parser.c (cp_parser_lookup_name): Add is_template parameter.
508         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
509         (cp_parser_template_name): Likewise.
510         (cp_parser_elaborated_type_specifier): Likewise.
511         (cp_parser_namespace_name): Likewise.
512         (cp_parser_class_name): Likewise.
513         (cp_parser_lookup_name_simple): Likewise.
514
515 See ChangeLog.3 for earlier changes.