OSDN Git Service

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