OSDN Git Service

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