OSDN Git Service

PR c++/19878
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2005-02-23  Mark Mitchell  <mark@codesourcery.com>
2
3         PR c++/19878
4         * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
5         with internal linkage.
6
7 2005-02-23  Alexandre Oliva  <aoliva@redhat.com>
8
9         * decl.c (grokvardecl): Don't exempt anonymous types from having
10         linkage for variables that have linkage other than "C".
11
12 2005-02-23  Kazu Hirata  <kazu@cs.umass.edu>
13
14         * cp-objcp-common.h, error.c: Update copyright.
15
16 2005-02-22  Mark Mitchell  <mark@codesourcery.com>
17
18         PR c++/20073
19         * decl.c (start_decl_1): Don't clear TREE_READONLY.
20         (cp_finish_decl): Likewise.
21         (complete_vars): Call cp_apply_type_quals_to_decl.
22         * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in
23         cases where that's not valid.
24
25         PR c++/19991
26         * init.c (integral_constant_value): Iterate if the value of a decl
27         is itself a constant.
28
29         PR c++/20152
30         * parser.c (cp_parser_class_head): Check for redefintions here.
31         * semantics.c (begin_class_definition): Not here.
32         
33         PR c++/20153
34         * decl2.c (build_anon_union_vars): Add type parameter.
35         (finish_anon_union): Pass it.
36
37         PR c++/20148
38         * error.c (dump_expr): Do not print the body of a BIND_EXPR.
39         Handle STATEMENT_LIST.
40
41         PR c++/19883
42         * parser.c (cp_parser_direct_declarator): Always complain about
43         non-constant array bounds when in a function scope.
44         * semantics.c (finish_id_expression): Do not mark dependent names
45         as non-constant. 
46
47 2005-02-21  Douglas Gregor  <dgregor@cs.indiana.edu>
48         
49         PR c++/19076
50         PR c++/6628
51         * cp-tree.h (cp_apply_type_quals_to_decl): Declared.
52         * decl.c (grokdeclarator): Pedwarn about qualifying a function
53         type. 
54         Add qualifiers when declaring a typedef of a function type.
55         Member function pointers pick up the qualifiers of the typedef
56         used to declare them.
57         Don't complain about creating cv-qualified function types.
58         Complain about qualified function typedefs that are used to
59         declare non-static member functions or free functions.
60         Use cp_apply_type_quals_to_decl.
61         (start_preparsed_function): Use cp_apply_type_quals_to_decl.
62         (grokclassfn): Use cp_apply_type_quals_to_decl.
63         * error.c (dump_type_suffix): Print qualifiers for function
64         types. 
65         * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
66         (tsubst): When substituting a function type into a member
67         pointer type, pass along the qualifiers.
68         (unify): Unify member pointers to member function pointers.
69         * tree.c (cp_build_qualified_type_real): Function types may be
70         qualified. This includes restrict qualifiers.
71         * typeck.c (cp_apply_type_quals_to_decl): New function to replace
72         use of c_apply_type_quals_to_decl. Drops qualifiers that are being
73         added to function types.
74
75 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
76
77         PR 18785
78         * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
79         c_common_to_target_charset.  Delete bogus comment.
80
81 2005-02-18  Richard Henderson  <rth@redhat.com>
82
83         PR libstdc++/10606
84         * except.c (do_get_exception_ptr): New.
85         (expand_start_catch_block): Use it.
86
87 2005-02-19  Jakub Jelinek  <jakub@redhat.com>
88
89         * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING
90         if type is not error_mark_node.
91
92 2005-01-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
93
94         PR c++/19508
95         * decl2.c (grokfield): Do not apply attributes to template parameters
96         as they are ignored by tsubst anyway.
97
98 2005-02-18  Jakub Jelinek  <jakub@redhat.com>
99
100         PR c++/19813
101         * decl.c (start_decl_1): Clear TREE_READONLY flag if
102         its type has TYPE_NEEDS_CONSTRUCTING.
103         (complete_vars): Likewise.
104
105 2005-02-17  Alexandre Oliva  <aoliva@redhat.com>
106
107         PR c++/20028
108         * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a
109         template along with TYPE_SIZE.
110
111         PR c++/20022
112         * semantics.c (perform_deferred_access_checks): Use
113         get_deferred_access_checks to get the top of the stack.
114
115 2005-02-15  Alexandre Oliva  <aoliva@redhat.com>
116
117         PR c++/17788
118         * class.c (add_implicitly_declared_members, check_field_decl)
119         (check_field_decls, check_bases): Remove arguments, tests and
120         assignments of cant_have_default_ctor-related variables.
121
122 2005-02-15  Alexandre Oliva  <aoliva@redhat.com>
123
124         * decl2.c (mark_used): Set the source location of the used decl to
125         the current input location here...
126         * method.c (synthesize_method): ... not here.  Set input_location
127         from the decl instead.
128
129 2005-02-14  Nathan Sidwell  <nathan@codesourcery.com>
130
131         PR c++/19608
132         * parser.c (cp_parser_late_parsing_for_member): Use
133         current_function_decl as scope to push to and from.
134
135         PR c++/19884
136         * pt.c (check_explicit_specialization): Make sure namespace
137         binding lookup found an overloaded function.
138         (lookup_template_function): Just assert FNS is an overloaded
139         function.
140
141         PR c++/19895
142         * decl.c (grokdeclarator): Check for error mark node in ptrmem
143         construction.
144
145 2005-02-14  Alexandre Oliva  <aoliva@redhat.com>
146
147         PR c++/17816
148         * decl.c (redeclaration_error_message): Report redefinition of
149         pure virtual function.
150
151 2005-02-14  Nathan Sidwell  <nathan@codesourcery.com>
152
153         PR c++/19891
154         * class.c (build_simple_base_path): Build the component_ref
155         directly.
156         (update_vtable_entry_for_fn): Walk the covariant's binfo chain
157         rather than using lookup_base.
158         * search.c (dfs_walk_once): Add non-recursive assert check.
159         * typeck.c (build_class_member_access_expr): It is possible for
160         the member type to be both const and volatile.
161
162 2005-02-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
163
164         PR c++/14479
165         PR c++/19487
166         * pt.c (maybe_check_template_type): Remove.
167         * cp-tree.h (maybe_check_template_type): Remove prototype.
168         * name-lookup.c (maybe_process_template_type_declaration): Don't
169         use maybe_check_template_type.
170
171 2005-02-11  Richard Henderson  <rth@redhat.com>
172
173         PR c++/19632
174         * pt.c (get_mostly_instantiated_function_type): Save and restore
175         flag_access_control instead of push/pop_access_scope.
176
177 2005-02-10  Mark Mitchell  <mark@codesourcery.com>
178
179         PR c++/19755
180         * decl.c (reshape_init): Issue warnings about missing braces.
181
182 2005-02-11  Kazu Hirata  <kazu@cs.umass.edu>
183
184         * cp-tree.def, except.c, ptree.c: Update copyright.
185
186 2005-02-09  Mark Mitchell  <mark@codesourcery.com>
187
188         PR c++/19811
189         * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
190         attempting name lookup.
191
192         * parser.c (cp_parser_unqualified_id): Initialize type_decl.
193
194         PR c++/19787
195         * call.c (initialize_reference): Robustify.
196
197         PR ++/19732
198         * decl.c (grokdeclarator): Check for invalid use of destructor
199         names.
200
201         PR c++/19762
202         * parser.c (cp_parser_unqualified_id): Avoid creating destructor
203         names with invalid types.
204
205         PR c++/19826
206         * parser.c (cp_parser_direct_declarator): Allow type-dependent
207         expressions as array bounds.
208
209         PR c++/19739
210         * parser.c (cp_parser_attributes_list): Allow empty lists.
211
212 2005-02-08  Mark Mitchell  <mark@codesourcery.com>
213
214         PR c++/19733
215         * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR.
216         (check_bases): Give warnings about a base class with a
217         non-virtual destructor, even if it is implicit.
218         (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR.
219         (maybe_warn_about_overly_private_class): Don't use
220         TYPE_HAS_DESTRUCTOR.
221         (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR.
222         (check_for_override): Give it external linkage.
223         (add_implicitly_declared_members): Generate destructors lazily.
224         (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
225         TYPE_HAS_DESTRUCTOR.
226         (check_bases_and_members): Call check_methods before
227         check_field_decls.
228         (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
229         TYPE_HAS_DESTRUCTOR.
230         (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR.
231         * cp-tree.def (PSEUDO_DTOR_EXPR): Document.
232         * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove.
233         (lang_type_class): Add lazy_destructor.
234         (CLASSTYPE_LAZY_DESTRUCTOR): New macro.
235         (CLASSTYPE_DESTRUCTORS): Robustify.
236         (TYPE_HAS_DESTRUCTOR): Remove.
237         (check_for_override): Declare.
238         (build_vbase_delete): Remove.
239         * cvt.c (convert_to_void): Issue errors about pseudo-destructor
240         expressions.
241         * decl.c (cxx_maybe_build_cleanup): Remove dead code.
242         * except.c (dtor_nothrow): Lazily create destructors if necessary.
243         (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
244         * init.c (build_delete): Lazily create destructors, if necessary.
245         (build_vbase_delete): Remove.
246         * method.c (locate_dtor): Simplify.
247         (implicitly_declare_fn): Add support for destructors.
248         * parser.c (cp_parser_lookup_name): Lazily create destructors, if
249         necessary.
250         * pt.c (check_explicit_specialization): Don't use
251         TYPE_HAS_DESTRUCTOR.
252         (instantiate_class_template): Likewise.
253         * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR.
254         * rtti.c (emit_support_tinfos): Robustify.
255         * search.c (lookup_fnfields_1): Lazily create destructors.
256         * typeck.c (build_class_member_access_expr): Remove
257         PSEUDO_DTOR_EXPR handling.
258         (lookup_destructor): Likewise.
259
260 2005-02-08  Kazu Hirata  <kazu@cs.umass.edu>
261
262         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update
263         copyright.
264
265 2005-02-07  Mark Mitchell  <mark@codesourcery.com>
266
267         * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations
268         on boolean variables.
269         (cp_lexer_stop_debugging): Likewise.
270
271 2005-02-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
272
273         PR c++/17401
274         * parser.c (cp_parser_pure_specifier): Emit a specific error
275         message with an invalid pure specifier.
276         * decl2.c (grok_function_init): Remove.
277         (grokfield): An initializer for a method is a always a pure
278         specifier.
279
280 2005-02-02  Matt Austern  <austern@apple.com>
281
282         PR c++/19628
283         * cp-tree.h (builtin_valid_in_constant_expr_p): Declare.
284         * parser.c (cp_parser_postfix_expression): Accept function call in
285         constant expression if builtin_valid_in_constant_expr_p is true
286         for that function.
287         * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly.
288         * semantics.c (finish_id_expression): Accept function call in constant
289         expression if builtin_valid_in_constant_expr_p is true for that
290         function.
291         * tree.c (builtin_valid_in_constant_expr_p): New.
292
293 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
294
295         PR c++/17413
296         * pt.c (check_instantiated_args): Improve error message.
297         Fix logic when to print its second part.
298
299 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
300
301         * cp-tree.h (complete_type_or_else): Remove macro.
302         (complete_type_or_diagnostic): Rename to complete_type_or_else
303         and remove last argument.
304         * typeck.c (complete_type_or_diagnostic): Rename to
305         complete_type_or_else and remove last argument.
306
307 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
308
309         * cp-tree.h (commonparms): Remove prototype.
310         (convert_arguments): Likewise.
311         (PFN_FROM_PTRMEMFUNC): Remove.
312         * typeck.c (commonparms): Make static.
313         (convert_arguments): Add prototype. Make static.
314         (PFN_FROM_PTRMEMFUNC): Replace by pfn_from_ptrmemfunc.
315
316 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
317
318         * parser.c (cp_parser_primary_expression): Don't complain about
319         floating-point literals in integral constant expressions when
320         !pedantic.
321
322 2005-02-01  Alexandre Oliva  <aoliva@redhat.com>
323
324         * parser.c (cp_parser_template_id): Revert comment patch too.
325
326         PR c++/18757
327         PR c++/19366
328         PR c++/19499
329         * parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
330         Issue an error when creating the template id.
331         * pt.c (fn_type_unification): Return early if the explicit
332         template arg list is an error_mark_node.
333
334 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
335
336         * decl.c (build_enumerator): Do not issue duplicate error messages
337         about invalid enumeration constants.
338         * parser.c (cp_parser_non_integral_constant_expression): Always
339         set parser->non_integral_constant_expression_p.
340         (cp_parser_primary_expression): Add cast_p parameter.  Issue
341         errors about invalid uses of floating-point literals in
342         cast-expressions.
343         (cp_parser_postfix_expression): Add cast_p parameter.
344         (cp_parser_open_square_expression): Pass it.
345         (cp_parser_parenthesized_expression_list): Add cast_p parameter.
346         (cp_parser_unary_expression): Likewise.
347         (cp_parser_new_placement): Pass it.
348         (cp_parser_direct_new_declarator): Likewise.
349         (cp_parser_new_initializer): Likewise.
350         (cp_parser_cast_expression): Add cast_p parameter.
351         (cp_parser_binary_expression): Likewise.
352         (cp_parser_question_colon_clause): Likewise.
353         (cp_parser_assignment_expression): Likewise.
354         (cp_parser_expression): Likewise.
355         (cp_parser_constant_expression): If an integral constant
356         expression is invalid, return error_mark_node.
357         (cp_parser_expression_statement): Pass cast_p.
358         (cp_parser_condition): Likewise.
359         (cp_parser_iteration_statement): Likewise.
360         (cp_parser_jump_statement): Likewise.
361         (cp_parser_mem_initializer): Likewise.
362         (cp_parser_template_argument): Likewise.
363         (cp_parser_parameter_declaration): Likewise.
364         (cp_parser_initializer): Likewise.
365         (cp_parser_throw_expression): Likewise.
366         (cp_parser_attribute_list): Likewise.
367         (cp_parser_simple_cast_expression): Likewise.
368         (cp_parser_functional_cast): Likewise.
369         (cp_parser_late_parsing_default_args): Likewise.
370         (cp_parser_sizeof_operand): Save/restore
371         non_integral_constant_expression_p.
372
373 2005-01-31  Mike Stump  <mrs@apple.com>
374
375         * parser.c (cp_lexer_new_main): Get the first token, first, before
376         doing anything.
377
378 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
379
380         * decl.c (start_decl): Add missing parentheses.
381
382 2005-01-30  Mark Mitchell  <mark@codesourcery.com>
383
384         PR c++/19555
385         * cp-tree.h (DECL_USE_TEMPLATE): Expand documentation.
386         * decl.c (duplicate_decls): Do not discard
387         DECL_IMPLICIT_INSTANTIATION when merging declarations.
388         (start_decl): Do not SET_DECL_TEMPLATE_SPECIALIZATION for
389         variables that do not have DECL_USE_TEMPLATE.
390
391         PR c++/19395
392         * decl.c (grokdeclarator): Refactor code so that qualified names
393         are never allowed as the declarator in a typedef.
394
395         PR c++/19367
396         * name-lookup.c (do_nonmember_using_decl): Avoid overloading
397         builtin declarations.
398
399         PR c++/19457
400         * call.c (convert_like_real): Inline call to
401         dubious_conversion_warnings here.
402         * cp-tree.h (dubious_conversion_warnings): Remove.
403         * semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before
404         setting TREE_NEGATED_INT.
405         * typeck.c (dubious_conversion_warnings): Remove.
406
407         PR c++/19349
408         * name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
409         memory.
410
411 2005-01-28  Mark Mitchell  <mark@codesourcery.com>
412
413         PR c++/19253
414         * parser.c (cp_parser_diagnose_invalid_type_name): Commit to
415         tentative parses.
416
417         PR c++/19667
418         * pt.c (redeclare_class_template): Robustify.
419
420 2005-01-27  Steven Bosscher  <stevenb@suse.de>
421
422         * decl.c (finish_case_label): Use SWITCH_STMT accessor macros
423         instead of SWITCH_EXPR ones.
424         * pt.c (tsubst_expr): Likewise.
425         * semantics.c (begin_switch_stmt, finish_switch_cond,
426         finish_switch_stmt): Likewise.
427
428 2005-01-26  J"orn Rennecke <joern.rennecke@st.com>
429
430         PR c++/18370
431         * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.
432
433 2005-01-25  Andrew Pinski  <pinskia@physics.uc.edu>
434
435         * class.c (abort_fndecl_addr): New variable.
436         (build_vtbl_initializer): If we have a pure virtual function
437         share the abort function's address.
438         Include gt-cp-class.h at the end.
439         * config-lang.in (gtfiles): Add cp/class.c.
440
441 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
442
443         * cxx-pretty-print.c (pp_cxx_statement): Add prototype. Make static.
444         (pp_cxx_function_definition): Make static.
445         * cxx-pretty-print.h (pp_cxx_statement): Remove prototype.
446         (pp_cxx_function_definition): Likewise.
447
448 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
449
450         * name-lookup.c (print_binding_level): Make static.
451         (constructor_name_full): Make static inline.
452         (current_decl_namespace): Make static.
453         * name-lookup.h (constructor_name_full): Remove prototype.
454         (print_binding_level): Likewise.
455         (current_decl_namespace): Likewise.
456
457 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
458
459         * decl.h (debug_bindings_indentation): Remove.
460
461 2005-01-23  Kazu Hirata  <kazu@cs.umass.edu>
462
463         * typeck.c: Fix a comment typo.
464
465 2005-01-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
466
467         PR c++/19208
468         * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr
469         at least once.
470         (tsubst): Use fold_decl_constant_value in place of a bare call to
471         integral_constant_value.
472
473 2005-01-20  Kazu Hirata  <kazu@cs.umass.edu>
474
475         * typeck.c (more_qualified_p): Remove.
476         * cp-tree.h: Remove the corresponding prototype.
477
478 2005-01-19  Matt Austern  <austern@apple.com>
479
480         * typeck.c (comptypes): Handle return code from objc_comptypes
481         correctly.
482
483 2005-01-19  Kazu Hirata  <kazu@cs.umass.edu>
484
485         * cp-tree.h, name-lookup.h: Remove unused prototypes.
486
487 2005-01-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
488
489         PR c++/19375
490         * semantics.c (finish_id_expression): Disable access checking for
491         already lookuped FIELD_DECL.
492
493 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
494
495         * decl.c (delete_block): Remove.
496         * cp-tree.h: Remove the corresponding prototype.
497
498         * decl.c (vtable_decl_p, vtype_decl_p, walk_globals_data,
499         walk_vtables_r, walk_vtables, walk_globals_r, walk_globals):
500         Remove.
501         * cp-tree.h: Remove the corresponding prototypes.
502
503         * tree.c (count_functions, bound_pmf_p, cp_is_overload_p,
504         cp_update_decl_after_saving, name_p): Remove.
505         * cp-tree.h: Remove the corresponding prototypes.
506
507 2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>
508
509         PR c/19472
510         * semantics.c (finish_asm_stmt): Strip nops off
511         input memory operands.
512
513 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
514
515         * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,
516         typeck2.c: Update copyright.
517
518 2005-01-16  Kazu Hirata  <kazu@cs.umass.edu>
519
520         * class.c (get_enclosing_class): Remove.
521         * cp-tree.h: Remove the corresponding prototypes.
522
523         * cvt.c (convert_lvalue): Remove.
524         * cp-tree.h: Remove the corresponding prototype.
525
526         * pt.c (tinst_for_decl): Remove.
527         * cp-tree.h: Remove the corresponding prototypes.
528
529         * tree.c (hash_chainon): Remove.
530         * cp-tree.h: Remove the corresponding prototypes.
531
532 2005-01-15  Jakub Jelinek  <jakub@redhat.com>
533
534         PR c++/19263
535         * typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
536         of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
537
538 2005-01-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
539
540         * Make-lang.in (cp-warn): Don't append $(WERROR).
541
542 2005-01-10  Kazu Hirata  <kazu@cs.umass.edu>
543
544         * cp-tree.h: Fix a comment typo.
545
546 2005-01-07  Nathan Sidwell  <nathan@codesourcery.com>
547
548         PR c++/19298
549         * pt.c (tsubst_qualified_id): Call convert_from_reference.
550
551 2005-01-06  Mark Mitchell  <mark@codesourcery.com>
552
553         PR c++/19244
554         * class.c (add_implicitly_declared_members): Remove dead code.
555         * decl.c (grokfndecl): Add sfk parameter.  Use it do set
556         DECL_CONSTRUCTOR_P.
557         (grokdeclarator): Adjust calls to grokfndecl.
558         * method.c (implicitly_declare_fn): Improve documentation.
559         * parser.c (cp_parser_direct_declarator): Do not consider a
560         function to be a constructor if the containing class was
561         originally anonymous.
562
563 2005-01-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
564
565         PR c++/17154
566         * search.c (lookup_field_1): Handle using declaration in
567         class template partial specialization.
568
569 2005-01-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
570
571         PR c++/19258
572         * pt.c (push_access_scope): Handle friend defined in class.
573         (pop_access_scope): Likewise.
574
575 2005-01-06  Nathan Sidwell  <nathan@codesourcery.com>
576
577         PR c++/19270
578         * pt.c (tsubst_copy) <ARRAY_REF case>: Handle separately.
579         (tsubst_copy_and_build) <ARRAY_REF case>: Remove obsolete
580         array-new handling code.  Use build_x_binary_op.
581
582 2005-01-05  Nathan Sidwell  <nathan@codesourcery.com>
583
584         PR c++/19030
585         * cp-tree.h (start_decl): Take pointer to pushed scope, not bool.
586         * name-lookup.h (push_scope): Return pushed scope, not flag.
587         * name-lookup.c (push_scope): Return scope that should be popped,
588         not a flag.
589         * decl.c (start_decl): Adjust.
590         (grokfndecl): Adjust scope push and pop.
591         * decl2.c (check_classfn): Likewise.
592         * parser.c (cp_parser_condition, cp_parser_conversion_function_id,
593         cp_parser_init_declarator, cp_parser_direct_declarator,
594         cp_parser_class_specifier, cp_parser_class_head,
595         cp_parser_lookup_name,
596         cp_parser_constructor_declarator_p): Likewise.
597         * pt.c (instantiate_class_template,
598         resolve_typename_type): Likewise.
599
600 2005-01-03  Volker Reichelt  <reichelt@igpm.rwth-aaachen.de>
601
602         PR c++/14136
603         * parser.c (cp_parser_unqualified_id): Do not issue error message
604         for typedef-name as destructor declarator when performing an
605         uncommitted tentative parse.
606
607 2005-01-01  Steven Bosscher  <stevenb@suse.de>
608
609         PR middle-end/17544
610         * decl.c (finish_function): Fix comment.  Annotate the compiler
611         generated return with the current file name and line 0.
612
613 2004-12-31  Richard Henderson  <rth@redhat.com>
614
615         PR middle-end/17799
616         * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P.
617         * class.c (build_vtable): Don't conditionallize setting it
618         based on DWARF2_DEBUG.
619         (layout_class_type): Set DECL_IGNORED_P.
620         * decl2.c (get_guard): Likewise.
621         * rtti.c (get_tinfo_decl, build_lang_decl): Likewise.
622         * tree.c (build_local_temp): Likewise.
623
624 2004-12-30  Mark Mitchell  <mark@codesourcery.com>
625
626         * cp-tree.h (cp_declarator): Split "name" field into
627         qualifying_scope and unqualified_name.
628         * decl.c (get_scope_of_declarator): Adjust accordingly.
629         (grokdeclarator): Likewise.
630         * decl2.c (grokfield): Likewise, and adjust call to
631         do_class_using_decl.
632         * name-lookup.c (do_class_using_decl): Split "decl" into
633         "scope" and "name".  Remove unnecessary code.
634         * name-lookup.h (do_class_using_decl): Adjust declaration.
635         * parser.c (make_id_declarator): Split "id" into qualifying_scope
636         and unqualified_name.
637         (cp_parser_using_declaration): Adjust call to do_class_using_decl.
638         (cp_parser_direct_declarator): Adjust to handle the fact that
639         cp_parser_declarator_id no longer returns a SCOPE_REF.
640         (cp_parser_direct_declarator): Likewise.
641         (cp_parser_declarator_id): Do not create a SCOPE_REF for qualified
642         names.
643         (cp_parser_member_declaration): Adjust call to make_id_declarator.
644         (cp_parser_check_declarator_template_parameters): Do not expect a
645         SCOPE_REF.
646
647         * decl.c (duplicate_decls): Call ggc_free on declarations we will
648         not be needing any longer.
649
650         PR c++/19190
651         * cvt.c (convert_to_void): Do not use STRIP_NOPs.
652
653 2004-12-28  Richard Henderson  <rth@redhat.com>
654
655         PR inline-asm/15740
656         * semantics.c (finish_asm_stmt): Resolve asm names.  Validate input
657         constraints.  Mark memory inputs addressable.
658
659 2004-12-27  Jason Merrill  <jason@redhat.com>
660
661         * decl.c (expand_static_init): Don't use shortcut if
662         targetm.relaxed_ordering.
663
664 2004-12-27  Mark Mitchell  <mark@codesourcery.com>
665
666         PR c++/19149
667         * decl.c (check_tag_decl): Robustify.
668
669 2004-12-23  Mark Mitchell  <mark@codesourcery.com>
670
671         PR c++/17595
672         * parser.c (cp_parser_error): Issue better messages about
673         #pragma in locations where it is not permitted.
674
675         PR c++/17413
676         * pt.c (check_instantiated_args): Remove bogus SFINAE code.
677
678         * cvt.c (convert_to_void): Fix typo in comment.
679
680 2004-12-23  Alexandre Oliva  <aoliva@redhat.com>
681
682         PR c++/18962
683         * pt.c (check_explicit_specialization): Use the argument list from
684         the definition in a template function specialization definition.
685
686 2004-12-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
687
688         PR c++/18733
689         * pt.c (check_explicit_specialization): Use special logic to validate
690         befriended specializations.
691
692 2004-12-22  Mark Mitchell  <mark@codesourcery.com>
693
694         * rtti.c (emit_support_tinfos): Avoid using C99 semantics.
695
696         PR c++/18464
697         * call.c (build_this): In templates, do not bother with
698         build_unary_op.
699         * typeck.c (unary_complex_lvalue): In a template, always refuse
700         simplifications.
701
702         PR c++/18492
703         * cp-gimplify.c (cp_genericize): Relax assertion.
704
705         PR c++/11224
706         * cvt.c (convert_to_void): Warn about unused values.
707
708         PR c++/18257
709         * rtti.c (emit_support_tinfos): On systems without weak symbols,
710         emit the runtime library type-info objects as non-COMDAT.
711
712 2004-12-21  Mark Mitchell  <mark@codesourcery.com>
713
714         PR c++/18378
715         * call.c (convert_like_real): Do not permit the use of a copy
716         constructor to copy a packed field.
717
718         PR c++/19063
719         * decl.c (grokdeclarator): Return error_mark_node, not
720         void_type_node, to indicate errors.
721         * parser.c (cp_parser_template_parameter_list): Robustify.
722         (cp_parser_template_parameter): Likewise.
723
724         PR c++/19034
725         * tree.c (cp_tree_equal): Handle OVERLOAD.
726
727 2004-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
728
729         * decl.c (define_label): Use POP_TIMEVAR_AND_RETURN.
730         * name-lookup.c (pushdecl_class_level): Likewise.
731
732 2004-12-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
733
734         * name-lookup.c (pushtag): Add missing POP_TIMEVAR_AND_RETURN.
735
736 2004-12-21  Andrew Pinski  <pinskia@physics.uc.edu>
737
738         PR c++/18984
739         * cp-gimplify.c (cp_genericize_r): Don't insert first but instead
740         check to see if contains the pointer.  Insert the statement before
741         returning.
742
743 2004-12-21  Nathan Sidwell  <nathan@codesourcery.com>
744
745         PR c++/14075
746         * decl.c (check_initializer): Check string initializer of array is
747         not parenthesized.
748         * cp-tree.h (PAREN_STRING_LITERAL_P): New.
749         * semantics.c (finish_parenthesized_expr): Mark a STRING_CST.
750         * error.c (dump_expr): <STRING_CST case> Add parens, if needed.
751
752         * cp-tree.def (TEMPLATE_TYPE_PARM,
753         BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder
754         for better code efficiency.
755         * cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check.
756         (CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization.
757         (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P,
758         INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P,
759         CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P,
760         TYPE_PTROBV_P): Likewise.
761
762         PR c++/18975
763         * method.c (do_build_copy_constructor): Refactor. Don't const
764         qualify a mutable field.
765         (do_build_assign_ref): Likewise.
766
767 2004-12-20  Matt Austern <austern@apple.com>
768
769         PR c++/19044
770         * decl.c (make_rtl_for_nonlocal_decl): Use
771         set_builtin_user_assembler_name.
772
773 2004-12-19  Mark Mitchell  <mark@codesourcery.com>
774
775         * cp-tree.h (note_decl_for_pch): New function.
776         * class.c (build_clone): Call note_decl_for_pch.
777         * semantics.c (finish_member_declaration): Likewise.
778         (note_decl_for_pch): New function.
779
780 2004-12-17  Steven Bosscher  <stevenb@suse.de>
781
782         * init.c (build_zero_init): max_index is the number of
783         elements, minus 1.
784
785 2004-12-17  Nathan Sidwell  <nathan@codesourcery.com>
786
787         PR c++/18721
788         * class.c (add_method): Do not push conversion operators into a
789         binding level.
790
791         * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE_TYPE): Reformat.
792         * error.c (dump_decl): <TYPE_DECL case> Remove extraneous braces.
793
794 2004-12-16  Nathan Sidwell  <nathan@codesourcery.com>
795
796         PR c++/18905
797         * cp-tree.h (integral_constant_value): Declare.
798         * call.c (null_ptr_cst_p): Use integral_constant_value, not
799         decl_constant_value.
800         (convert_like_real): Likewise.
801         * class.c (check_bitfield_decl): Likewise.
802         * cvt.c (ocp_convert): Likewise.
803         (convert): Remove unnecessary decl_constant_value call.
804         * decl.c (compute_array_index_type): Use integral_constant_value,
805         not decl_constant_value.
806         (build_enumerator): Likewise.
807         * decl2.c (grokfield): Likewise.
808         * init.c (decl_constant_value): Simplify.
809         (integral_constant_value): New.
810         * pt.c (fold_decl_constant_value): Use integral_constant_value,
811         remove subsequent check.
812         (tsubst): Use integral_constant_value, not decl_constant_value.
813         (tsubst_copy, unify): Likewise.
814         * typeck.c (decay_conversion): Likewise.
815         (build_compound_expr): Remove unnecessary decl_constant_value
816         calls.
817         (build_static_cast_1, build_reinterpret_cast_1):
818         (convert_for_assignment): Remove comment about not calling
819         decl_constant_value.
820
821 2004-12-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
822
823         PR c++/18825
824         * pt.c (instantiate_class_template): Set input_location for
825         friend function.
826         (tsubst_friend_function): Don't set input_location here.
827         Make sure the context is complete if necessary.
828
829 2004-12-15  Nathan Sidwell  <nathan@codesourcery.com>
830
831         PR c++/18981
832         * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE
833         flag setting.
834
835 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
836
837         PR c++/18738
838         * decl.c (make_typename_type): Do not handle namespace-scoped
839         names here.
840         (tag_name): Handle typename_type.
841         (check_elaborated_type_specifier): Handle typenames.
842         * parser.c (cp_parser_diagnose_invalid_type_name): Improve
843         comment.
844         (cp_parser_elaborated_type_specifier): Use
845         cp_parser_diagnose_invalid_type_name.
846
847 2004-12-14  Andrew Pinski  <pinskia@physics.uc.edu>
848
849         PR c++/18965
850         * init.c (build_zero_init): If the max_index is 0, there is no
851         need to create a RANGE_EXPR.
852
853 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
854
855         PR c++/18793
856         * cp-objcp-common.c (cp_expr_size): Loosen assertion.
857
858 2004-12-14  Nathan Sidwell  <nathan@codesourcery.com>
859
860         PR c++/18949
861         * pt.c (tsubst_copy_and_build): <INDIRECT_REF case> Check that a
862         REFERENCE_REF_P is dereferencing a reference type.
863         * typeck.c (build_static_cast): Convert from reference even in a
864         template.
865         (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise.
866
867 2004-12-14  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
868
869         * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function.
870         (cp_parser_name_lookup_error): Use it.
871         (cp_parser_check_for_invalid_template_id): Likewise.
872         (cp_parser_skip_to_closing_parenthesis): Likewise.
873         (cp_parser_nested_name_specifier_opt): Likewise.
874         (cp_parser_simple_declaration, cp_parser_template_id): Likewise.
875         (cp_parser_parameter_declaration_list): Likewise.
876         (cp_parser_parameter_declaration): Likewise.
877         (cp_parser_template_name): Let cp_parser_simulate_error perform
878         the checking.
879         (cp_parser_committed_to_tentative_parse): Remove.
880
881 2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>
882
883         PR c++/18968
884         * class.c (build_base_path): Convert the zero constant to the correct
885         type when comparing.
886
887 2004-12-13  Mark Mitchell  <mark@codesourcery.com>
888
889         PR c++/18925
890         * class.c (layout_class_type): Determine the visibility of static
891         data members.
892
893 2004-12-12  Roger Sayle  <roger@eyesopen.com>
894
895         PR middle-end/12454
896         * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the
897         condition is a constant and the unexecuted clause is empty.
898
899 2004-12-10  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
900
901         PR c++/18731
902         * parser.c (cp_parser_class_head): Reject typedef-name in class head.
903
904 2004-12-09  Matt Austern  <austern@apple.com>
905
906         PR c++/18514
907         * name-lookup.c (do_nonmember_using_decl): A real function
908         declaration takes precedence over an anticipated declaration.
909
910 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
911
912         * parser.c (cp_parser_member_declaration): Fix comment typo.
913
914 2004-12-09  Alexandre Oliva  <aoliva@redhat.com>
915
916         PR c++/18757
917         * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID
918         if parsing failed.
919
920 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
921
922         PR c++/18073
923         * typeck.c (build_reinterpret_cast_1): Allow cast from vector type.
924
925 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
926
927         PR c++/16681
928         * init.c (build_zero_init): Build a RANGE_EXPR for an array
929         initializer.
930
931 2004-12-08  Kelley Cook  <kcook@gcc.gnu.org>
932
933         * typeck.c: Remove DOS line endings.
934
935 2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
936
937         PR c++/18100
938         * decl.c (lookup_and_check_tag): Diagnose nested class with
939         the same name as enclosing class.
940
941 2004-12-08  Nathan Sidwell  <nathan@codesourcery.com>
942
943         PR c++/18803
944         * cp-tree.h (REFERENCE_REF_P): New.
945         (CPTI_TYPE_INFO_TYPE): Rename to ...
946         (CPTI_CONST_TYPE_INFO_TYPE): ... here.
947         (CPTI_TYPE_INFO_REF_TYPE): Remove.
948         (type_info_type_node): Rename to ...
949         (const_type_info_type_node): ... here.
950         (type_info_ref_type): Remove.
951         * call.c (build_user_type_conversion): Reformat.
952         (resolve_args): Do not convert_from_reference.
953         (build_object_call): Call convert_from_reference.
954         (prep_operand): Do not convert_from_reference.
955         (build_new_method_call): Likewise.
956         * class.c (build_vfield_ref): Likewise.
957         * cvt.c (convert_to_reference): Likewise.
958         (convert_from_reference): Build INDIRECT_REF here, not with
959         build_indirect_ref.
960         (convert_force): Do not convert_from_reference.
961         (build_expr_type_conversion): Likewise.
962         * decl.c (grok_reference_init): Likewise.
963         * decl2.c (delete_sanity): Likewise.
964         * except.c (initialize_handler_parm): Use POINTER_TYPE_P.
965         * init.c (build_dtor_call): Do not convert_from_reference.
966         * parser.c (cp_parser_template_argument): Unwrap indirected
967         reference. Allow TEMPLATE_PARM_INDEX as an object parm.
968         * pt.c (tsubst_copy_and_build) <case INDIRECT_REF>: Use
969         convert_from_reference, if indicated.
970         <case CALL_EXPR>: Do not convert_from_reference.
971         <case PARM_DECL, VAR_DECL>: Convert_from_reference if needed.
972         (tsubst_initializer_list): Do not convert_from_reference.
973         * rtti.c (init_rtti_processing): Adjust node creation.
974         (throw_bad_typeid): Use const_type_info_type_node.
975         Do not convert_from_reference.
976         (typeid_ok_p): Use const_type_info_type_node.
977         (build_typeid, get_typeid): Always return type_info typed node.
978         (build_dynamic_cast_1): Dont convert_from_reference. Refactor.
979         * semantics.c (finish_stmt_expr_expr): Do not
980         convert_from_reference.
981         (finish_id_expression): Convert_from_reference as appropriate.
982         * typeck.c (decay_conversion): Do not convert_from_reference.
983         (finish_class_member_access_expr): Likewise.
984         (build_indirect_ref): Use POINTER_TYPE_P.
985         (convert_arguments): Do not convert_from_reference.
986         (build_modify_expr): Likewise.
987         (convert_for_initialization): Likewise.
988         * typeck2.c (build_x_arrow): Likewise.
989
990 2004-12-07  Ziemowit Laski  <zlaski@apple.com>
991
992         * cp-tree.h (struct lang_type_class): Rename 'objc_protocols'
993         field to 'objc_info'.
994
995 2004-12-07  Kazu Hirata  <kazu@cs.umass.edu>
996
997         * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.
998
999 2004-12-07  Roger Sayle  <roger@eyesopen.com>
1000
1001         * name-lookup.c (leave_scope): We only need to update
1002         class_binding_level when leaving a class scope.
1003
1004 2004-12-06  Ziemowit Laski  <zlaski@apple.com>
1005
1006         * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field.
1007
1008 2004-12-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1009
1010         PR c++/17011, c++/17971
1011         * pt.c (tsubst_copy) <FIELD_DECL case>: Check and diagnose
1012         invalid field.
1013         (tsubst_copy_and_build) <COMPONENT_REF case>: Check
1014         error_mark_node after member substitution.
1015         * semantics.c (finish_id_expression): Call
1016         finish_non_static_data_member for non-dependent FIELD_DECL.
1017
1018 2004-12-03  Nathan Sidwell  <nathan@codesourcery.com>
1019
1020         PR c++/18782
1021         * decl.c (grokdeclarator): Make sure class in pointer to member is
1022         not a namespace.
1023
1024 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
1025
1026         PR c++/18318
1027         * parser.c (cp_parser_new_type_id): Move array size expression
1028         checks from here ...
1029         * init.c (build_new): ... to here.
1030
1031 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
1032
1033         PR c++/18758
1034         * parser.c (cp_parser_class_head): Return NULL_TREE when
1035         push_template_decl fails.  Update comment.
1036
1037 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1038
1039         PR c++/15664, c++/18276
1040         * pt.c (tsubst_decl) <TEMPLATE_DECL case>: Reorganize.  Correctly
1041         tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM.
1042
1043 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1044
1045         PR c++/18123
1046         * parser.c (cp_parser_type_specifier): Catch template declaration
1047         of enum.
1048
1049 2004-12-01  Matt Austern  <austern@apple.com>
1050
1051         * name-lookup.c (namespace_binding): Omit alias check for global
1052         namespace.
1053
1054 2004-12-01  Nathan Sidwell  <nathan@codesourcery.com>
1055
1056         PR c++/18729
1057         * parser.c (cp_parser_class_name): Check decl's type is not
1058         error_mark_node.
1059
1060         PR c++/17431
1061         * call.c (standard_conversion): Add FLAGS parameter. Do not allow
1062         derived to base conversion when checking constructor
1063         accessibility.
1064         (implicit_conversion): Pass FLAGS to standard_conversion.
1065         (check_constructir_callable): Disallow conversion functions.
1066
1067 2004-11-30  Kazu Hirata  <kazu@cs.umass.edu>
1068
1069         * parser.c: Fix comment typos.
1070
1071 2004-11-27  Mark Mitchell  <mark@codesourcery.com>
1072
1073         PR c++/18368
1074         * parser.c (cp_parser_check_for_definition_in_return_type): Take
1075         the defined type as a parameter, and inform the user about the
1076         possibility of a missing semicolon.
1077         (cp_parser_explicit_instantiation): Adjust call to
1078         cp_parser_check_for_definition_in_return_type.
1079         (cp_parser_init_declarator): Likewise.
1080         (cp_parser_member_declaration): Likewise.
1081
1082         PR c++/18674
1083         * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit
1084         typename from comments.
1085         * cp-tree.h (TYPENAME_IS_ENUM_P): New macro.
1086         (TYPENAME_IS_CLASS_P): Likewise.
1087         (make_typename_type): Change prototype.
1088         * decl.c (struct_typename_info): New type.
1089         (typename_compare): Expect the second argument to be a
1090         typename_info, not a tree.
1091         (build_typename_type): Add tag_type parameter.  Do not create a
1092         new type until necessary.
1093         (make_typename_type): Add tag_type parameter.
1094         * error.c (TYPENAME_TYPE): Print tags other than "typename" if
1095         appropriate.
1096         * friend.c (make_friend_class): Adjust call to make_typename_type.
1097         * parser.c (cp_parser_make_typename_type): Likewise.
1098         (cp_parser_primary_expression): Adjust call to
1099         cp_parser_lookup_name.
1100         (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name.
1101         (cp_parser_class_or_namespace_name): Likewise.
1102         (cp_parser_postfix_expression): Adjust calls to
1103         make_typename_type.
1104         (cp_parser_mem_initializer_id): Adjust calls to
1105         cp_parser_class_name.
1106         (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name.
1107         (cp_parser_template_name): Likewise.
1108         (cp_parser_template_argument): Likewise.
1109         (cp_parser_type_name): Adjust call to cp_parser_class_name.
1110         (cp_parser_elaborated_type_specifier): Adjust calls to
1111         make_typename_type and cp_parser_lookup_name.
1112         (cp_parser_namespace_name): Likewise.
1113         (cp_parser_class_name): Replace type_p parameter with tag_type.
1114         Adjust calls to make_typename_type and cp_parser_lookup_name.
1115         (cp_parser_class_head): Adjust calls to cp_parser_class_name.
1116         (cp_parser_base_specifier): Likewise.
1117         (cp_parser_lookup_name): Replace is_type parameter with tag_type.
1118         Adjust calls to make_typename_type and lookup_qualified_name.
1119         (cp_parser_lookup_name_simple): Adjust call to
1120         cp_parser_lookup_name.
1121         (cp_parser_constructor_declarator_p): Adjust call to
1122         cp_parser_class_name.
1123         * pt.c (convert_template_argument): Adjust all to
1124         make_typename_type.
1125         (tsubst_decl): Do not pre-substitute the type of the declaration.
1126         (tsubst): Hand off declarations more quickly.  Adjust call to
1127         make_typename_type.
1128
1129         PR c++/18512
1130         * parser.c (cp_parser_postfix_dot_deref_expression): Robustify.
1131
1132 2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>
1133
1134         PR c/7544
1135         * Make-lang.in (cp/decl2.o): Update dependencies.
1136         * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.
1137
1138 2004-11-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1139
1140         PR c++/18652
1141         * name-lookup.c (pushtag): Change return type to tree.
1142         * cp-tree.h (pushtag): Adjust declaration.
1143         * decl.c (xref_tag, start_enum): Use return value of pushtag.
1144         * pt.c (push_template_decl_real): Return immediately if
1145         pushdecl_namespace_level returns error_mark_node.
1146
1147 2004-11-27  Kazu Hirata  <kazu@cs.umass.edu>
1148
1149         * pt.c: Fix a comment typo.
1150
1151 2004-11-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1152
1153         Friend class name lookup 4/n
1154         * class.c (pushclass): Don't call cxx_remember_type_decls.
1155         * cp-tree.h (clear_anon_tags): Remove declaration.
1156         * decl.c (grokdeclarator): Don't call lookup_tag_reverse.
1157         * name-lookup.c (binding_entry_free, binding_table_free): Comment
1158         out functions.
1159         (binding_table_find_anon_type, binding_table_reverse_maybe_remap,
1160         binding_table_remove_anonymous_types, cxx_remember_type_decls,
1161         bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag,
1162         lookup_tag_reverse): Remove
1163         (begin_scope, leave_scope, kept_level_p, print_binding_level):
1164         Don't use type_decls field in cp_binding_level.
1165         (maybe_process_template_type_declaration, pushtag): Set
1166         CLASSTYPE_NESTED_UTDS directly.
1167         * name-lookup.h (binding_table_remove_anonymous_types,
1168         cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove
1169         declaration.
1170         (cp_binding_level): Remove type_decls field.
1171
1172 2004-11-26  Kazu Hirata  <kazu@cs.umass.edu>
1173
1174         * typeck.c: Fix a comment typo.
1175
1176 2004-11-25  Mark Mitchell  <mark@codesourcery.com>
1177
1178         PR c++/18445
1179         * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
1180         unknown_type as non matching.  Tidy up.
1181         * pt.c (build_non_dependent_expr): Do not build a
1182         NON_DEPENDENT_EXPR for a VAR_DECL.
1183
1184         PR c++/18001
1185         * cp-tree.h (lvalue_or_else): Remove declaration.
1186         * tree.c (lvalue_or_else): Remove.
1187         * typeck.c (build_unary_op): Adjust call to lvalue_or_else.
1188         (build_modify_expr): Likewise.
1189
1190         PR c++/18625
1191         * decl.c (duplicate_decls): Return error_mark_node on error, as
1192         specified.
1193
1194         PR c++/18466
1195         * decl.c (grokvardecl): Keep track of whether or not a there was
1196         explicit qualification.
1197         * name-lookup.c (set_decl_namespace): Complain about explicit
1198         qualification of a name within its own namespace.
1199
1200         PR c++/18545
1201         * typeck.c (check_return_expr): Robustify.
1202
1203 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1204
1205         Friend class name lookup 3/n, PR c++/3332
1206         * name-lookup.c (push_inner_scope, pop_inner_scope): New functions.
1207         (lookup_type_scope): Don't deal with name from user declaration
1208         specially.
1209         * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations.
1210         * parser.c (cp_parser_class_specifier): Use push_inner_scope and
1211         pop_inner_scope.
1212
1213 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1214
1215         Friend class name lookup 2/n, PR c++/14513, c++/15410
1216         * name-lookup.c (lookup_name_real): Simplify.
1217         (lookup_type_scope): Add SCOPE parameter.  Handle friend class
1218         lookup.
1219         * name-lookup.h (tag_scope): New enum type.
1220         (lookup_type_scope): Adjust declaration.
1221         * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
1222         Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
1223         (start_enum): Likewise.  Add assertion test that NAME is
1224         IDENTIFIER_NODE.  Use anonymous name for dummy ENUMERAL_TYPE in
1225         case of error.
1226         * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
1227         * parser.c (cp_parser_elaborated_type_specifier,
1228         cp_parser_class_head): Adjust call to xref_tag.
1229         * pt.c (lookup_template_class, instantiate_class_template):
1230         Likewise.
1231         * rtti.c (init_rtti_processing, build_dynamic_cast_1,
1232         tinfo_base_init, emit_support_tinfos): Likewise.
1233
1234 2004-11-25  Joseph S. Myers  <joseph@codesourcery.com>
1235
1236         * g++spec.c, lex.c: Avoid ` as left quote in diagnostics.
1237
1238 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
1239
1240         PR c++/17473
1241         * name-lookup.c (supplement_binding): Do not allow typedefs to be
1242         redefined in class scope.
1243
1244         PR c++/18285
1245         * parser.c (cp_parser_set_decl_type_spec): Do not try to allow
1246         redefinitions of builtin types other that "bool" or "wchar_t".
1247
1248 2004-11-24  Steven Bosscher  <stevenb@suse.de>
1249
1250         * decl.c (cxx_init_decl_processing): Don't clear
1251         flag_inline_functions.
1252
1253 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
1254
1255         * pt.c (tsubst_function_type): Do not permit function types which
1256         return arrays or functions.
1257
1258         PR c++/18586
1259         * parser.c (cp_parser_init_declarator): Do not pop scope twice.
1260
1261         PR c++/18530
1262         * cp-tree.h (CTOR_NAME): Remove.
1263         (DTOR_NAME): Remove.
1264         * decl.c (initialize_predefined_identifiers): Add spaces to the
1265         end of constructor and destructor names.
1266
1267 2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1268
1269         PR c++/8929
1270         * decl.c (start_decl): Check for invalid specialization headers.
1271
1272 2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
1273
1274         PR c++/16882
1275
1276         * call.c (standard_conversion): Move check for conversions between
1277         vector pointers...
1278         * typeck.c (ptr_reasonably_similar): ... here.
1279
1280 2004-11-23  Ben Elliston  <bje@au.ibm.com>
1281
1282         * cp-tree.h (context_as_string): Remove extern.
1283         * error.c (context_as_string): Remove.
1284
1285         * cp-tree.h (cp_type_qual_from_rid): Remove extern.
1286         * lex.c (cp_type_qual_from_rid): Remove.
1287
1288         * cp-tree.h (do_poplevel): Remove extern.
1289         (check_multiple_declarators): Likewise.
1290         * semantics.c (do_poplevel): Make static.
1291         (check_multiple_declarators): Remove.
1292
1293         * cp-tree.h (check_final_overrider): Remove extern.
1294         * search.c (check_final_overrider): Make static.
1295
1296         * cp-tree.h (build_artificial_parm): Remove extern.
1297         * decl2.c (build_artificial_parm): Make static.
1298
1299 2004-11-22  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1300
1301         PR c++/18354
1302         * typeck.c (build_unary_op) <CONVERT_EXPR, NEGATE_EXPR>: Unify code.
1303         Make sure the result is always a rvalue.
1304
1305 2004-11-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1306
1307         * decl.c (start_preparsed_function): Call check_function_type even
1308         in templates.
1309         (require_complete_types_for_parms): Skip dependent types.
1310         (check_function_type): Likewise.
1311
1312 2004-11-16  Steven Bosscher  <stevenb@suse.de>
1313
1314         * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h.
1315         * search.c: Don't include it.
1316
1317 2004-11-15  Andrew Pinski  <pinskia@physics.uc.edu>
1318
1319         * cp-gimplify.c: Include pointer-set.h
1320         (cp_genericize_r): Use pointer_sets instead of a hashtable.
1321         Also instert the new statement for CLEANUP_STMT.
1322         (cp_genericize): Use pointer_sets instead of a hashtable.
1323         * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h.
1324
1325 2004-11-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1326
1327         Friend class name lookup 1/n, PR c++/18471
1328         * decl.c (lookup_and_check_tag): New function.
1329         (xref_tag, start_enum): Use it.
1330         (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check
1331         before !DECL_IMPLICIT_TYPEDEF_P.  Also display previously declared
1332         location.
1333         * name-lookup.c (lookup_name_current_level): Rename to ...
1334         (lookup_name_innermost_nonclass_level): ... this.
1335         (lookup_type_scope): New function.
1336         * name-lookup.h (lookup_name_current_level): Rename to ...
1337         (lookup_name_innermost_nonclass_level): ... this.
1338         (lookup_type_scope): Add declaration.
1339
1340 2004-11-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1341
1342         PR c++/17344
1343         * pt.c (coerce_template_parms): Only emit error message about
1344         invalid template argument when TF_ERROR.
1345
1346 2004-11-12  Mark Mitchell  <mark@codesourcery.com>
1347
1348         PR c++/18389
1349         * decl.c (start_decl): Make sure to set *pop_scope_p.  Return
1350         error_mark_node to indicate errors.
1351
1352         PR c++/18429
1353         * parser.c (cp_parser_direct_declarator): Disallow non-constant
1354         array bounds when not inside a function.
1355
1356         PR c++/18436
1357         * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
1358         unqualified name resolves to a member function.
1359
1360         PR c++/18407
1361         * pt.c (tsubst_copy_and_build): Handle qualified names used from a
1362         derived class correctly.
1363
1364         * decl2.c (import_export_decl): Fix typo in comment.
1365         * tree.c (pod_type_p): Likewise.
1366
1367 2004-11-10  Andrew Pinski  <pinskia@physics.uc.edu>
1368
1369         * typeck.c (cxx_mark_addressable): Add braces around the first if.
1370
1371 2004-11-10  Adam Nemet  <anemet@lnxw.com>
1372
1373         PR middle-end/18160
1374         * typeck.c (cxx_mark_addressable): Issue an error if address of an
1375         explicit register variable is requested.
1376
1377 2004-11-10  Nathan Sidwell  <nathan@codesourcery.com>
1378
1379         PR c++/18143
1380         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New.
1381         (struct lang_decl_flags): Add thunk_p flag.
1382         (struct lang_decl): Remove separate fixed_offset. Place
1383         cloned_function and fixed_offset into union.
1384         (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust.
1385         (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust.
1386         (THUNK_FIXED_OFFSET): Adjust.
1387         * method.c (make_thunk): Adjust.
1388
1389 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
1390
1391         PR c++/18369
1392         * init.c (build_new_1): Handle parenthesized type-ids that name an
1393         array type.  Tidy.
1394
1395 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
1396
1397         * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
1398         pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
1399         quoting in diagnostics.
1400         * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
1401         quoting in printf format.
1402         * decl.c (duplicate_decls, start_decl): Use %qD instead of
1403         unquoted %D.
1404
1405 2004-11-08  Kazu Hirata  <kazu@cs.umass.edu>
1406
1407         * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c,
1408         search.c, typeck2.c: Fix comment formatting.
1409
1410 2004-11-04  Ulrich Weigand  <uweigand@de.ibm.com>
1411
1412         PR tree-optimization/18184
1413         * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
1414         of different modes or alias-all flags as equivalent.
1415         * typeck.c (comptypes): Likewise.
1416
1417 2004-11-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1418
1419         DR 49, 100
1420         * cp-tree.h (TYPE_REF_OBJ_P): New macro.
1421         (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P,
1422         TYPE_REFFN_P): Document.
1423         (fold_decl_constant_value): New prototype.
1424         * pt.c (convert_nontype_argument_function): Rewrite and extract
1425         parts into...
1426         (fold_decl_constant_value, convert_nontype_argument_function): New.
1427         (lookup_template_class): Add comment about useless double call.
1428         * mangle.c (write_expression): Strip conversions before lowering
1429         pointer to members.
1430         * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow
1431         enum to enum conversion.
1432
1433 2004-11-02  Mark Mitchell  <mark@codesourcery.com>
1434
1435         PR c++/18124
1436         * parser.c (cp_parser_type_parameter): Robustify.
1437
1438         PR c++/18155
1439         * parser.c (cp_parser_single_declaration): Disallow template
1440         typedefs.
1441
1442         PR c++/18177
1443         * typeck.c (build_const_cast): Use error_operand_p.
1444
1445 2004-11-02  Ziemowit Laski  <zlaski@apple.com>
1446
1447         * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
1448         (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
1449         * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
1450         from cp-lang.c.
1451         * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
1452         from cp-lang.c.
1453         (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
1454
1455 2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
1456
1457         PR c++/18064
1458         * search.c (check_final_overrider): Deprecate gnu covariant extension.
1459
1460 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1461
1462         Convert diagnostics to use quoting flag q 9/n
1463         * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
1464         get_delta_difference):  Use new quotation style.
1465         * repo.c (reopen_repo_file_for_write): Likewise.
1466         * pt.c (do_type_instantiation): Likewise.
1467         * parser.c (cp_parser_diagnose_invalid_type_name):
1468         * name-lookup.c (push_overloaded_decl, set_decl_namespace):
1469         * error.c (cp_print_error_function,
1470         print_instantiation_full_context): Likewise.
1471         * decl.c (define_label, grok_reference_init,
1472         maybe_deduce_size_from_array_init, revert_static_member_fn):
1473         * decl2.c (check_classfn): Likewise.
1474         * class.c (add_method, check_field_decls, layout_class_type,
1475         resolve_address_of_overloaded_function): Likewise.
1476         * call.c (build_x_va_arg, build_over_call): Likewise.
1477
1478 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1479
1480         Convert diagnostics to use quoting flag q 8/n
1481         * cvt.c (cp_convert_to_pointer, warn_ref_binding,
1482         convert_to_reference, ocp_convert, convert_to_void
1483         cp_convert_to_pointer): Use new quotation style.
1484
1485 2004-10-31  Mark Mitchell  <mark@codesourcery.com>
1486
1487         PR c++/15172
1488         * typeck2.c (store_init_value): Use split_nonconstant_init even
1489         for types that require construction.
1490
1491 1004-10-28  Matt Austern  <austern@apple.com>
1492
1493         PR c++/17542
1494         * cp-tree.h (class_key_or_enum_as_string): Declare.
1495         * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string
1496         and remove static qualifier.
1497         * decl.c (shadow_tag): Warn about ignored attributes in class/struct/
1498         union/enum declaration.
1499
1500 2004-10-29  Kazu Hirata  <kazu@cs.umass.edu>
1501
1502         * pt.c: Fix a comment typo.
1503
1504 2004-10-28  Nathan Sidwell  <nathan@codesourcery.com>
1505
1506         * typeck.c (composite_pointer_type): Remove comment about DR 195.
1507         (build_reinterpret_cast_1): Revert DR195 patch. Only emit a
1508         warning when being pedantic.
1509         (build_reinterpet_cast, build_c_cast): Adjust.
1510
1511 2004-10-29  Mark Mitchell  <mark@codesourcery.com>
1512
1513         PR c++/17695
1514         * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they
1515         appear in a constructor/destructor that will be cloned.
1516
1517 1004-10-28  Matt Austern  <austern@apple.com>
1518
1519         PR c++/14124
1520         * decl.c (finish_enum): Handle packed attribute.
1521         * parser.c (cp_parser_enum_specifier): Process trailing attributes.
1522
1523 2004-10-28  Mark Mitchell  <mark@codesourcery.com>
1524
1525         PR c++/17132
1526         * pt.c (instantiate_class_template): Increment
1527         processing_template_decl when substituting into a member class
1528         template.
1529
1530 2004-10-27  Mark Mitchell  <mark@codesourcery.com>
1531
1532         PR c++/17435
1533         * call.c (convert_like_real): Fix formatting.
1534         (initialize_reference): When binding a temporary to a base class,
1535         ensure that the nominal copy made is to the derived class, not the
1536         base class.
1537
1538         PR c++/18140
1539         * parser.c (cp_parser_next_token_ends_template_argument_p): Do not
1540         include ">>".
1541
1542 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
1543
1544         * decl.c (bad_specifiers): Move the q after the %.
1545
1546 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
1547
1548         * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after
1549         the %.
1550
1551 2004-10-26  Mark Mitchell  <mark@codesourcery.com>
1552
1553         * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT.
1554         * search.c (current_scope): Fix prototype.
1555
1556         PR c++/18093
1557         * search.c (current_scope): Return the innermost non-block scope,
1558         not the innermost non-block, non-namespace scope.
1559         (at_namespace_scope_p): Adjust accordingly.
1560         (dfs_accessible_post): Do not pass namespaces to is_friend.
1561         (dfs_walk_once_accessible_r): Likewise.
1562         * decl.c (grokvardecl): Adjust call to current_scope.
1563         (build_enumerator): Likewise.
1564         * parser.c (cp_parser_using_declaration): Likewise.
1565         (cp_parser_direct_declarator): Use at_namespace_scope_p instead of
1566         current_scope.
1567         (cp_parser_class_head): Adjust call to current_scope.
1568         * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the
1569         alias.
1570
1571         PR c++/18020
1572         * pt.c (tusbst_copy_and_build): Resolve enumeration constants to
1573         their underlying values.
1574
1575         PR c++/18161
1576         * typeck.c (build_binary_op): Honor build_type, even when in a
1577         template.
1578
1579 2004-10-26  Nathan Sidwell  <nathan@codesourcery.com>
1580
1581         * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
1582         padding token checking.
1583
1584 2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>
1585
1586         PR c++/18121
1587         * decl.c (grokdeclarator) <case cdk_array>: Remove the call
1588         layout_type as it is already done by create_array_type_for_decl.
1589
1590 2004-10-22  Nathan Sidwell  <nathan@codesourcery.com>
1591
1592         PR c++/18095
1593         * parser.c (eof_token): Make const, correctly initialize rid and
1594         location fields.
1595         (struct cp_lexer): Replace buffer_end pointer with buffer_length
1596         count. Adjust.
1597         (cp_lexer_new_main): Directly grow lexer's buffer here.  Don't
1598         zero it out.
1599         (cp_lexer_new_from_tokens): Adjust.
1600         (cp_lexer_grow_buffer): Remove.
1601         (cp_lexer_peek_nth_token, cp_lexer_consume_token,
1602         cp_lexer_purge_token): Add const casts.
1603
1604 2004-10-21  Mark Mitchell  <mark@codesourcery.com>
1605
1606         PR c++/18073
1607         PR c++/10841
1608         * cp-tree.h (convert_to_base): Change prototype.
1609         (build_ptrmemfunc): Likewise.
1610         (convert_ptrmem): New function.
1611         * call.c (struct conversion): Adjust documentation for base_p.
1612         (standard_conversion): Set base_p for ck_pmem conversions as
1613         appropriate.
1614         (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
1615         conversions.
1616         * class.c (convert_to_base): Handle both pointers and objects.
1617         Add nonnull parameter.
1618         (build_vfield_ref): Adjust call to convert_to_base.
1619         * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
1620         (convert_force): Likewise.
1621         * typeck.c (build_unary_op): Likewise.
1622         (convert_ptrmem): New function.
1623         (build_static_cast_1): Use it.
1624         (build_reinterpret_cast): Allow conversions to vector types.
1625         (get_delta_difference): Add c_cast_p parameter.
1626         (build_ptrmemfunc): Likewise.  Adjust calls to
1627         get_delta_difference.
1628
1629 2004-10-21  Andrew Pinski  <pinskia@physics.uc.edu>
1630
1631         PR c++/13560
1632         * error.c (cp_error_at): Output the context as it might be
1633         different file as the other location.
1634
1635 2004-10-21  Kazu Hirata  <kazu@cs.umass.edu>
1636
1637         * typeck.c: Fix a comment typo.
1638
1639 2004-10-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1640
1641         PR c++/13495
1642         * decl.c (make_unbound_class_template): Add PARM_LIST parameter.
1643         * cp-tree.h (make_unbound_class_template): Adjust prototype.
1644         * parser.c (cp_parser_lookup_name): Adjust call to
1645         make_unbound_class_template.
1646         (cp_parser_single_declaration): Handle member class of class
1647         template as template friend parsing correctly.
1648         * friend.c (is_friend): Call is_specialization_of_friend for
1649         template friend class.
1650         (make_friend_class): Handle member class of class template as
1651         template friend.
1652         * pt.c (is_specialization_of_friend): Likewise.
1653         (instantiate_class_template): Likewise.
1654         (tsubst): Adjust call to make_unbound_class_template.
1655
1656 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
1657
1658         * typeck.c (composite_pointer_type): Add comment about DR 195
1659         (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
1660         Allow function pointer conversions that DR195 suggests.
1661         (build_reinterpret_cast, build_c_cast): Update
1662         build_reinterpret_cast_1 calls.
1663
1664 2004-10-20  Kazu Hirata  <kazu@cs.umass.edu>
1665
1666         * call.c, typeck.c: Fix comment typos.
1667
1668 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
1669
1670         * parser.c (cp_token_position): New typedef. Define VEC thereof.
1671         (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make
1672         next_token and last_token cp_token_position. Make saved_tokens a
1673         VEC(cp_token_position).
1674         (eof_token): New static variable.
1675         (CP_SAVED_TOKENS_SIZE): Rename to ...
1676         (CP_SAVED_TOKEN_STACK): ... here.
1677         (cp_lexer_new_main): Adjust main lexer creation and buffer
1678         filling.
1679         (cp_lexer_new_from_tokens): Do not copy the tokens, merely point
1680         to the parent buffer.  Do not append eof token.
1681         (cp_lexer_destroy): Only free buffer if non-NULL. Free token
1682         stack.
1683         (cp_lexer_next_token, cp_lexer_prev_token): Remove.
1684         (cp_lexer_token_position, cp_lexer_token_at): New.
1685         (cp_lexer_saving_tokens): Adjust. Make inline.
1686         (cp_lexer_advance_token, cp_lexer_token_difference): Remove.
1687         (cp_lexer_peek_token_emit_debug_info): Fold into ...
1688         (cp_lexer_peek_token): ... here.
1689         (cp_lexer_peek_nth_token): Don't peek past EOF.
1690         (cp_lexer_consume_token): Set next_token to eof_token, if reaching
1691         EOF.
1692         (cp_lexer_purge_token): Adjust eof setting.
1693         (cp_lexer_purge_tokens_after): Likewise.
1694         (cp_lexer_save_tokens): Push next_token directly.
1695         (cp_lexer_commit_tokens): Adjust.
1696         (cp_lexer_rollback_tokens): Pop next_token directly.
1697         (cp_parser_check_for_invalid_template_id): Adjust token purging.
1698         (cp_parser_translation_unit): Do not consume the EOF.
1699         (cp_parser_nested_name_specifier_opt): Adjust token purging.
1700         (cp_parser_template_id, cp_parser_template_name): Likewise.
1701
1702 2004-10-19  Mark Mitchell  <mark@codesourcery.com>
1703
1704         PR c++/14035
1705         * call.c (struct conversion): Add base_p.
1706         (convert_like): Add c_cast_p argument.
1707         (convert_like_with_conversion): Likewise.
1708         (build_conv): Clear base_p.
1709         (standard_conversion): Set it, for derived-to-base conversions.
1710         (convert_like_real): Add c_cast_p parameter.  Handle pointer
1711         conversions directly rather than relying on ocp_convert.
1712         (perform_direct_initialization_if_possible): Add c_cast_p
1713         parameter.
1714         * cp-tree.h (perform_direct_initialization_if_possible): Change
1715         prototype.
1716         (convert_member_func_to_ptr): New function.
1717         * typeck.c (check_for_casting_away_constness): Add diag_fn
1718         parameter.
1719         (build_static_cast_1): New function, split out from ...
1720         (build_static_cast): ... here.  Use build_static_cast_1.
1721         (build_reinterpret_cast_1): New function, split out from ...
1722         (build_reinterpret_cast): ... here.  Use build_reinterpret_cast_1.
1723         (build_const_cast_1): New function, split out from ...
1724         (build_const_cast): ... here.  Use build_const_cast_1.
1725         (build_c_cast): Rewrite to use build_const_cast_1,
1726         build_static_cast_1, and build_reinterpret_cast_1.
1727         (convert_member_func_to_ptr): New function.
1728
1729 2004-10-19  Paolo Bonzini  <bonzini@gnu.org>
1730
1731         PR c++/18047
1732         * parser.c (enum cp_parser_prec): Give relational expressions
1733         a higher precedence than equality expressions.
1734
1735 2004-10-15  Nathan Sidwell  <nathan@codesourcery.com>
1736
1737         * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
1738         (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
1739         (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
1740         (enum base_access): Reorganize.
1741         (accessible_base_p, accessible_p): Add consider_local_p parameter.
1742         * call.c (standard_conversion): Update comment about
1743         DERIVED_FROM_P.
1744         (enforce_access): Adjust accessible_p call.
1745         (build_over_call): Adjust accessible_base_p call.
1746         * class.c (convert_to_base): Adjust lookup_base call.
1747         (build_vtbl_ref_1): Likewise.
1748         (warn_about_ambiguous_bases): Likewise. Add early exit.
1749         * cvt.c (convert_to_pointer_force) Adjust lookup_base call.
1750         * search.c (accessible_base_p): Add consider_local_p parameter.
1751         (lookup_base): Pass consider_local_p to accessible_base_p call.
1752         (friend_accessible_p): Check whether scope is a class member.
1753         Remove unnecessary class template check.
1754         (accessible_p): Add consider_local_p parameter. Use it.
1755         (adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
1756         * tree.c (maybe_dummy_object): Likewise.
1757         * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
1758         (build_class_member_access_expr): Adjust lookup_base call.
1759         * typeck2.c (binfo_or_else): Likewise.
1760         * rtti.c (build_dynamic_cast_1): Access can consider friendship
1761         and current scope.
1762
1763 2004-10-17  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1764
1765         PR c++/17743
1766         * decl2.c (grokfield): Apply attributes also to TYPE_DECLs.
1767
1768 2004-10-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1769
1770         PR c++/10479
1771         * parser.c (cp_parser_parenthesized_expression_list): Fold
1772         non-dependent expressions in attribute lists.
1773
1774 2004-10-15  Mark Mitchell  <mark@codesourcery.com>
1775
1776         PR c++/17042
1777         * decl.c (declare_global_var): Use the return value from pushdecl.
1778
1779         PR c++/14667
1780         * parser.c (cp_parser_simple_declaration): Do not diagnose invalid
1781         type names if we have already found a valid type.
1782         (cp_parser_member_declaration): Likewise.
1783
1784         PR c++/17916
1785         * parser.c (cp_parser_member_specification_opt): Handle
1786         CPP_PRAGMA.
1787
1788 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
1789
1790         * dump.c, g++spec.c, repo.c: Update copyright.
1791
1792 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
1793
1794         * decl.c: Fix a comment typo.
1795
1796 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
1797
1798         PR c++/16301
1799         * name-lookup.c (parse_using_directive): If we have a
1800         error_mark_node, do not set the decl namespace associations
1801         on it.
1802
1803 2004-10-14  Mark Mitchell  <mark@codesourcery.com>
1804
1805         PR c++/17976
1806         * decl.c (cp_finish_decl): Do not call expand_static_init more
1807         than once for a single variable.
1808
1809 2004-10-14  Matt Austern  <austern@apple.com>
1810
1811         * Make-lang.in (pt.o): depends on pointer-set.h
1812         * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
1813         * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
1814         (for_each_template_parm): Convert from htab_t to pointer_set_t.
1815         * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
1816
1817 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
1818
1819         PR c++/17661
1820         * semantics.c (finish_for_expr): Convert expression to void
1821         so that we don't create temporaries for a?b:c.
1822
1823 2004-10-13  Kazu Hirata  <kazu@cs.umass.edu>
1824
1825         * search.c: Fix a comment typo.
1826
1827 2004-10-12  Nathan Sidwell  <nathan@codesourcery.com>
1828
1829         * class.c (dfs_modify_vtables): Simplify condition. Return
1830         dfs_skip_bases as appropriate.
1831         (modify_all_vtables): Walk in pre-order.
1832         * search.c (dfs_walk_all, dfs_walk_once_r,
1833         dfs_walk_once_accessible_r): Assert post order function never
1834         returns dfs_skip_bases.
1835
1836         * search.c (struct lookup_base_data_s): New.
1837         (lookup_base_r): Replace with ...
1838         (dfs_lookup_base): ... this.
1839         (lookup_base): Use dfs_walk_all.
1840
1841 2004-10-12  Kazu Hirata  <kazu@cs.umass.edu>
1842
1843         * search.c: Fix comment typos.
1844
1845 2004-10-11  Mark Mitchell  <mark@codesourcery.com>
1846
1847         PR c++/15786
1848         * parser.c (cp_parser_declarator): Add member_p parameter.
1849         (cp_parser_condition): Adjust calls to cp_parser_declarator.
1850         (cp_parser_explicit_instantiation): Likewise.
1851         (cp_parser_init_declarator): Likewise.
1852         (cp_parser_direct_declarator): Add member_p parameter.  Do not
1853         parse tentatively when parsing the parameters to a member.
1854         (cp_parser_type_id): Adjust calls to cp_parser_declarator.
1855         (cp_parser_parameter_declaration): Likewise.
1856         (cp_parser_member_declaration): Likewise.
1857         (cp_parser_exception_declaration): Likewise.
1858
1859         PR c++/17936
1860         * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment.
1861         * pt.c (optimize_specialization_lookup_p): Do not optimize lookups
1862         for members of partial or explicit specializations.
1863
1864         PR c++/17929
1865         * decl2.c (finish_anon_union): Robustify.
1866
1867 2004-10-11  Nathan Sidwell  <nathan@codesourcery.com>
1868
1869         * cp-tree.h (get_dynamic_cast_base_type): Rename to ...
1870         (dcast_base_hint): ... here.
1871         * rtti.c (build_dynamic_cast_1): Use dcast_base_hint.
1872         * search.c (struct dcast_data_s): New.
1873         (dynamic_cast_base_recurse): Remove. Replace with ...
1874         (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New.
1875         (get_dynamic_cast_base_type): Rename to ...
1876         (dcast_base_hint): ... here.  Use dfs_walk_once_accessible.
1877         (accessible_r): Remove.
1878         (dfs_accessible_post): New, broken out of accessible_r.
1879         (accessible_p): Use dfs_walk_once_accessible.
1880         (dfs_walk_once_accessible_r): New. From accessible_r.
1881         (dfs_walk_once_accessible): New. From acessible_p.
1882
1883         * cp-tree.h (SAME_BINFO_TYPE_P): New.
1884         * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare
1885         binfo types.
1886         (convert_to_base_statically, determine_primary_bases,
1887         update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits,
1888         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
1889         accumulate_vtbl_inits, dfs_accumulate_vtbl_inits,
1890         build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise.
1891         * init.c (expand_member_init): Likewise.
1892         * search.c (lookup_base_r, dynamic_cast_base_recurse,
1893         binfo_via_virtual, copied_binfo, binfo_for_vbase,
1894         original_binfo): Likewise.
1895         * tree.c (copy_binfo): Likewise.
1896
1897 2004-10-11  Kazu Hirata  <kazu@cs.umass.edu>
1898
1899         * semantics.c: Fix comment typos.
1900
1901 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
1902
1903         PR c++/17554
1904         part of c++/17657
1905         middle-end/17703
1906         * semantics.c (maybe_cleanup_point_expr): Call
1907         fold_build_cleanup_point_expr.
1908         (maybe_cleanup_point_expr_void): New function.
1909         (add_decl_expr): Call maybe_cleanup_point_expr_void.
1910         (finish_expr_stmt): Likewise.
1911         (finish_return_stmt): Likewise.
1912         (finish_for_expr): Likewise.
1913         (finish_asm_stmt): Likewise.
1914         * typeck.c (condition_conversion): Call
1915         fold_build_cleanup_point_expr.
1916
1917 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
1918
1919         PR c++/17907
1920         * semantics.c (add_decl_expr): If the decl has a size which
1921         has side effects then the decl expression needs a cleanup point.
1922
1923 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
1924
1925         PR c++/17393
1926         * decl.c (grokdeclarator): Robustify error-recovery on invalid
1927         declarations.
1928
1929 2004-10-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1930
1931         Convert diagnostics to use quoting flag q 7/n
1932         * typeck.c (composite_pointer_type_r, composite_pointer_type,
1933         cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr,
1934         string_conv_p, build_class_member_access_expr,
1935         build_class_member_access_expr, lookup_destructor,
1936         finish_class_member_access_expr, build_indirect_ref,
1937         get_member_function_from_ptrfunc, build_function_call,
1938         convert_arguments, build_binary_op, pointer_diff, build_unary_op,
1939         check_for_casting_away_constness, build_static_cast,
1940         build_reinterpret_cast, build_const_cast, build_c_cast,
1941         build_modify_expr, get_delta_difference, build_ptrmemfunc,
1942         dubious_conversion_warnings, convert_for_assignment,
1943         convert_for_initialization,
1944         maybe_warn_about_returning_address_of_local, check_return_expr):
1945         Use quoting marks.
1946
1947         * typeck2.c (error_not_base_type, readonly_error,
1948         abstract_virtuals_error, cxx_incomplete_type_diagnostic,
1949         store_init_value, digest_init, build_x_arrow,
1950         build_m_component_ref, require_complete_eh_spec_types): Likewise.
1951
1952         * tree.c (cp_build_qualified_type_real,
1953         handle_java_interface_attribute, handle_init_priority_attribute):
1954         Likewise.
1955
1956         * semantics.c (finish_asm_stmt, finish_non_static_data_member,
1957         finish_pseudo_destructor_expr,
1958         check_template_template_default_arg, begin_class_definition,
1959         finish_base_specifier, qualified_name_lookup_error,
1960         finish_id_expression, finish_typeof): Likewise.
1961
1962         * search.c (lookup_base, check_final_overrider,
1963         look_for_overrides_r): Likewise.
1964
1965         * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise.
1966
1967 2004-10-09  Mark Mitchell  <mark@codesourcery.com>
1968
1969         PR c++/17867
1970         * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
1971         constructor.
1972
1973         PR c++/17670
1974         * init.c (build_new): Correct comments.
1975         * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
1976         the non-array case.
1977
1978         PR c++/17821
1979         * parser.c (cp_parser_postfix_dot_deref_expression): If the
1980         pseduo-destructor-name production does not work, fall back to the
1981         ordinary production.
1982
1983         PR c++/17826
1984         * tree.c (cp_tree_equal): Handle a BASELINK.
1985
1986         PR c++/17524
1987         * cp-tree.h (check_var_type): New function.
1988         * decl.c (check_var_type): New function, split out from ...
1989         (grokdeclarator): ... here.
1990         * pt.c (tsubst_decl): Use check_var_type.
1991
1992         PR c++/17685
1993         * decl.c (grokdeclarator): Disallow declarations of operators as
1994         non-functions.
1995
1996 2004-10-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1997
1998         PR c++/17868
1999         * error.c (dump_expr): Add missing case for RDIV_EXPR.
2000
2001 2004-10-08  Kazu Hirata  <kazu@cs.umass.edu>
2002
2003         * pt.c, search.c: Fix comment typos.
2004
2005 2004-10-08  Nathan Sidwell  <nathan@codesourcery.com>
2006
2007         * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp,
2008         unmarkedp): Remove.
2009         (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New.
2010         * class.c (struct find_final_overrider_data): Remove most_derived,
2011         vpath_list and vpath fields.  Add path field.
2012         (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust.
2013         (dfs_find_final_overrider): Rename to ...
2014         (dfs_find_final_overrider_pre): ... here. Adjust.
2015         (dfs_find_final_overrider_post): Adjust.
2016         (dfs_find_final_overrider_q): Fold into
2017         dfs_find_final_overrider_pre.
2018         (find_final_overrider): Adjust dfs searching.
2019         (dfs_modify_vtables): Don't mark binfo here.
2020         (modify_all_vtables): Use dfs_walk_once.
2021         (build_vtt_inits): Likwise. Use dfs_walk_all.
2022         (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here.
2023         Return dfs_skip_bases as appropriate.
2024         (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate.
2025         * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as
2026         appropriate. Don't mark binfo here.
2027         (initialize_vtbl_ptrs): Use dfs_walk_once.
2028         * search.c (struct vbase_info): Remove unused struct.
2029         (access_in_type): Use dfs_walk_once.
2030         (dfs_access_in_type): Don't mark binfo here.
2031         (dfs_accessible_queue_p, dfs_accessible_p) Remove.
2032         Fold into ...
2033         (accessible_r): ... here. New. Specialize dfs_walk_once.
2034         (accessible_p): Use accessible_r.
2035         (lookup_field_queue_p): Remove. Fold into ...
2036         (lookup_field_r): ... here. Adjust.
2037         (lookup_member): Use dfs_walk_all.
2038         (dfs_walk_real, dfs_walk): Replace with ...
2039         (dfs_walk_all, dfs_walk_once): ... these.
2040         (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once.
2041         (dfs_unmark, unmarkedp, markedp): Remove.
2042         (dfs_get_pure_virtuals): Don't mark binfo here.
2043         (get_pure_virtuals): Use dfs_walk_once.
2044         (dfs_debug_unmarked_p): Remove. Fold into ...
2045         (dfs_debug_mark): ... here.
2046         (note_debug_info_needed): Use dfs_walk_all.
2047
2048 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
2049
2050         * pt.c (tsubst_expr) <case ASM_EXPR>: Look passed the
2051         CLEANUP_POINT_EXPR to get the asm expression.
2052
2053 2004-10-07  Mark Mitchell  <mark@codesourcery.com>
2054
2055         * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
2056         (DECL_MEMBER_TEMPLATE_P): New macro.
2057         (is_member_template): Remove.
2058         (class_method_index_for_fn): New function.
2059         * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
2060         * class.c (finish_struct_methods): Remove out-of-date comment.
2061         * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
2062         * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
2063         class_method_index_for_fn.
2064         * pt.c (is_member_template): Remove.
2065         (is_member_template_class): Likewise.
2066         (optimize_specialization_lookup_p): New function.
2067         (retrieve_specialization): Optimize lookups for members that are
2068         not member templates.
2069         (register_specialization): Adjust accordingly.
2070         (build_template_decl): Add member_template_p parameter.  Set
2071         DECL_MEMBER_TEMPLATE_P.
2072         (process_partial_specialization): Adjust call to
2073         retrieve_specialization.
2074         (push_template_decl_real): Determine whether the template is a
2075         member template.
2076         (lookup_template_class): Use retrieve_specialization.
2077         (tsubst_decl): Adjust call to retrieve_specialization.
2078         (tsubst_exception_specification): New function.
2079         (tsubst): Use it.
2080         (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
2081         (instantiate_template): Adjust call to retrieve_specialization.
2082         (regenerate_decl_from_template): Do not actually generate a new
2083         DECL.
2084         (instantiate_decl): Adjust call to retrieve_specialization.
2085         (class_method_index_for_fn): New method.
2086
2087 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
2088
2089         * parser.c (cp_parser_asm_definition): Look passed the
2090         CLEANUP_POINT_EXPR to get the asm expression.
2091
2092 2004-10-06  Andrew Pinski  <pinskia@physics.uc.edu>
2093
2094         PR c++/17368
2095         * semantics.c (finish_asm_stmt): Asm expressions need cleanup
2096         also.
2097
2098 2004-10-05  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2099
2100         Convert diagnostics to use quoting flag q 6/n
2101         * pt.c (finish_member_template_decl, check_specialization_scope,
2102         maybe_process_partial_specialization, determine_specialization,
2103         check_explicit_specialization, maybe_check_template_type,
2104         process_partial_specialization, check_default_tmpl_args,
2105         push_template_decl_real, redeclare_class_template,
2106         convert_nontype_argument, coerce_template_parms,
2107         lookup_template_class, push_tinst_level,
2108         instantiate_class_template, tsubst_arg_types,
2109         tsubst_function_type, tsubst, tsubst_qualified_id,
2110         tsubst_copy_and_build, check_instantiated_args,
2111         do_decl_instantiation, do_type_instantiation,
2112         invalid_nontype_parm_type_p, check_specialization_namespace,
2113         convert_template_argument, determine_specialization,
2114         check_template_shadow, tsubst_decl
2115         instantiate_pending_templates): Use quoting marks.
2116
2117 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
2118
2119         PR c++/17829
2120         * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
2121         unqualified lookup finds a member function.
2122
2123 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2124
2125         Convert diagnostics to use quoting flag q 5/n
2126         * parser.c (cp_parser_name_lookup_error,
2127         cp_parser_diagnose_invalid_type_name,
2128         cp_parser_primary_expression, cp_parser_unqualified_id,
2129         cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement,
2130         cp_parser_jump_statement, cp_parser_simple_declaration,
2131         cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
2132         cp_parser_type_parameter, cp_parser_template_id,
2133         cp_parser_template_name, cp_parser_direct_declarator,
2134         cp_parser_parameter_declaration_list, cp_parser_class_head,
2135         cp_parser_base_specifier, cp_parser_lookup_name,
2136         cp_parser_late_parsing_default_args,
2137         cp_parser_optional_template_keyword
2138         cp_parser_elaborated_type_specifier, cp_parser_check_class_key,
2139         cp_parser_check_access_in_redeclaration): Use quoting marks.
2140
2141         * name-lookup.c (supplement_binding, pushdecl,
2142         check_for_out_of_scope_variable, validate_nonmember_using_decl,
2143         do_nonmember_using_decl, lookup_tag, set_decl_namespace,
2144         push_namespace, do_namespace_alias, do_using_directive,
2145         ambiguous_decl, lookup_namespace_name, add_function): Likewise.
2146
2147         * method.c (use_thunk): Likewise.
2148
2149         * lex.c (unqualified_name_lookup_error,
2150         unqualified_fn_lookup_error): Likewise.
2151
2152 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2153
2154         Convert diagnostics to use quoting flag q 4/n
2155         * except.c (decl_is_java_type, build_throw,
2156         is_admissible_throw_operand, check_handlers_1, check_handlers):
2157         Use quoting formats.
2158         * friend.c (add_friend, make_friend_class, do_friend): Likewise.
2159         * init.c (sort_mem_initializers, emit_mem_initializers,
2160         member_init_ok_or_else, expand_member_init, is_aggr_type,
2161         build_offset_ref, build_java_class_ref): Likewise.
2162
2163 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2164
2165         Convert diagnostics to use quoting flag q 3/n
2166         * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
2167         redeclaration_error_message, lookup_label, check_goto,
2168         make_typename_type, make_unbound_class_template,
2169         fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1,
2170         grok_reference_init, layout_var_decl, maybe_commonize_var,
2171         check_for_uninitialized_const_var, reshape_init_array,
2172         reshape_init, check_initializer, cp_finish_decl,
2173         member_function_or_else, bad_specifiers, grokfndecl, grokvardecl,
2174         check_static_variable_definition, compute_array_index_type,
2175         create_array_type_for_decl, check_special_function_return_type,
2176         grokdeclarator, check_default_argument, grokparms,
2177         grok_ctor_properties, grok_op_properties,
2178         check_elaborated_type_specifier, xref_tag, finish_enum,
2179         build_enumerator, check_function_type, start_preparsed_function,
2180         store_parm_decls): Use quoting formats.
2181         * decl2.c (grok_array_decl, delete_sanity, check_member_template,
2182         check_java_method, check_classfn, finish_static_data_member_decl,
2183         grokfield, grokbitfield, grok_function_init,
2184         build_anon_union_vars, coerce_new_type, coerce_delete_type,
2185         check_default_args): Likewise.
2186         * parser.c (cp_parser_decl_specifier_seq): Likewise.
2187
2188 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2189
2190         Convert diagnostics to use quoting flag q 2/n
2191         * class.c (build_base_path, add_method, alter_access,
2192         handle_using_decl, check_bases,
2193         maybe_warn_about_overly_private_class, find_final_overrider,
2194         warn_hidden, finish_struct_anon, add_implicitly_declared_members,
2195         check_bitfield_decl, check_field_decls, layout_empty_base,
2196         build_base_field, check_methods, layout_virtual_bases,
2197         warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
2198         resolve_address_of_overloaded_function, instantiate_type,
2199         note_name_declared_in_class): Use format flag "q" for quoting.
2200
2201 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2202
2203         Convert diagnostics to use quoting flag q 1/n
2204         * error.c (locate_error): Ignore quoting flag q.
2205         * call.c (build_user_type_conversion_1, build_operator_new_call,
2206         build_object_call, op_error, build_conditional_expr,
2207         build_new_op, build_op_delete_call, enforce_access,
2208         convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
2209         convert_default_arg, build_over_call, build_new_method_call,
2210         joust, perform_implicit_conversion, initialize_reference): Use the
2211         quoting flag q.
2212
2213 2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>
2214
2215         PR c++/17797
2216         * typeck.c (build_reinterpret_cast): Return if the inner type
2217         is error_mark_node.
2218
2219 2004-10-01  Jan Hubicka  <jh@suse.cz>
2220
2221         * semantics.c (expand_body): Update call of tree_rest_of_compilation.
2222
2223 2004-09-30  Nathan Sidwell  <nathan@codesourcery.com>
2224
2225         * cp-tree.h (struct lang_decl): Shrink by reordering fields and
2226         turning operator_code and fixed_offset into bitfields.
2227
2228 2004-09-29  Joseph S. Myers  <jsm@polyomino.org.uk>
2229
2230         * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
2231
2232 2004-09-29  Jason Merrill  <jason@redhat.com>
2233
2234         PR tree-optimization/17697
2235         * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
2236
2237 2004-09-28  Jason Merrill  <jason@redhat.com>
2238
2239         PR middle-end/17525
2240         * class.c (build_base_field): Set TYPE_MODE.
2241
2242 2004-09-28  Roger Sayle  <roger@eyesopen.com>
2243
2244         PR driver/17537
2245         * g++spec.c (lang_specific_driver): Unrecognized libraries, other
2246         than -lc and -lm, may require linking against libstc++.
2247
2248 2004-09-28  Kazu Hirata  <kazu@cs.umass.edu>
2249
2250         * tree.c: Fix a comment typo.
2251
2252 2004-09-28  Nathan Sidwell  <nathan@codesourcery.com>
2253
2254         * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
2255         (struct secondary_vptr_vtt_init_data_s): New.
2256         (build_vtt_inits): Adjust dfs_walkers.
2257         (dfs_build_secondary_vptr_vtt_inits): Caller data is a
2258         secondary_vptr_vtt_init_data_s structure. Adjust.
2259         (dfs_ctor_vtable_bases_queue_p): Remove.
2260         (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
2261
2262         * pt.c (struct get_template_base_data_s): Remove.
2263         (get_template_base_r): Fold into get_template_base.
2264         (get_template_base): Walk base binfos directly in inheritance
2265         graph order.
2266
2267 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
2268
2269         PR c++/17642
2270         * cp-tree.h (fold_if_not_in_template): New function.
2271         * call.c (build_conditional_expr): Use fold_if_not_in_template.
2272         (build_cxx_call): Likewise.
2273         * cvt.c (convert_to_complex): Likewise.
2274         (ocp_convert): Likewise.
2275         (convert): Likewise.
2276         (convert_force): Likewise.
2277         * decl.c (compute_array_index_type): Clear
2278         processing_template_decl while folding array bounds.
2279         * pt.c (convert_nontype_argument): Clear
2280         processing_template_decl while processing non-type argument
2281         initialization.
2282         * tree.c (fold_if_not_in_template): New function.
2283         * typeck.c (build_class_member_access_expr): Use
2284         fold_if_not_in_template.
2285         (build_array_ref): Likewise.
2286         (build_binary_op): Likewise.  Do not try to optimize computations
2287         when processing templates.
2288         (cp_pointer_int_sum): Use fold_if_not_in_template.
2289         (pointer_diff): Likewise.
2290         (build_unary_op): Likewise.
2291         (build_reinterpret_cast): Likewise.
2292         (get_delta_difference): Likewise.
2293         (expand_ptrmemfunc_cst): Likewise.
2294         (dubious_conversion_warnings): Likewise.
2295
2296 2004-09-27  Matt Austern  <austern@apple.com>
2297
2298         * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
2299         (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
2300         tokens that come from headers that are implicitly extern "C".
2301         (struct cp_parser): new one-bit field, implicit_extern_c.
2302         (cp_parser_new): Set parser's implicit_extern_c to false.
2303         (cp_parser_translation_unit): Pop lang context if we were in a
2304         header that was implicitly extern "C".
2305         (cp_parser_declaration_seq_opt): Push/pop lang context as
2306         required by the token's and parser's implicit_extern_c.
2307
2308 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
2309
2310         PR c++/17585
2311         * cp-tree.h (shared_member_p): Declare.
2312         * search.c (shared_member_p): Give it external linkage.
2313         * semantics.c (finish_qualified_id_expr): Use it.
2314         (finish_id_expression): Likewise.
2315
2316         PR c++/17585
2317         * semantics.c (finish_id_expression): Do not add "this->" to
2318         static member functions.
2319
2320 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
2321
2322         PR c++/17681
2323         * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
2324
2325         * class.c (struct count_depth_data): Remove.
2326         (dfs_depth_post, dfs_depth_q): Remove.
2327         (find_final_overrider): Use number of vbase classes as depth
2328         bound.
2329
2330         * cp-tree.h (types_overlap_p): Remove.
2331         * search.c (struct overlap_info): Remove.
2332         (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
2333
2334         * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
2335         (get_template_base_recursive): Remove. Replace with ...
2336         (get_template_base_r): ... this.
2337         (struct get_template_base_data_s): New.
2338         (get_template_base): Use get_template_base_r via dfs_walk.  Always
2339         return NULL on failure.
2340         (unify): Remove error_mark_node check from get_template_base result.
2341
2342 2004-09-24  Paolo Bonzini  <bonzini@gnu.org>
2343
2344         * parser.c (cp_parser_expression_stack): Clarify why it is
2345         an array of NUM_PREC_VALUES elements.
2346         (cp_parser_binary_expression): Clarify why we do not need to
2347         handle stack overflow.
2348
2349 2004-09-24  Nathan Sidwell  <nathan@codesourcery.com>
2350
2351         PR c++/16889
2352         * search.c (lookup_field_queue_p): Correct check for hidden base.
2353
2354         * search.c (bfs_walk): Remove.
2355         (lookup_member): Use dfs_walk_real.
2356         (dfs_walk_real): Move and adjust documentation from bfs_walk.
2357
2358 2004-09-23  Zack Weinberg  <zack@codesourcery.com>
2359
2360         * decl.c (grokfndecl): If ::main is found not to return int,
2361         correct it after issuing a diagnostic.
2362         (grokdeclarator): If the incoming type was error_mark_node, do
2363         not complain about declaring something with no type.
2364         (start_function): Change check for ::main not returning int to
2365         an assertion, as grokfndecl now catches this when the user did it.
2366         * init.c (perform_member_init, sort_mem_initializers)
2367         (emit_mem_initializers): Make most diagnostics be issued on
2368         the line of current_function_decl, not whatever the current
2369         input line is.
2370         * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
2371         definition and declaration with #ifdef ENABLE_CHECKING.
2372         Avoid unnecessary use of fprintf.
2373         (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
2374         definitions to avoid warnings.
2375         (cp_lexer_new_main): Add assertion that first token is not a
2376         padding token.
2377         (cp_lexer_new_from_token_array): Fold into ...
2378         (cp_lexer_new_from_tokens): ... here.  Add assertion that
2379         first token is not a padding token.
2380         (cp_lexer_set_source_position_from_token): Move nearer to callers.
2381         Remove unused lexer argument.
2382         (cp_lexer_peek_token): Just print debugging report (if enabled)
2383         and return lexer->next_token.
2384         (cp_lexer_skip_purged_tokens): Delete.
2385         (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
2386         inline, simplify bodies.
2387         (cp_lexer_peek_nth_token): Add debugging report a la
2388         cp_lexer_peek_token.
2389         (cp_lexer_consume_token): Correct commentary.  Advance over
2390         purged tokens here.  Set current source position here, from
2391         token to be returned.  Avoid unnecessary use of fprintf.
2392         (cp_lexer_purge_token): Advance next_token pointer over this and
2393         subsequent purged tokens.
2394         (cp_parser_error): Adjust source position to that of the
2395         peeked token.
2396         (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
2397         (cp_parser_string_literal): Remove some excessive cleverness.
2398         (cp_parser_enum_specifier): Call start_enum before consuming
2399         the opening brace.
2400         (cp_parser_member_declaration): Make the "extra semicolon"
2401         diagnostic consistently-worded with the other place this is
2402         diagnosed.  Explicitly set the diagnostic location to the
2403         location of the offending semicolon.
2404         (cp_parser_enclosed_template_argument_list): Use %</%> quoting
2405         in diagnostics.  Do not use cp_parser_require.  Set location
2406         of diagnostics about improper use of '>>' to location of
2407         offending token.
2408         (cp_parser_late_parsing_for_member):
2409         Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
2410         (cp_parser_late_parsing_default_args): Likewise.  Manually
2411         move some logic outside the loop.
2412
2413 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
2414
2415         PR c++/17618
2416         * cvt.c (cp_convert_to_pointer): Return early when the type is
2417         an error_mark_node.
2418
2419 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
2420
2421         PR c++/13989
2422         PR c++/9844
2423         * decl.c (grokfndecl): Add new argument "attrlist", use it
2424         to call cplus_decl_attributes.
2425         (start_function): Remove call to cplus_decl_attributes.
2426         * cvt.c (ocp_convert): Add support to use type conversion
2427         function to vector type.
2428         * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
2429         to the parsed type.
2430
2431 2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
2432
2433         PR c++/17596
2434
2435         * parser.c (cp_parser_token_tree_map_node,
2436         cp_parser_pm_expression, cp_parser_additive_expression,
2437         cp_parser_multiplicative_expression, cp_parser_shift_expression,
2438         cp_parser_relational_expression, cp_parser_equality_expression,
2439         cp_parser_and_expression, cp_parser_exclusive_or_expression,
2440         cp_parser_inclusive_or_expression,
2441         cp_parser_logical_and_expression,
2442         cp_parser_logical_or_expression): Removed.
2443         (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
2444         binops, binops_by_token): New.
2445         (cp_parser_assignment_expression): Use cp_parser_binary_expression.
2446         (cp_parser_new): Initialize binops_by_token.
2447         (cp_parser_binary_expression): Rewritten.
2448         (N_CP_TTYPES): New.
2449
2450 2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
2451
2452         * parser.c: Fix a comment typo.
2453
2454 2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
2455
2456         PR c++/17620
2457         * decl.c (xref_basetypes): Look through typedefs before checking
2458         for duplicate base.
2459
2460 2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
2461
2462         * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
2463         * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
2464         * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
2465         (init_rtti_processing): Initialize it to something realistic.
2466         (get_tinfo_decl): Adjust pushing the new decl.
2467
2468         * cp-tree.h (struct lang_type_class): Remove marked flags, add
2469         diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
2470         (TYPE_MARKED_P): New.
2471         (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
2472         (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
2473         CLEAR_CLASSTYPE_MARKED_N): Remove.
2474         (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
2475         CLEAR_CLASSTYPE_MARKED_*): Remove.
2476         * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
2477         shaped and repeated base properties.
2478         * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
2479         * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
2480         class_hint_flags): Remove.
2481         (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
2482         CLASSTYPE_DIAMOND_SHAPED_P.
2483
2484 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
2485
2486         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
2487         cp-objcp-common.h.
2488         (objcp_tsubst_copy_and_build): Reformat function signature.
2489         * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
2490         (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
2491
2492 2004-09-21  Zack Weinberg  <zack@codesourcery.com>
2493
2494         * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
2495         Don't handle CPP_PRAGMA tokens specially.
2496         (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
2497         purge the token; do clear token->value after processing.  Add
2498         assertion at beginning that token->value is nonzero.
2499         (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
2500         CPP_PRAGMA as a full statement or declaration in its own right.
2501
2502 2004-09-21  Matt Austern  <austern@apple.com>
2503
2504         PR c++/15049
2505         * decl.c (grokvardecl): Accept declarations of global variables
2506         using anonymous types.
2507
2508 2004-09-21  Roger Sayle  <roger@eyesopen.com>
2509
2510         PR c++/7503
2511         * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
2512         if either operand has side-effects.
2513         * typeck.c (rationalize_conditional_expr): Assert that neither
2514         operand of MIN_EXPR or MAX_EXPR has side-effects.
2515         (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
2516         Check that the "lhs" is a valid lvalue, i.e. that neither operand
2517         of a MIN_EXPR or MAX_EXPR has a side-effect.
2518
2519 2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
2520
2521         * cp-tree.h (struct lang_type_header): Remove
2522         uses_multiple_inheritance field.
2523         (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
2524         (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
2525         (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
2526         (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
2527         (TYPE_CONTAINS_VPTR_P): Likewise.
2528         * call.c (add_template_candidate_real): Use
2529         CLASSTYPE_VBASECLASSES.
2530         (build_special_member_call): Likewise.
2531         * class.c (finish_struct_bits): Remove
2532         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
2533         bookkeeping.
2534         (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
2535         (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
2536         bookkeeping.
2537         (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
2538         (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
2539         Likewise.
2540         * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
2541         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
2542         bookkeeping.
2543         (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
2544         * decl2.c (maybe_retrofit_in_chrg): Likewise.
2545         * init.c (expand_member, push_base_cleanups): Likewise.
2546         * pt.c (instantiate_class_template): Remove
2547         TYPE_USES_MULTIPLE_INHERITANCE,
2548         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
2549         bookkeeping.
2550         * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
2551         check.
2552         * typeck2.c (process_init_constructor): Replace some sorrys with
2553         asserts.
2554
2555 2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
2556
2557         * decl.c (reshape_init_array): Initialize max_index_cst to fix
2558         bootstrap failure.
2559
2560 2004-09-20  Mark Mitchell  <mark@codesourcery.com>
2561
2562         PR c++/17530
2563         * pt.c (tsubst): Fix parentheses to accomodate emacs.
2564         (tsubst_baselink): If we get a single function, mark it as used.
2565
2566 2004-09-20  Matt Austern <austern@apple.com>
2567             Zack Weinberg  <zack@codesourcery.com>
2568
2569         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
2570         Apply lbasename to input_filename before passing to get_fileinfo.
2571         * semantics.c (begin_class_definition): Likewise.
2572         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
2573         correct filename.  Rename variables to be less confusing.
2574         (handle_pragma_implementation): Likewise.  Disable "appears
2575         after file is included" diagnostic.
2576
2577         * parser.c (struct cp_token): Add in_system_header fiag.
2578         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
2579         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
2580         (CPP_NONE, cp_lexer_read_token): Delete.
2581         (struct cp_lexer): Remove first_token, string_tokens,
2582         main_lexer_p fields.  Clarify comments.
2583         (struct cp_token_cache): Now just a pair of pointers.
2584         (CP_LEXER_BUFFER_SIZE): New #define.
2585         (CPP_PURGED): New fake token type.
2586         (cp_lexer_new_from_token_array, cp_lexer_destroy)
2587         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
2588         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
2589         New functions.
2590         (cp_lexer_new_from_tokens): Now a simple wrapper around
2591         cp_lexer_new_from_token_array.
2592         (cp_lexer_set_source_position_from_token): Also update
2593         in_system_header.
2594         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
2595         Don't wrap round.
2596         (cp_lexer_token_difference): Dont handle wrapping round.
2597         (cp_lexer_new_main): Enable pragma deferral and raw strings,
2598         read the entire translation unit through c_lex_with_flags into
2599         this lexer's buffer, then turn raw strings back off again.
2600         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
2601         (cp_lexer_get_preprocessor_token): No need to handle not being
2602         the main lexer.  Set token->in_system_header too.
2603         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
2604         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
2605         (cp_lexer_peek_nth_token): Likewise.
2606         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
2607         the other tokens down.
2608         (cp_lexer_purge_tokens_after): Likewise.
2609         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
2610         about there being no tokens.
2611         (cp_lexer_print_token): Revise to give useful information on
2612         all tokens.
2613         (struct cp_parser): Add field translate_strings_p.
2614         (cp_parser_new): Initialize it.
2615         (cp_parser_translation_unit): Destroy the lexer when done.
2616         (cp_parser_parameter_declaration): Restructure saving of
2617         default arguments.
2618         (cp_parser_save_member_function_body): Likewise.
2619         (cp_parser_check_for_invalid_template_id)
2620         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
2621         Adjust calls to cp_lexer_advance_token.
2622         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
2623         No need to fiddle c_lex_string_translate.
2624         (cp_parser_primary_expression, cp_parser_linkage_specification)
2625         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
2626         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
2627         Use cp_parser_string_literal.
2628         (cp_parser_attribute_list): Save and restore
2629         parser->translate_strings_p, not c_lex_string_translate.
2630         (cp_parser_cache_group): Delete.
2631         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
2632         not take a cache argument.
2633
2634 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2635
2636         PR c++/14179
2637         * decl.c (reshape_init): Extract array handling into...
2638         (reshape_init_array): New function. Use integers instead of trees
2639         for indices. Handle out-of-range designated initializers.
2640
2641 2004-09-20  Steven Bosscher  <stevenb@suse.de>
2642
2643         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
2644         to null_node.
2645
2646 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
2647
2648         * decl2.c (determine_visibility): Allow class visibility
2649         directives to override targetm.cxx.export_class_data.
2650
2651 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
2652
2653         * call.c, semantics.c: Follow spelling conventions.
2654         * class.c: Fix a comment typo.
2655
2656 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
2657
2658         PR pch/13361
2659         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
2660         (handle_pragma_implementation): Likewise.
2661
2662 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
2663             Zack Weinberg  <zack@codesourcery.com>
2664
2665         * cp-tree.def: Use tree_code_class enumeration constants
2666         instead of code letters.
2667         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
2668         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
2669         Update for new tree-class enumeration constants.
2670
2671 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
2672
2673         PR c++/16002
2674         * parser.c (cp_parser_simple_declaration): Commit to tentative
2675         parses after seeing a decl-specifier.
2676         (cp_parser_simple_declaration): Eliminate spurious message.
2677         (cp_parser_init_declarator): Adjust error message.
2678
2679         PR c++/16029
2680         * lex.c (unqualified_name_lookup_error): Mark the dummy
2681         declaration as used.
2682
2683         PR c++/17501
2684         * parser.c (cp_parser_nested_name_specifier): Do not resolve
2685         typename types if the user explicitly said "typename".
2686
2687 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
2688
2689         * error.c (dump_decl): Make sure there is lang_specific info before
2690         checking for DTOR and CTOR decls.
2691
2692 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
2693
2694         * class.c (copy_virtuals): Remove.
2695         (build_primary_vtable): Use copy_list directly.
2696         (build_secondary_vtable): Likewise.
2697         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
2698         (create_vtable_ptr): Likewise.
2699
2700 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
2701
2702         * search.c: Follow spelling conventions.
2703
2704 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
2705
2706         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
2707         VEC(tree).
2708         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
2709         comments.
2710         * call.c (build_new_method_call): Don't confirm a pure virtual is
2711         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
2712         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
2713         (fixup_inline_methods, finish_struct): Likewise.
2714         * decl.c (finish_method): Likewise.
2715         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
2716         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
2717         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
2718         vector to avoid repeating the list in error messages.
2719
2720 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
2721
2722         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
2723         * cp-tree.h (cxx_comdat_group): Declare.
2724         * decl.c (cxx_comdat_group): New function.
2725
2726 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
2727
2728         * search.c (get_pure_virtuals): Remove unused variables.
2729
2730         * cp-tree.h (struct lang_decl_flags): Remove
2731         needs_final_overrider.
2732         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
2733         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
2734         * class.c (finish_struct_bits): Correct comment about
2735         CLASSTYPE_PURE_VIRTUALS.
2736         * search.c (get_pure_virtuals): Remove useless loop.
2737
2738 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
2739
2740         PR c++/17324
2741         * mangle.c (partially_mangled_name): New variable.
2742         (partially_mangled_name_len): Likewise.
2743         (save_partially_mangled_name): New function.
2744         (restore_partially_mangled_name): Likewise.
2745         (write_encoding): Save and restore partially mangled names around
2746         calls to get_mostly_instantiated_function_type.
2747         (write_unqualified_name): Likewise.
2748
2749 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
2750
2751         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
2752
2753 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
2754
2755         PR c++/16162
2756         * parser.c (cp_parser_id_expression): Correct value for
2757         is_declarator.
2758         (cp_parser_nested_name_specifier_opt): Look through typenames as
2759         necessary.
2760         (cp_parser_template_name): Honor check_dependency_p.
2761
2762         PR c++/16716
2763         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
2764         Robustify.
2765
2766         PR c++/17327
2767         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
2768         gcc_unreacable.
2769
2770 2004-09-12  Richard Henderson  <rth@redhat.com>
2771
2772         PR c++/16254
2773         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
2774         * typeck.c (condition_conversion): Likewise.
2775
2776 2004-09-11  Richard Henderson  <rth@redhat.com>
2777
2778         PR c++/17404
2779         * pt.c (cur_stmt_expr): Move from tsubst_expr.
2780         (tsubst_expr) <case STMT_EXPR>: Move ...
2781         (tsubst_copy_and_build): ... here.
2782
2783 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
2784
2785         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
2786         comment explaining them moved to c-common.h.
2787         * lex.c (interface_only, interface_unknown, extract_interface_info):
2788         Delete definitions.
2789         (cxx_finish): Don't reset interface_unknown.
2790         (handle_pragma_interface): Don't set interface_only and
2791         interface_unknown; just the like-named fields in finfo.
2792         (handle_pragma_implementation): Adjust comment.
2793         * decl2.c (cp_finish_file): Don't reset interface_only and
2794         interface_unknown.
2795         * method.c (synthesize_method): Don't reset interface_unknown or
2796         call extract_interface_info.
2797         * pt.c (pop_tinst_level): Don't call extract_interface_info.
2798         * decl.c (start_cleanup_fn): Don't save or restore interface_only
2799         and interface_unknown.
2800         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
2801         and use the result instead of the interface_only/interface_unknown
2802         globals.
2803         (start_preparsed_function): Likewise.
2804         * lex.c (cxx_make_type): Likewise.
2805         * semantics.c (begin_class_definition): Likewise.
2806         (expand_body): Don't call extract_interface_info.
2807
2808 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
2809
2810         * decl.c (objc_mark_locals_volatile): Make description of
2811         routine more descriptive; only mark VAR_DECLs at each
2812         binding level.
2813
2814 2004-09-10  Richard Henderson  <rth@redhat.com>
2815
2816         PR c++/17386
2817         * call.c (build_vfield_ref): Move...
2818         * class.c (build_vfield_ref): ... here.  Convert datum to the
2819         primary base containing the vptr.
2820         (make_new_vtable): Simplify build_primary_vtable arguments.
2821         (finish_struct_1): Do not duplicate TYPE_VFIELD.
2822         * typeck.c (build_class_member_access_expr): Don't warn for
2823         null object access to base fields.
2824
2825 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
2826
2827         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
2828         New functions, to be called from ObjC++.
2829
2830 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
2831
2832         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
2833         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
2834         comment typos.
2835
2836 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
2837
2838         * typeck.c (build_c_cast): Preserve the cast if casting
2839         to and from an Objective-C type.
2840
2841 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
2842
2843         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
2844         * typeck.c: Include c-common.h.
2845         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
2846         return the result if nonnegative.
2847
2848 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
2849
2850         * decl2.c (import_export_class)
2851         * lex.c (handle_pragma_interface):
2852         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
2853
2854 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
2855
2856         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
2857         * semantics.c: Include c-common.h.
2858         (finish_compound_stmt): Call objc_clear_super_receiver().
2859
2860 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
2861
2862         * cp-tree.h (do_poplevel): New prototype.
2863         * semantics.c (do_poplevel): Make externally visible.
2864
2865 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
2866
2867         * cp-tree.h (tree_pair_s): Define a GC'd vector.
2868         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
2869         * semantics.c (deferred_access): Likewise.
2870
2871 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
2872
2873         * semantics.c (expand_body): Assert that we are not nested.
2874
2875 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
2876
2877         * decl.c (build_enumerator): Use add_double and int_fits_type_p
2878         instead of cp_build_binary_op, to avoid creating short-lived trees.
2879         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
2880         lookahead instead of backtracking.  Move some code to avoid a
2881         conditional branch.
2882         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
2883         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
2884         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
2885         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
2886
2887 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2888
2889         * decl.c (grok_declarator): Remove a redundant semicolon.
2890
2891         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
2892         Correct comments describing function parameters.
2893
2894 2004-09-03  Matt Austern  <austern@apple.com>
2895         Compile speed improvement.
2896         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
2897         Otherwise define a stub macro that expands to nothing.
2898         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
2899         define a stub macro that expands to 0.
2900         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
2901         (cp_lexer_stop_debugging): Likewise.
2902         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
2903         define a stub macro that expands to NULL.
2904         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
2905         (cp_lexer_new_from_tokens): Likewise.
2906
2907 2004-09-03  Jan Hubicka  <jh@suse.cz>
2908
2909         * decl.c (finish_function): Clean out pointers we no longer need.
2910
2911 2004-09-03  Jan Beulich  <jbeulich@novell.com>
2912
2913         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
2914         than "-lm".
2915
2916 2004-09-02  Paul Brook  <paul@codesourcery.com>
2917
2918         * decl2.c (determine_visibility): Only check data visibility
2919         for VAR_DECLS.
2920
2921 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
2922
2923         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
2924         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
2925         * decl2.c (determine_visibility): Honor
2926         TARGET_CXX_EXPORT_CLASS_DATA.
2927
2928         * class.c (key_method): Rename to ...
2929         (determine_key_method): ... this.
2930         (finish_struct_1): Adjust accordingly.
2931         * cp-tree.h (key_method): Declare.
2932         * decl2.c (maybe_emit_vtables): Determine the key method here if
2933         it has not already been done.
2934
2935 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
2936
2937         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
2938         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
2939         (cp/cp-decl.c): Do not depend on gtype-cp.h.
2940         (cp/cp-objcp-common.o): New target.
2941         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
2942         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
2943         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
2944         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
2945         respectively.
2946         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
2947         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
2948         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
2949         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
2950         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
2951         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
2952         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
2953         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
2954         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
2955         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
2956         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
2957         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
2958         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
2959         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
2960         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
2961         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
2962         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
2963         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
2964         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
2965         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
2966         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
2967         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
2968         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
2969         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
2970         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
2971         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
2972         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
2973         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
2974         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
2975         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
2976         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
2977         hooks to cp-objcp-common.h.
2978         (finish_file): New function.
2979         * cp-objcp-common.c: New file.
2980         * cp-objcp-common.h: New file.
2981         * cp-tree.h (cp_finish_file): New prototype.
2982         * decl.c: Do not include gtype-cp.h.
2983         * decl2.c (finish_file): Rename to cp_finish_file.
2984
2985 2004-08-31  Richard Henderson  <rth@redhat.com>
2986
2987         PR c++/17221
2988         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
2989         (tsubst_copy_and_build): ... here.
2990
2991 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
2992
2993         * cp-tree.h (initialize_artificial_var): Declare.
2994         * decl.c (initialize_artifical_var): New function.
2995         * class.c (initialize_array): Remove.
2996         (initialize_vtable): Use initialize_artificial_var.
2997         (build_vtt): Likewise.
2998         (build_ctor_vtbl_group): Likewise.
2999
3000 2004-08-30  Richard Henderson  <rth@redhat.com>
3001
3002         * class.c (build_base_path): Use build_address directly.
3003         * typeck.c (build_unary_op): Don't lower &a.b to pointer
3004         arithmetic directly.
3005         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
3006         means !initializer_constant_valid_p.
3007
3008 2004-08-30  Richard Henderson  <rth@redhat.com>
3009
3010         * class.c (fixed_type_or_null): Use get_base_address before
3011         assuming an ADDR_EXPR is non-null.
3012
3013 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3014
3015         * name-lookup.c (pop_binding, pushdecl,
3016         set_identifier_type_value_with_scope, push_overloaded_decl,
3017         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
3018         * parser.c (cp_parser_diagnose_invalid_type_name,
3019         cp_parser_postfix_expression, cp_parser_unary_expression,
3020         cp_parser_check_declarator_template_para): Likewise.
3021         * pt.c (push_inline_template_parms_recursive,
3022         check_explicit_specialization, convert_nontype_argument,
3023         coerce_template_template_parms, uses_template_parms,
3024         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
3025         tsubst_expr, instantiate_template,
3026         maybe_adjust_types_for_deduction, type_unification_real,
3027         resolve_overloaded_unification, template_decl_level,
3028         type_dependent_expression_p): Likewise.
3029         * search.c (lookup_base_r): Likewise.
3030         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
3031         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
3032         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
3033         * typeck.c (common_type, get_member_function_from_ptrfunc,
3034         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
3035         * typeck2.c (cxx_incomplete_type_diagnostic,
3036         split_nonconstant_init_1, store_init_value,
3037         process_init_constructor): Likewise.
3038
3039 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3040
3041         * call.c (check_dtor_name): Replace abort with gcc_assert or
3042         gcc_unreachable.
3043         (build_call, add_builtin_candidate, build_new_op,
3044         convert_like_real, build_over_call, in_charge_arg_for_name,
3045         source_type, joust): Likewise.
3046         * class.c (build_simple_base_path, get_vcall_index,
3047         finish_struct_1, instantiate_type, get_enclosing_class,
3048         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
3049         * cp-gimplify.c (cp_genericize): Likewise.
3050         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
3051         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
3052         * decl.c (poplevel, make_unbound_class_template, reshape_init,
3053         check_special_function_return_type, grokdeclarator,
3054         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
3055         finish_function): Likewise.
3056         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
3057         * error.c (dump_global_iord, dump_decl, dump_template_decl,
3058         language_to_string): Likewise.
3059         * except.c (choose_personality_routine): Likewise.
3060         * friend.c (do_friend): Likewise.
3061         * g++spec.c (lang_specific_driver): Likewise.
3062         * init.c (build_zero_init, expand_default_init, build_new_1,
3063         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
3064         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
3065         * mangle.c (add_substitution, write_unscoped_name,
3066         write_template_prefix, write_identifier,
3067         write_special_name_destructor, write_type, write_builtin_type,
3068         write_expression, write_template_param,
3069         write_java_integer_type_codes): Likewise.
3070         * method.c (implicitly_declare_fn): Likewise.
3071
3072 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3073
3074         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
3075         (BINFO_INDIRECT_PRIMARY_P): Remove.
3076         * class.c (determine_primary_base): Rename to ...
3077         (determine_primary_bases): ... here.  Set all primary bases.
3078         (set_primary_base): Remove.
3079         (mark_primary_bases): Remove.
3080         (build_simple_base_path, walk_subobject_offsets,
3081         propagate_binfo_offsets, end_of_class): Adjust.
3082         (layout_class_type): Rename determine_primary_base call.
3083         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
3084         to type_as_string.
3085         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
3086         build_rtti_vtbl_entries): Adjust.
3087         * init.c (build_vtbl_address): Adjust.
3088
3089         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
3090
3091 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
3092
3093         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
3094         CXX_AND_OBJCXX_OBJS.
3095         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
3096         separately on the link line.
3097
3098 2004-08-28  Jason Merrill  <jason@redhat.com>
3099
3100         * decl.c (expand_static_init): Avoid bogus warnings.
3101
3102 2004-08-27  Jason Merrill  <jason@redhat.com>
3103
3104         PR c++/16851
3105         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
3106
3107         PR c++/13684
3108         * decl.c (expand_static_init): Use thread-safety API.
3109         (register_dtor_fn): Return the call, don't expand it.
3110         * tree.c (add_stmt_to_compound): New fn.
3111         (stabilize_call): Use it.
3112
3113 2004-08-27  Richard Henderson  <rth@redhat.com>
3114
3115         * cp-tree.def (OFFSETOF_EXPR): New.
3116         * parser.c (cp_parser_builtin_offsetof): Either built an
3117         OFFSETOF_EXPR, or call fold_offsetof immediately.
3118         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
3119
3120 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
3121
3122         * call.c (validate_conversion_obstack): Replace
3123         my_friendly_assert with gcc_assert or gcc_unreachable.
3124         (direct_reference_binding, merge_conversion_sequences,
3125         build_user_type_conversion_1, perform_overload_resolution,
3126         build_op_delete_call, enforce_access, call_builtin_trap,
3127         build_over_call, build_special_member_call, build_new_method_call,
3128         initialize_reference): Likewise.
3129         * class.c (build_base_path, build_primary_vtable, alter_access,
3130         check_bases, update_vtable_entry_for_fn, layout_empty_base,
3131         clone_function_decl, adjust_clone_args,
3132         type_requires_array_cookie, include_empty_classes,
3133         finish_struct_1, resolve_address_of_overloaded_function,
3134         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
3135         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
3136         accumulate_vtbl_inits, build_vtbl_initializer,
3137         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
3138         * cvt.c (build_up_reference, convert_to_reference): Likewise.
3139         * decl.c (poplevel, duplicate_decls, make_typename_type,
3140         cxx_init_decl_processing, reshape_init, check_initializer,
3141         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
3142         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
3143         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
3144         xref_basetypes, start_preparsed_function, save_function_data,
3145         finish_function, finish_method, maybe_register_incomplete_var,
3146         complete_vars): Likewise.
3147         * decl2.c (grok_array_decl, check_member_template,
3148         check_classfn, finish_static_data_member_decl, coerce_new_type,
3149         coerce_delete_type, import_export_class, decl_needed_p,
3150         determine_visibility, import_export_decl, build_cleanup,
3151         start_static_initialization_or_destructi, do_static_destruction,
3152         prune_vars_needing_no_initialization,
3153         build_offset_ref_call_from_tree): Likewise.
3154         * error.c (dump_decl, dump_expr): Likewise.
3155         * init.c (finish_init_stmts, build_zero_init,
3156         expand_virtual_init, expand_default_init, expand_aggr_init_1,
3157         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
3158         Likewise.
3159         * mangle.c (write_method_parms, write_template_args,
3160         write_expression, write_template_arg): Likewise.
3161         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
3162         * name-lookup.c (pop_binding, begin_scope, leave_scope,
3163         resume_scope, push_using_decl, validate_nonmember_using_decl,
3164         is_ancestor, poplevel_class, set_inherited_value_binding_p,
3165         push_class_level_binding, do_class_using_decl, push_namespace,
3166         pop_namespace, add_using_namespace, ambiguous_decl,
3167         lookup_namespace_name, lookup_type_current_level,
3168         maybe_process_template_type_declaration): Likewise.
3169         * parser.c (cp_lexer_peek_nth_token,
3170         cp_parser_parse_and_diagnose_invalid_typ,
3171         cp_parser_translation_unit, cp_parser_template_id,
3172         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
3173         * pt.c (push_access_scope, finish_member_template_decl,
3174         push_inline_template_parms_recursive, add_outermost_template_args,
3175         get_innermost_template_args, begin_explicit_instantiation,
3176         end_explicit_instantiation, retrieve_specialization,
3177         is_specialization_of, is_specialization_of_friend,
3178         register_specialization, check_explicit_specialization,
3179         comp_template_parms, process_template_parm,
3180         process_partial_specialization, convert_nontype_argument,
3181         coerce_template_template_parms, coerce_template_parms,
3182         mangle_class_name_for_template, lookup_template_function,
3183         lookup_template_class, instantiate_class_template, tsubst_decl,
3184         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
3185         instantiate_template, fn_type_unification, type_unification_real,
3186         get_template_base, regenerate_decl_from_template,
3187         template_for_substitution, instantiate_decl,
3188         get_mostly_instantiated_function_type, dependent_scope_ref_p,
3189         value_dependent_expression_p, resolve_typename_type): Likewise.
3190         * repo.c (repo_emit_p): Likewise.
3191         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
3192         create_tinfo_types, emit_tinfo_decl): Likewise.
3193         * search.c (lookup_base_r, lookup_base, lookup_field_1,
3194         dfs_access_in_type, build_baselink, lookup_member,
3195         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
3196         * semantics.c (perform_or_defer_access_check,
3197         finish_non_static_data_member, finish_stmt_expr_expr,
3198         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
3199         finish_template_template_parm, finish_member_declaration,
3200         emit_associated_thunks): Likewise.
3201         * tree.c (build_target_expr_with_type, force_target_expr,
3202         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
3203         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
3204         cxx_sizeof_or_alignof_type, perform_integral_promotions,
3205         build_class_member_access_expr, finish_class_member_access_expr,
3206         build_ptrmemfunc_access_expr, build_unary_op,
3207         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
3208         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
3209         * typeck2.c (complete_type_check_abstract,
3210         abstract_virtuals_error, process_init_constructor,
3211         add_exception_specifier): Likewise.
3212
3213 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
3214
3215         * class.c (build_vtbl_initializer): Use ssize_int.
3216         * decl.c (complete_array_type): Likewise.
3217         * method.c (finish_thunk): Likewise.
3218         * search.c (get_dynamic_base_type): Likewise.
3219
3220 2004-08-26  Richard Henderson  <rth@redhat.com>
3221
3222         * cp-tree.h (DECL_FIELD_IS_BASE): New.
3223         * class.c (build_base_field): Set it.
3224         (build_simple_base_path): Use it.
3225         (fixed_type_or_null): Don't consider base fields definitive.
3226
3227 2004-08-25  Roger Sayle  <roger@eyesopen.com>
3228
3229         PR middle-end/16693
3230         PR tree-optimization/16372
3231         * decl.c (finish_enum): Make the precision of the enumerated type
3232         the same width as the underlying integer type.
3233
3234 2004-08-25  Mark Mitchell  <mark@codesourcery.com>
3235
3236         PR c++/17155
3237         * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
3238         functions.
3239
3240         * mangle.c (get_identifier_nocopy): Add cast.
3241
3242         * cp-tree.h (mangle_type): Remove.
3243         * mangle.c (globals): GTY it.
3244         (mangle_obstack): New variable.
3245         (name_obstack): Likewise.
3246         (name_base): Likewise.
3247         (write_char): Adjust accordingly.
3248         (write_chars): Likewise.
3249         (write_string): Likewise.
3250         (start_mangling): Initialize G.substitutions only one.  Add
3251         ident_p parameter.
3252         (finish_mangling): Use VARRAY_CLEAR to reclaim
3253         storage in G.substitutions.  Use obstack_finish.
3254         (init_mangle): Adjust for changes to variable names above.
3255         Initialize G.substitutions.
3256         (mangle_decl_string): Adjust call to start_mangling.
3257         (get_identifier_nocopy): New function.
3258         (mangle_decl): Use it.
3259         (mangle_type_string): Adjust call to start_mangling.
3260         (mangle_special_for_type): Likewise.
3261         (mangle_vtt_for_type): Likewise.
3262         (mangle_ctor_vtbl_for_type): Likewise.
3263         (mangle_thunk): Likewise.
3264         (mangle_guard_variable): Likewise.
3265         (mangle_ref_init_variable): Likewise.
3266
3267 2004-08-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3268
3269         PR c++/14428
3270         * pt.c (redeclare_class_template): Check the type of non-type and
3271         template template parameter.
3272
3273 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
3274
3275         * call.c (convert_class_to_reference): Adjust build_int_cst calls.
3276         (build_user_type_conversion_1, convert_like_real,
3277         build_java_interface_fn_ref, build_special_member_call): Likewise.
3278         * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
3279         * cp-gimplify.c (cp_gimplify_expr): Likewise.
3280         * cvt.c (cp_convert_to_pointer): Likewise.
3281         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
3282         * decl2.c (start_static_initialization_or_destruction,
3283         generate_ctor_or_dtor_function): Likewise.
3284         * except.c (build_throw): Likewise.
3285         * mangle.c (write_integer_cst): Likewise.
3286         * method.c (finish_thunk): Likewise.
3287         * rtti.c (build_headof, get_tinfo_decl_dynamic,
3288         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
3289         get_pseudo_ti_init): Likewise.
3290         * search.c (get_dynamic_cast_base_type): Likewise.
3291
3292 2004-08-25  Zack Weinberg  <zack@codesourcery.com>
3293
3294         * class.c, search.c: Remove references to DWARF_DEBUG.
3295
3296 2004-08-25  Adam Nemet  <anemet@lnxw.com>
3297
3298         * repo.c (extract_string): Reset backquote after one character.
3299         (get_base_filename): Fix indentation.
3300
3301 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
3302
3303         * decl.c (cxx_init_decl_processing): Adjust
3304         build_common_tree_nodes call.
3305
3306 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
3307
3308         PR c++/16889
3309         * (is_subobject_of_p): Resurrect & optimize.
3310         (lookup_field_r): Use it.
3311
3312 2004-08-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3313
3314         PR c++/16706
3315         * search.c (friend_accessible_p): Increment processing_template_decl
3316         when deal with TEMPLATE_DECL of SCOPE.
3317
3318 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
3319
3320         PR c++/17149
3321         * semantics.c (check_accessibility_of_qualified_id): Defer check
3322         if qualifying_type is a template parameter.
3323
3324 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
3325
3326         PR c++/17163
3327         * pt.c (instantiate_decl): Do not try to apply
3328         DECL_DECLARED_INLINED_P to a VAR_DECL.
3329
3330         * search.c (build_baselink): Fix typo in comment.
3331
3332 2004-08-22 Andrew Pinski  <apinski@apple.com>
3333
3334         Revert:
3335         2004-08-22  Andrew Pinski  <apinski@apple.com>
3336         PR c++/14029
3337         * typeck.c (build_unary_op): Use &a.b if the folded lowered
3338         expression is not constant.
3339
3340 2004-08-23  Nathan Sidwell  <nathan@codesourcery.com>
3341
3342         * name-lookup.c (pushdecl): Rename build_type_copy call.
3343         * tree.c (cp_build_qualified_type_real,
3344         build_exception_variant, handle_java_interface_attribute): Likewise.
3345
3346 2004-08-22  Andrew Pinski  <apinski@apple.com>
3347
3348         PR c++/14029
3349         * typeck.c (build_unary_op): Use &a.b if the folded lowered
3350         expression is not constant.
3351
3352 2004-08-20  Mark Mitchell  <mark@codesourcery.com>
3353
3354         PR c++/17121
3355         * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
3356
3357 2004-08-21  Joseph S. Myers  <jsm@polyomino.org.uk>
3358
3359         PR c++/17120
3360         * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
3361         MODOP_EXPR.
3362
3363 2004-08-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3364
3365         * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
3366         before calling comp_template_args.
3367
3368 2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
3369
3370         * class.c (build_vtbl_initializer): Use build_int_cst for
3371         negative size types.
3372         * decl.c (complete_array_type): Likewise.
3373         * method.c (finish_thunk): Likewise.
3374
3375 2004-08-20  Andreas Tobler  <a.tobler@schweiz.ch>
3376
3377         * tree.c: Remove unused mark_local_for_remap_r.
3378
3379 2004-08-19  Eric Christopher  <echristo@redhat.com>
3380
3381         * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
3382         * tree.c (cxx_unsave_expr_now): Delete.
3383         (cp_unsave_r): Ditto.
3384
3385 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
3386
3387         PR c++/15890
3388         * pt.c (push_template_decl_real): Disallow template allocation
3389         functions with fewer than two parameters.
3390
3391 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
3392
3393         * cp-tree.h (build_shared_int_cst): Remove.
3394         * tree.c (shared_int_cache): Remove.
3395         (build_shared_int_cst): Remove.
3396         * class.c (finish_struct_1): Use build_int_cst.
3397
3398 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
3399
3400         * decl.c (finish_enum): Do not copy value node early, copy
3401         later.
3402         * lex.c (cxx_init): Force null_node to be unique.
3403
3404 2004-08-19  Joseph S. Myers  <jsm@polyomino.org.uk>
3405
3406         PR c++/17041
3407         * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
3408         from input for MODOP_EXPR.
3409
3410 2004-08-18  Mark Mitchell  <mark@codesourcery.com>
3411
3412         * pt.c (dependent_template_p): Fix typo in commment.
3413
3414         PR c++/17068
3415         * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
3416         dependent.
3417
3418 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
3419
3420         PR c++/16246
3421         * pt.c (unify): Tidy ARRAY_TYPE handling.  Make sure that non-type
3422         arguments have the same type as the corresponding parameter.
3423
3424         PR c++/16215
3425         * parser.c (cp_parser_name_lookup_error): If parser->object_scope
3426         is set use it for diagnostic purposes.
3427         (cp_parser_pseudo_destructor_name): Remove special-case error
3428         message.
3429
3430         PR c++/15871
3431         * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
3432
3433         PR c++/16965
3434         * cp-tree.h (qualified_name_lookup_error): Add parameter.
3435         * name-lookup.c (do_class_using_decl): Restrict set of entities