OSDN Git Service

PR c++/17743
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2007-09-18  Jason Merrill  <jason@redhat.com>
2
3         PR c++/17743
4         * pt.c (apply_late_template_attributes): Set processing_template_decl.
5         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
6         ATTR_FLAG_TYPE_IN_PLACE.
7         (tsubst): Do unqualified lookup to find typedefs from current class.
8         [ARRAY_TYPE]: Propagate alignment info.
9         * decl2.c (is_late_template_attribute): Only defer handling of
10         attribute aligned if the expression is dependent.
11         (save_template_attributes): If we're deferring any attributes,
12         make this a naming typedef.
13
14 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
15
16         PR c++/33462 (again)
17         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
18         va_arg instead of __builtin_va_arg.
19
20 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
21
22         PR c++/33462
23         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
24         (pp_cxx_primary_expression): Use it.
25         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
26         * error.c (dump_expr): Use it.
27
28 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
29
30         PR c++/33463
31         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
32         out case TYPEID_EXPR to...
33         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
34         and pp_cxx_right_paren.
35         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
36         * error.c (dump_expr): Use it.
37
38 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
39
40         PR c++/33464
41         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
42         (pp_cxx_primary_expression): Use it.
43         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
44         * error.c (dump_expr): Use it.
45
46 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
47
48         PR c++/33124
49         * init.c (build_new): Remove warning for zero-element
50         allocations.
51
52 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
53
54         PR c++/32756
55         * call.c (maybe_handle_implicit_object): Set this_p, clear
56         rvaluedness_matches_p.
57         (compare_ics): Do not compare rvaluedness matching when one of the
58         operands is an implicit object.
59
60 2007-09-14  Jason Merrill  <jason@redhat.com>
61
62         PR c++/17743, c++/19163
63         * decl2.c (is_late_template_attribute): New fn.
64         (splice_template_attributes, save_template_attributes): New fns.
65         (cplus_decl_attributes): Call save_template_attributes.
66         * pt.c (apply_late_template_attributes): New fn.
67         (instantiate_class_template, tsubst_decl): Use it.
68         * cp-tree.h: Declare is_late_template_attribute.
69
70 2007-09-13  Tom Tromey  <tromey@redhat.com>
71
72         * parser.c (cp_lexer_new_main): Don't use
73         c_lex_return_raw_strings.
74         (cp_lexer_get_preprocessor_token): Update.  Add special case when
75         lexer is NULL.
76
77 2007-09-11  Jan Hubicka <jh@suse.cz>
78
79         * method.c (use_thunk): Use tree_rest_of_compilation
80         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
81         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
82         * cp-tree.h (expand_body): Kill.
83         (emit_associated_thunks): Declare.
84         * semantics.c (emit_associated_thunks): Export.
85         (expand_body): Kill.
86
87 2007-09-09  David Daney  <ddaney@avtrex.com>
88
89         PR c++/33324
90         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
91         to calculate cookie_ptr.
92
93 2007-09-08  Jason Merrill  <jason@redhat.com>
94
95         PR c++/33342
96         * pt.c (most_specialized_class): Set processing_template_decl
97         while tsubsting partial spec args.
98
99 2007-09-06  Jason Merrill  <jason@redhat.com>
100
101         * decl2.c (get_guard): Copy visibility from the guarded variable.
102
103 2007-09-06  Jan Hubicka  <jh@suse.cz>
104
105         * semantics.c (expand_body): Do not mark arguments of clones used.
106
107 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
108
109         PR c++/32674
110         * decl.c (cp_finish_decl): When processing_template_decl,
111         deal correctly with init as TREE_LIST.
112
113 2007-09-06  Tom Tromey  <tromey@redhat.com>
114
115         * decl.c (finish_function): Put return's location on line zero of
116         file.
117
118 2007-09-05  Jason Merrill  <jason@redhat.com>
119
120         PR c++/15745
121         * except.c (prepare_eh_type): Use type_decays_to.
122
123         PR c++/15097
124         * init.c (build_delete): Use build_headof to get the address of the
125         complete object if we aren't using the deleting destructor.
126         * rtti.c (build_headof): No longer static.
127         * cp-tree.h: Declare it.
128
129 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
130
131         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
132         decl if a prototype for XX is provided with throw().
133
134         PR c++/33289
135         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
136         on __*_chk non-__builtin_* decls.
137
138 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
139
140         PR c++/30302
141         * semantics.c (finish_id_expression): Use context_for_name_lookup
142         insted of DECL_CONTEXT, to see through anonymous structs and unions.
143         * class.c (finish_struct_anon): Deal correctly with anonymous
144         structs (vs unions, as GNU extension) in error messages.
145
146 2007-09-05  Jan Hubicka  <jh@suse.cz>
147
148         * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
149         call, DECL_EXTERNAL checks and current_function_decl saving.
150
151 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
152
153         PR c++/29731 (again)
154         * parser.c (cp_parser_primary_expression): Return error_mark_node
155         when a statement-expression is found in a template-argument list.
156
157 2007-09-04  Jason Merrill  <jason@redhat.com>
158
159         * except.c (initialize_handler_parm): Use
160         fold_build_cleanup_point_expr.
161
162         PR c++/31419
163         * call.c (reference_binding): Don't look for user-defined conversions
164         to the same type.
165
166         PR c++/31411
167         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
168         the MUST_NOT_THROW_EXPR.
169
170 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
171
172         * decl.c (cp_finish_decl): Call determine_visibility before
173         make_rtl_for_nonlocal_decl.
174
175 2007-09-04  Jason Merrill  <jason@redhat.com>
176
177         PR c++/14032
178         * pt.c (most_specialized_class): Substitute outer template
179         arguments into the arguments of a member template partial
180         specialization.
181         (strip_innermost_template_args): New fn.
182
183 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
184
185         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
186
187 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
188
189         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
190         * decl.c (cp_make_fname_decl): Likewise,
191         * parser.c (cp_parser_string_literal): Likewise,
192         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
193         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
194         Likewise,
195
196 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
197
198         PR c++/33208
199         * typeck.c (build_unary_op): Fix error message for
200         Boolean expression as operand to operator--.
201
202 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
203
204         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
205         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
206         Likewise.
207
208 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
209
210         PR c++/32597
211         * init.c (build_default_init): Make extern.
212         * cp-tree.h (build_default_init): Declare here.
213         * pt.c (tsubst_expr): When the instantiation of the initializer of
214         a variable results in an empty list, default-initialize the
215         variable.
216         (tsubst_copy_and_build): When the instantiation of the initializer
217         in a new expression results in an empty initializer list,
218         default-initialize it.
219
220 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
221
222         * mangle.c (write_type): Change mangling of rvalue reference from
223         `RR' to `O'. 
224
225 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
226
227         * decl.c (duplicate_decls): Remove duplicated line.
228
229 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
230
231         PR c++/33210
232         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
233         BOUND_TEMPLATE_TEMPLATE_PARM.
234
235 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
236
237         PR c++/32113
238         * search.c (lookup_member): Check the name argument for
239         error_mark_node.
240
241 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
242
243         PR c++/33212
244         * parser.c (cp_parser_trait_expr): Check rerurn value of
245         cp_parser_type_id.
246
247 2007-08-30  Ollie Wild  <aaw@google.com>
248
249         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
250         convert_ptrmem for pointer to member conversions.
251         (convert_to_pointer_force): Update cp_convert_to_pointer call.
252         (ocp_convert): Update cp_convert_to_pointer call.
253         * typeck.c (convert_ptrmem): Add conditional for null pointers to
254         members.
255         (build_static_cast_1): Check can_convert for conversions in either
256         direction.
257         (get_delta_difference_1): New function.
258         (get_delta_difference): Refactor to call get_delta_difference_1.
259
260 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
261
262         * decl.c (start_preparsed_function): Set
263         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
264
265 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
266
267         PR c++/33209
268         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
269         BOUND_TEMPLATE_TEMPLATE_PARM.
270
271 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
272
273         PR c++/32596
274         PR c++/32400
275         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
276         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
277
278 2007-08-27  Jason Merrill  <jason@redhat.com>
279
280         PR c++/29000
281         * pt.c (build_non_dependent_expr, type_dependent_expression_p): 
282         Look inside STMT_EXPR.
283         * semantics.c (stmt_expr_value_expr): New fn.
284         * cp-tree.h: Declare it.
285
286         PR c++/28558
287         * decl.c (groktypename): Ignore attributes applied to class type.
288
289 2007-08-28  Richard Guenther  <rguenther@suse.de>
290
291         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
292
293 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
294         
295         * error.c (dump_expr): Handle COMPLEX_CST.
296         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
297         (pp_cxx_expression): Likewise.
298
299 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
300
301         * decl.c (GNU_INLINE_P): New.
302         (duplicate_decls): Handle gnu_inline.  Merge attributes and
303         some flags in overriding definitions.
304         (redeclaration_error_message): Handle gnu_inline.
305         (start_preparsed_function): Likewise.
306
307 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
308
309         * call.c (sufficient_parms_p): Constify.
310         * class.c (same_signature_p): Likewise.
311         * cp-gimplify.c (is_invisiref_parm,
312         cxx_omp_privatize_by_reference): Likewise.
313         * cp-objcp-common.c (has_c_linkage): Likewise.
314         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
315         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
316         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
317         num_artificial_parms_for, comp_template_parms,
318         template_parameter_pack_p, any_dependent_template_arguments_p,
319         any_type_dependent_arguments_p, any_value_dependent_elements_p,
320         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
321         zero_init_p, member_p, cp_lvalue_kind,
322         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
323         varargs_function_p, is_dummy_object, special_function_kind,
324         string_conv_p, type_unknown_p, comp_except_specs, compparms,
325         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
326         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
327         cp_has_mutable_p, at_least_as_qualified_p,
328         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
329         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
330         * except.c (nothrow_libfn_p): Likewise.
331         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
332         Likewise.
333         * pt.c (comp_template_parms, template_parameter_pack_p,
334         any_type_dependent_arguments_p, any_value_dependent_elements_p,
335         any_dependent_template_arguments_p): Likewise.
336         * repo.c (repo_export_class_p): Likewise.
337         * semantics.c (anon_aggr_type_p): Likewise.
338         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
339         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
340         varargs_function_p, member_p, is_dummy_object, pod_type_p,
341         zero_init_p, special_function_p): Likewise.
342         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
343         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
344         compparms, invalid_nonstatic_memfn_p,
345         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
346         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
347         cp_has_mutable_p, lvalue_or_else): Likewise.
348
349 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
350
351         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
352         * cp-objcp-common.c (cp_tree_size): Ditto.
353         * tree.c (cp_walk_subtrees): Ditto
354         * cp-tree.def (TINST_LEVEL): Go away.
355         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
356         move together with other non-tree structs.
357         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
358         (union lang_tree_node): Eliminate tinst_level field.
359         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
360         (current_instantiation, outermost_tinst_level): Return
361         a "struct tinst_level *".
362
363         * error.c (print_instantiation_partial_context): Change second
364         parameter to a "struct tinst_level *".  Replace accessor macros
365         with field access.
366         (print_instantiation_full_context): Likewise.
367         * lex.c (in_main_input_context): Likewise.
368
369         * pt.c (struct pending_templates): New.
370         (pending_templates, last_pending_template): Use it as a type.
371         (current_tinst_level): Change typo to "struct tinst_level *"
372         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
373         (add_pending_template): Construct a "struct pending_template".
374         Replace TINST_LEVEL accessor macros with field access.
375         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
376         (pop_tinst_level): Likewise.
377         (instantiate_pending_templates): Likewise.  Factor common code used
378         when an instantiation has been done.
379         (outermost_tinst_level): Replace tree_last with loop.
380         (current_instantiation): Return a "struct tinst_level *".
381
382 2007-08-24  Ollie Wild  <aaw@google.com>
383
384         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
385         * name-lookup.h (cp_binding_level): Remove vtables member.
386
387 2007-08-24  Richard Guenther  <rguenther@suse.de>
388
389         * tree.c (cp_cannot_inline_tree_fn): Remove.
390         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
391         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
392         Remove define.
393
394 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
395
396         PR c++/32567
397         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
398         error_mark_node right away if build_expr_type_conversion
399         returned it.
400
401         PR c++/32898
402         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
403         is error_mark_node rather than NULL_TREE.
404         * pt.c (check_explicit_specialization): Likewise.
405
406         PR c++/31941
407         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
408         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
409
410 2007-08-22  Jason Merrill  <jason@redhat.com>
411
412         PR c++/29365
413         * pt.c (outermost_tinst_level): New function.
414         * lex.c (in_main_input_context): New function.
415         * cp-tree.h: Declare it.
416         * decl2.c (constrain_class_visibility): Use it to avoid warning
417         about uses of the anonymous namespace in the main input file.
418
419 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
420
421         * init.c (build_new_1): Use get_target_expr instead of save_expr.
422
423 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
424
425         PR c++/7302
426         * class.c (finish_struct_1): Warn when a class has virtual
427         functions and accessible non-virtual destructor.
428
429 2007-08-20  Richard Guenther  <rguenther@suse.de>
430
431         PR c++/22369
432         PR c++/22451
433         * call.c (build_new_method_call): Convert initializer to
434         the basetype.
435         * init.c (build_aggr_init): Do not fiddle with types.
436         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
437         * except.c (build_throw): Do not drop qualifiers for the
438         pointer type.
439         * typeck.c (get_member_function_from_ptrfunc): Do not
440         fiddle with types, instead convert.
441         (build_ptrmemfunc1): Convert to the target type for
442         initialization.
443         (gfc_trans_allocate): Convert result to target type.
444         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
445         pointer-to-member structures shall have alias set zero as well.
446
447 2007-08-20  Richard Guenther  <rguenther@suse.de>
448
449         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
450         Remove.
451         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
452         (nonstatic_local_decl_p): Likewise.
453         * tree.c (cp_auto_var_in_fn_p): Remove.
454         * decl.c (nonstatic_local_decl_p): Remove.
455
456 2007-08-20  Richard Guenther  <rguenther@suse.de>
457
458         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
459         Remove define.
460         * tree.h (cp_walk_tree): New define to walk_tree_1 with
461         cp_walk_subtrees lh parameter.
462         (cp_walk_tree_without_duplicates): New define to
463         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
464         * tree.c (count_trees): Call
465         cp_walk_tree_without_duplicates.
466         (verify_stmt_tree): Call cp_walk_tree.
467         (break_out_target_exprs): Likewise.
468         (WALK_SUBTREE): Likewise.
469         * cp-gimplify.c (cp_genericize): Likewise.
470         * cp-pt.c (find_parameter_packs_r): Likewise.
471         (uses_parameter_packs): Likewise.
472         (make_pack_expansion): Likewise.
473         (check_for_bare_parameter_packs): Likewise.
474         (for_each_template_parm): Likewise.
475         * decl.c (check_default_argument): Call
476         cp_walk_tree_without_duplicates.
477         * except.c (build_throw): Likewise.
478         * decl2.c (type_visibility): Likewise.
479         * semantics.c (expand_or_defer_fn): Likewise.
480         (finalize_nrv): Call cp_walk_tree.
481
482 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
483
484         PR c++/33025
485         * init.c (build_new_1): Rename placement_var variable to placement_expr.
486         Initialize it with save_expr rather than get_temp_regvar.
487
488 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
489
490         PR c++/28989
491         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
492         lvalues.
493
494 2007-08-17  Ollie Wild  <aaw@google.com>
495
496         PR c++/31749
497         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
498         declarations into appropriate slots for comparison.  Fix type
499         comparison.
500
501 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
502
503         PR c++/32112
504         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
505         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
506
507 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
508
509         PR c++/32870
510         * parser.c (cp_parser_class_head): Improve error message.
511
512 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
513
514         * pt.c (instantiate_decl): Set input_location
515         for the function end.
516
517 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
518
519         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
520         Constify.
521         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
522         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
523         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
524         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
525         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
526         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
527         * typeck.c (cp_type_quals): Likewise.
528         * typeck2.c (cxx_incomplete_type_diagnostic,
529         cxx_incomplete_type_error): Likewise.
530
531 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
532
533         PR c++/31132
534         * pt.c (tsubst_friend_function): When check_classfn
535         returns error_mark_node likewise return it.
536
537 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
538
539         PR c++/32992
540         * typeck.c (check_return_expr): Don't NRV optimize vars in
541         anonymous unions.
542         * decl.c (finish_function): Comment fix.
543
544 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
545
546         PR c++/33035
547         * pt.c (push_template_decl_real): Depending on TYPE_P
548         use either TYPE_CONTEXT or DECL_CONTEXT.
549
550 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
551
552         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
553         constructors and destructors return this.
554
555 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
556
557         PR c++/27211
558         * decl2.c (check_classfn): Return error_mark_node in case of error;
559         in that case, do not call add_method.
560         * decl.c (start_decl): Deal with check_classfn returning
561         error_mark_node.
562         (grokfndecl): Likewise.
563         * pt.c (tsubst_friend_function): Likewise.
564
565 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
566
567         PR c++/30428
568         * typeck.c (build_binary_op): Disallow vector float types with
569         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
570
571 2007-08-11  Ian Lance Taylor  <iant@google.com>
572
573         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
574         alias_set_type.
575         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
576
577 2007-08-10  Ollie Wild  <aaw@google.com>
578
579         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
580         type lookups.
581         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
582         function parameter.
583         (unqualified_namespace_lookup): Fix ambiguous_decl call.
584         (lookup_using_namespace): Fix ambiguous_decl call.
585         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
586
587 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
588
589         * call.c (name_as_c_string): Use CONST_CAST.
590         * decl.c (build_decl): Likewise.
591         * parser.c (cp_parser_string_literal): Likewise.
592
593 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
594
595         PR c++/17763
596         * error.c (dump_expr): Consistently use the *_cxx_*
597         variants of the pretty-print functions.
598
599 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
600
601         PR c++/22256
602         * decl.c (check_special_function_return_type): Just error
603         on return type specified for conversion operator.
604
605 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
606
607         * typeck2.c (readonly_error): Handle general expressions.
608         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
609
610 2007-08-06  Dan Hipschman  <dsh@google.com>
611
612         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
613         access function name.
614
615 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
616
617         PR pch/13676
618         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
619         * g++spec.c (lang_specific_driver): Check them.
620
621 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
622
623         PR c++/19532
624         * pt.c (inline_needs_template_parms): Fix comment; change return type
625         to bool.
626
627 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
628
629         Revert:
630         2007-03-26  Dirk Mueller  <dmueller@suse.de>
631
632         * parser.c (cp_parser_member_declaration): Pedwarn
633         about stray semicolons after member declarations.
634
635 2007-08-02  Lee Millward  <lee.millward@gmail.com>
636
637         PR c++/30849
638         PR c++/30850
639         PR c++/30851
640         * parser.c (cp_parser_asm_definition): Detect and discard asm
641         statements with invalid inputs or outputs.
642         (cp_parser_asm_operand_list): Return error mark node if any
643         of the operands are invalid. Adjust documentation.
644         
645 2007-08-02  Nick Clifton  <nickc@redhat.com>
646
647         * typeck.c: Change copyright header to refer to version 3 of the
648         GNU General Public License and to point readers at the COPYING3
649         file and the FSF's license web page.
650         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
651         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
652         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
653         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
654         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
655         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
656         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
657         name-lookup.h, parser.c: Likewise.
658
659 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
660
661         PR middle-end/32668
662         * call.c (magic_varargs_p): Honor the "type generic" attribute.
663
664 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
665
666         PR c++/32108
667         * semantics.c (finish_label_stmt): Reject the __label__
668         extension outside function scopes.
669
670 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
671
672         * parser.c (eof_token): Un-constify.
673         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
674         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
675         casts.
676
677 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
678
679         * pt.c, tree.c, typeck2.c: Fix comment typos.
680
681 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
682             Mark Mitchell  <mark@codesourcery.com>
683
684         PR c++/30917
685         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
686         hidden due to friend declarations in local classes.
687
688 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
689
690         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
691         * cp-tree.def (DECLTYPE_TYPE): New.
692         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
693         (dump_type_prefix): Ditto.
694         (dump_type_suffix): Ditto.
695         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
696         * mangle.c (write_type): Handle DECLTYPE_TYPE.
697         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
698         types.
699         (DECLTYPE_TYPE_EXPR): New.
700         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
701         (finish_declared_type): Declare.
702         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
703         DECLTYPE_TYPE nodes.
704         (pp_cxx_type_id): Ditto.
705         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
706         (tsubst): Substitute into a DECLTYPE_TYPE node.
707         (tsubst_copy): Ditto.
708         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
709         nodes.
710         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
711         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
712         structural equality (because we can't hash the expressions).
713         (finish_declared_type): New.
714         * lex.c (reswords): Add "decltype" keyword.
715         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
716         (cp_parser_postfix_expression): Add member_access_only_p to
717         restrict postfix expression to member access expressions.
718         (cp_parser_unary_expression): Update call to
719         cp_parser_postfix_expression to reflect new parameter.
720         (cp_parser_declared_type): New.
721         (cp_parser_simple_type_specifier): Parse decltype types.
722
723 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
724
725         PR c++/32346
726         * call.c (convert_for_arg_passing): Only widen bitfields to their
727         declared types if necessary.
728
729 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
730
731         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
732         Constify.
733
734 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
735
736         * decl.c (typename_hash, typename_compare): Constify.
737         * mangle.c (hash_type, compare_type): Likewise.
738         * pt.c (eq_local_specializations, hash_local_specialization):
739         Likewise.
740         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
741         list_hash): Likewise.
742         * typeck2.c (pat_compare): Likewise.
743
744 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
745
746         * method.c (implicitly_declare_fn): Increase alignment if member
747         function pointer format requires it.
748
749 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
750
751         PR c++/29001
752         * typeck.c (check_return_expr): Do not pass a null argument
753         to null_ptr_cst_p.
754
755 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
756
757         PR c++/32561
758         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
759         only on VAR_DECL.
760
761 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
762
763         PR c++/32839
764         * typeck.c (convert_arguments): Only use default args if we have
765         a function decl.
766
767         PR c++/30818
768         * typeck.c (structural_comptypes): No need to check
769         resolve_typename_type return value here.
770         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
771         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
772         original type rather than error_mark_node in case of failure.
773         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
774         resolve_typename_type result check.
775         (cp_parser_direct_declarator, cp_parser_head,
776         cp_parser_constructor_declarator_p): Likewise.
777
778 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
779
780         * pt.c (template_parms_variadic_p): Remove.
781         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
782
783 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
784
785         PR c++/30854
786         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
787         argument to dump_aggr_init_expr_args instead of false.
788
789 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
790
791         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
792         canonical types; otherwise, fall back to structural type
793         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
794         internal compiler error if the canonical types are wrong.
795         
796 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
797
798         PR c++/32560
799         * parser.c (cp_parser_make_indirect_declarator): When the
800         the code argument is ERROR_MARK return cp_error_declarator.
801
802 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
803
804         PR 32617
805         * decl.c (cxx_init_decl_processing): Don't set
806         force_align_functions_log.
807         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
808         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
809         FUNCTION_DECL, return its alignment.
810
811 2007-07-09  Richard Guenther  <rguenther@suse.de>
812
813         * decl.c (start_preparsed_function): Do not promote return type.
814
815 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
816
817         PR c++/30535
818         * pt.c (unify): Never pass error_mark_node to template_decl_level.
819
820 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
821
822         PR c++/32232
823         * pt.c (resolve_overloaded_unification): Robustify.  Return a
824         bool, not an int.
825         (type_unification_real): Adjust accordingly.
826
827 2007-07-06  Richard Guenther  <rguenther@suse.de>
828
829         * init.c (build_new_1): Use the correct pointer type.
830         * typeck2.c (build_m_component_ref): Likewise.
831
832 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
833
834         PR c++/32245
835         * init.c (build_zero_init): Always build an initializer for
836         non-static storage.
837         * typeck2.c (build_functional_cast): Use build_zero_init.
838
839         PR c++/32251
840         * init.c (build_new_1): Always pass the allocation function to
841         build_op_delete_call.
842         * call.c (build_op_delete_call): Handle operator delete with a
843         variable-argument list.  Do not issue an error when no matching
844         deallocation function is available for a new operator.
845
846         PR c++/31992
847         * cp-tree.h (any_value_dependent_elements_p): Declare it.
848         * decl.c (value_dependent_init_p): New function.
849         (cp_finish_decl): Use it.
850         * pt.c (value_dependent_expression_p): Use
851         any_value_dependent_elements_p.
852         * parser.c (cp_parser_primary_expression): Add comment about
853         treating dependent qualified names as integral
854         constant-expressions.
855
856 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
857
858         * decl.c (build_ptrmemfunc_type): Always use structural equality
859         tests when comparing pointer-to-member-function types, because the
860         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
861         types.
862         
863 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
864
865         * init.c (build_new): Tweak comment.
866
867 2007-06-29  Dave Brolley  <brolley@redhat.com>
868
869         PR c++/31743
870         * parser.c (cp_parser_new_type_id): Don't reduce a named array
871         type to its base type and number of elements here.
872         * init.c (build_new): Call complete_type_or_else to ensure that the
873         type is complete and to issue a diagnostic if it is not.
874         (build_new_1): Don't call complete_type_or_else here.
875
876 2007-07-03  Richard Guenther  <rguenther@suse.de>
877
878         PR c++/32609
879         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
880         after recursing.
881
882 2007-07-02  Simon Baldwin  <simonb@google.com>
883
884         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
885         for inner-style nested forward declarations that don't declare
886         anything useful.
887
888 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
889
890         PR c++/31748
891         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
892         DECL_P in not a variable and appears more than once error messages.
893
894 2007-07-01  Ollie Wild  <aaw@google.com>
895
896         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
897         (select_decl): Remove function.
898         (unqualified_namespace_lookup): Populate binding by calling
899         ambiguous_decl.  Remove select_decl call.
900         (lookup_qualified_name): Remove select_decl call.
901         * decl.c (lookup_and_check_tag): Check for ambiguous references.
902         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
903         generation when name lookup is ambiguous.
904
905 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
906
907         PR c++/31724
908         * init.c (build_new_1): Use structural equality on the copy of the
909         array type.
910
911 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
912
913         * decl2.c (determine_visibility): Implement
914         flag_visibility_ms_compat effect on type info.
915         * decl.c (cxx_init_decl_processing): Implement
916         global effect of flag_visibility_ms_compat.
917
918 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
919
920         * decl2.c (start_objects): Mark constructor-running function
921         as artificial.
922
923 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
924
925         PR c++/32111
926         * decl.c (grokdeclarator): Reset friendp for member functions declared
927         friend of their own class.
928
929 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
930
931         * decl2.c (determine_visibility): Don't look for dllexport here.
932         (determine_visibility_from_class): Tidy.
933
934 2007-06-18  Simon Baldwin <simonb@google.com>
935
936         PR c++/31923
937         * parser.c (cp_parser_single_declaration): Added check for storage
938         class other than sc_none in parsed declaration, and a flag to indicate
939         if the call is part of an explicit template specialization parse.
940         * (cp_parser_explicit_specialization): Specialization check flag added
941         to call to cp_parser_single_declaration(), set true.
942         * (cp_parser_template_declaration_after_export): Specialization check
943         flag added to call to cp_parser_single_declaration(), set false.
944         * pt.c (check_explicit_specialization): Added code to copy visiblity
945         and linkage from the templated function to the explicit specialization.
946
947 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
948
949         * typeck.c (build_binary_op): For templates build the
950         expression in pieces to avoid the assert in build2_stat.
951         (get_member_function_from_ptrfunc):
952         Change over to using POINTER_PLUS_EXPR and convert
953         the second operand to sizetype.
954         * typeck2.c (build_m_component_ref):  Likewise.
955         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
956         instead of PLUS_EXPR for pointers.
957         (build_new_1): Likewise.
958         (build_vec_delete_1): Likewise.
959         (build_vec_delete): Likewise.
960         * class.c (build_base_path): Likewise.
961         (build_base_path): Likewise.
962         (convert_to_base_statically): Likewise.
963         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
964         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
965         instead of PLUS_EXPR.
966         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
967         instead of PLUS_EXPR for pointers.
968         * call.c (build_special_member_call): Likewise.
969         * rtti.c (build_headof): Likewise.
970         Use sizetype instead of ptrdiff_type_node.
971         (tinfo_base_init): Create a POINTER_PLUS_EXPR
972         instead of PLUS_EXPR for pointers.
973         * except.c (expand_start_catch_block):  Do a
974         NEGATIVE and then a POINTER_PLUS_EXPR instead
975         of a MINUS_EXPR.
976         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
977         PLUS_EXPR on pointer types over to use
978         POINTER_PLUS_EXPR and remove the conversion
979         to the pointer types.
980         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
981         adding to a pointer type. Use size_int instead of
982         ssize_int. Convert the index to sizetype before
983         adding it to the pointer.
984
985 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
986
987         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
988         (DECL_ANON_UNION_VAR_P): New macro.
989         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
990         than DECL_VAR_MARKED_P, to keep track of which variables we have
991         seen.
992         * decl.c (redeclaration_error_message): Complain about redeclaring
993         anonymous union members at namespace scope.
994         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
995
996 2007-06-14  Geoff Keating  <geoffk@apple.com>
997
998         * decl2.c (determine_visibility): Ensure that functions with
999         hidden types as parameters are hidden.
1000
1001         PR 31093
1002         * decl2.c (determine_visibility): Remove duplicate code for
1003         handling type info.
1004
1005 2007-06-12  Ian Lance Taylor  <iant@google.com>
1006
1007         PR libstdc++/29286
1008         * init.c (avoid_placement_new_aliasing): New static function.
1009         (build_new_1): Call it.
1010
1011 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
1012
1013         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1014         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1015
1016 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
1017
1018         PR c++/32177
1019         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1020         on init, the non-decl cond operand and increment value.
1021
1022 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
1023
1024         PR c++/30759
1025         * decl.c (check_initializer): Report an error when a brace enclosed
1026         initializer is used for a non-aggregate type in C++98.
1027         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1028         cxx_dialect.
1029         (grokdeclarator): Likewise.
1030         (move_fn_p): Likewise.
1031         * typeck.c (check_return_expr): Likewise.
1032         * call.c (reference_binding): Likewise.
1033         * error.c (cp_cpp_error): Likewise.
1034         * pt.c (check_default_tmpl_args): Likewise.
1035         (tsubst): Likewise.
1036         * lex.c (init_reswords): Likewise.
1037         * parser.c (p_parser_primary_expression): Likewise.
1038         (TOKEN_PRECEDENCE): Likewise.
1039         (cp_parser_init_declarator): Likewise.
1040         (cp_parser_ptr_operator): Likewise.
1041         (cp_parser_parameter_declaration): Likewise.
1042         (cp_parser_enclosed_template_argument_list): Likewise.
1043         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1044         (cp_parser_next_token_ends_template_argument_p): Likewise.
1045
1046 2007-06-04  Simon Baldwin  <simonb@google.com>
1047
1048         * decl.c (grokdeclarator): Readability change.  Moved case labels
1049         into direct switch statement scope.
1050
1051 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
1052
1053         * call.c (convert_like_real): Remove pointless code.
1054
1055 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
1056
1057         * decl.c (get_atexit_fn_ptr_type): New function.
1058         (get_atexit_node): Use it.
1059         (start_cleanup_fn): Likewise.
1060         (register_dtor_fn): Use the object's destructor, instead of a
1061         separate cleanup function, where possible.
1062         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1063         (atexit_fn_ptr_type_node): New macro.
1064         * decl2.c (build_cleanup): Use build_address.
1065
1066 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
1067
1068         * typeck.c (build_binary_op): Include types in error.
1069
1070 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
1071
1072         PR c++/31806
1073         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1074         needs runtime initialization.
1075
1076 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
1077
1078         PR c++/32158
1079         * semantics.c (finish_trait_expr): Complete the types.
1080
1081 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
1082             Douglas Gregor <doug.gregor@gmail.com>
1083             Pedro Lamarao <pedro.lamarao@mndfck.org>
1084             Howard Hinnant <howard.hinnant@gmail.com>
1085
1086         PR c++/7412
1087         PR c++/29939
1088         * typeck.c (comptypes): Don't consider rvalue and lvalue
1089         reference types to be equivalent.
1090         (check_return_expr): Move from certain lvalues when returning
1091         them.
1092         * decl.c (grokdeclarator): Implement reference collapsing.
1093         (copy_fn_p): Don't consider constructors taking rvalue references
1094         to be copy constructors.
1095         (move_fn_p): New.
1096         * call.c (conversion): New "rvaluedness_matches_p" member.
1097         (convert_class_to_reference): Require reference type as first
1098         parameter instead of base type.
1099         (reference_binding): Add logic to handle rvalue references.
1100         (implicit_conversion): Update inaccurate comment.
1101         (convert_like_real): Disable creation of temporaries that are
1102         impossible to initialize for types with move constructors.
1103         (build_over_call): Elide move constructors when possible.
1104         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1105         (maybe_handle_ref_bind): Return conversion instead of type node.
1106         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1107         determine preferred conversion sequences.
1108         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1109         (LOOKUP_PREFER_RVALUE): New.
1110         (DECL_MOVE_CONSTRUCTOR_P): New.
1111         (struct cp_declarator): Add "reference" member for reference
1112         types, with new "rvalue_ref" flag.
1113         (cp_build_reference_type): Declare.
1114         (move_fn_p): Declare.
1115         * error.c (dump_type_prefix): Format rvalue reference types
1116         correctly in error messages.
1117         * except.c (build_throw): Move from certain lvalues when
1118         throwing.
1119         * mangle.c (write_type): Mangle rvalue references differently
1120         than regular references.
1121         * parser.c (make_reference_declarator): Add boolean parameter for
1122         rvalue references.
1123         (cp_parser_make_indirect_declarator): New.
1124         (cp_parser_new_declarator_opt): Call
1125         cp_parser_make_indirect_declarator. 
1126         (cp_parser_conversion_declarator_opt): Ditto.
1127         (cp_parser_declarator): Ditto.
1128         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1129         declarators.
1130         * pt.c (tsubst): Implement reference collapsing.
1131         (maybe_adjust_types_for_deduction): Implement special template
1132         parameter deduction rule for rvalue references.
1133         (type_unification_real): Update calls to
1134         maybe_adjust_types_for_deduction.
1135         (try_one_overload): Ditto.
1136         (unify_pack_expansion): Ditto.
1137         * tree.c (lvalue_p_1): Handle rvalue reference types.
1138         (cp_build_reference_type): New.
1139
1140 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
1141
1142         PR c++/31809
1143         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1144         variables that need runtime initialization.
1145
1146 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
1147
1148         PR c++/31339
1149         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1150         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1151         case POSTDECREMENT_EXPR>): Return the error_mark_node
1152         if either the real or imaginary parts would an
1153         error_mark_node.
1154         
1155 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
1156             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1157
1158         PR c++/31745
1159         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1160         token is a closing brace, false if there are no tokens left.
1161         (cp_parser_namespace_alias_definition): Only consume the next token if
1162         it is a closing brace.
1163
1164         * parser.c (cp_parser_class_specifier): Likewise.
1165
1166 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1167
1168         * semantics.c (finish_member_declaration): Fix a typo in the
1169         last checkin.
1170
1171 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
1172
1173         PR c++/31431
1174         PR c++/31432
1175         PR c++/31434
1176         PR c++/31435
1177         PR c++/31437
1178         PR c++/31438
1179         PR c++/31442
1180         PR c++/31443
1181         PR c++/31444
1182         PR c++/31445
1183         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1184         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1185         * pt.c (check_for_bare_parameter_packs): Return bool indicated
1186         whether everything was okay. Fix indentation.
1187         (push_template_decl_real): Check for bare parameter packs in
1188         function parameters; where errors occur, mark the parameter types
1189         with ERROR_MARK_NODEs to avert ICEs.
1190         (coerce_template_parameter_pack): New.
1191         (coerce_template_parms): Moved parameter pack coercion into
1192         coerce_template_parameter_pack, and permit it anywhere in the
1193         template parameter list (not just at the end). Parameter and
1194         argument indices can vary (somewhat) separately now, so add
1195         PARM_IDX and ARG_IDX.
1196         (fn_type_unification): Don't set an argument pack as incomplete if
1197         no argument pack was deduced.
1198         (type_unification_real): If a type parameter is a parameter pack
1199         and has not otherwise been deduced, it will be deduced to an empty
1200         parameter pack.
1201         (more_specialized_fn): Use the actual lengths of the argument
1202         lists when comparing against expansions.
1203         * semantics.c (finish_member_declaration): If a field's type has
1204         bare parameter packs, error and set its type to ERROR_MARK_NODE.
1205
1206 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
1207
1208         PR target/27067
1209         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1210
1211 2007-05-22  Ollie Wild  <aaw@google.com>
1212
1213         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1214         (unqualified_namespace_lookup): Adds check for hidden types.
1215
1216 2007-05-22  Ollie Wild  <aaw@google.com>
1217
1218         * decl.c (duplicate_decls): Verify namespace names are unique.
1219
1220 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
1221
1222         * decl.c (cxx_maybe_build_cleanup): Handle
1223         __attribute__((cleanup)).
1224
1225 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1226
1227         * cvt.c (cp_convert_and_check): Don't check warnings if the
1228         conversion failed.
1229
1230 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
1231
1232         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1233
1234 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
1235
1236         PR c++/29928
1237         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1238         type only if is a class type (5.2.8/4).
1239
1240 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
1241
1242         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1243         * decl.c (grokdeclarator): Use unsigned_type_for instead of
1244         c_common_unsigned_type.
1245
1246 2007-05-11  Silvius Rus  <rus@google.com>
1247
1248         * cp/typeck.c (build_indirect_ref): Add call to
1249         strict_aliasing_warning.
1250         (build_reinterpret_cast_1): Condition call to
1251         strict_aliasing_warning. 
1252
1253 2007-05-11  Jan Hubicka  <jh@suse.cz>
1254
1255         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1256         * decl2.c (start_objects): ctors and dtors are no longer public.
1257         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1258         
1259 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1260
1261         * typeck.c (build_unary_op): Remove code that used to
1262         handle non lvalue increments/decrements.
1263
1264 2007-05-07  Mike Stump  <mrs@apple.com>
1265
1266         * parser.c (check_empty_body): Add.
1267         (cp_parser_iteration_statement): Add call to check_empty_body.
1268
1269 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
1270
1271         PR 31775
1272         * mangle.c (write_mangled_name): Mangle static variable names.
1273         (write_unqualified_name): Use local-source-name for
1274         namespace-scope static variables.
1275
1276 2007-05-04  Dirk Mueller  <dmueller@suse.de>
1277
1278         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1279         not in effect.
1280
1281 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
1282
1283         PR c++/31663
1284         * decl2.c (constrain_class_visibility): 
1285         Use strip_pointer_or_array_types instead of strip_array_types.
1286
1287 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1288
1289         PR C++/30221
1290         * decl.c (reshape_init_r): Don't reshape the first element if it
1291         is a pointer to member function.
1292
1293 2007-04-27  Simon Baldwin  <simonb@google.com>
1294
1295         * decl.c (grokparms): Changed message format from %qD to %qE.
1296
1297 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
1298
1299         * error.c (maybe_warn_variadic_templates): Variadic templates are
1300        now in C++0x, so only warn about them in C++98 mode.
1301         
1302 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1303
1304         PR C++/30016
1305         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1306         integeral types from vectors types.
1307
1308 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
1309
1310         PR c++/31598
1311         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1312         for type dependent OMP_CLAUSE_DECLs.
1313
1314 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
1315
1316         PR c++/31338
1317         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1318         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1319         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1320         * init.c (build_zero_init): Adjust, as
1321         COMPLEX_TYPE is now a SCALAR_TYPE.
1322         * typeck2.c (digest_init): Allow brace-enclosed initializers for
1323         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1324
1325 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
1326
1327         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1328         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1329         (trait_expr_value): Adjust.
1330
1331 2007-04-23  Simon Baldwin  <simonb@google.com>
1332
1333         * decl.c (grokparms): Added new error for duplicate function
1334         parameters names in function prototypes, to match gcc behavior.
1335
1336 2007-04-23  Jan Hubicka  <jh@suse.cz>
1337
1338         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1339         bits dirrectly.
1340
1341 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1342
1343         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1344         instead of checking GIMPLE_STMT_P in chain_next.
1345
1346 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
1347
1348         PR c++/31513
1349         * call.c (convert_for_arg_passing): Convert bitfields to their
1350         declared types.
1351
1352 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
1353
1354         PR c++/31517
1355         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1356
1357 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
1358
1359         PR c++/29365
1360         * cp/decl2.c (constrain_class_visibility):
1361         Do not warn about the use of anonymous namespace in the main input file.
1362
1363 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
1364
1365         * cp-tree.h (current_template_parms): Fix typo in comment.
1366
1367 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
1368
1369         * cp-tree.h, error.c: Fix comment typos.
1370
1371 2007-04-13  Jason Merrill  <jason@redhat.com>
1372
1373         PR c++/31074
1374         * call.c (reference_binding): Add c_cast_p parm.  If true,
1375         add quals to TO as needed to make it reference-compatible.
1376
1377 2007-04-11  Jan Hubicka  <jh@suse.cz>
1378
1379         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1380         that we are not processing template_decl.
1381
1382 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
1383
1384         PR c++/31449
1385         * class.c (build_base_path): Ensure that the converted pointer has
1386         the same cv-qualification as the input.
1387
1388 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
1389
1390         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1391
1392 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
1393
1394         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1395         Do not set it.
1396         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1397         * tree.c (cp_add_pending_fn_decls): Remove.
1398         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1399
1400 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
1401
1402         Revert change removing staticp.
1403
1404 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
1405
1406         * cp-objcp-common.c (cxx_staticp): Remove.
1407         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1408         * cp-tree.h (cxx_staticp):      
1409
1410 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
1411
1412         * class.c (check_for_override): Don't remove dllmport attribute
1413         of virtual methods.
1414
1415 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
1416
1417         PR c++/30847
1418         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1419         type issue error and return early.
1420
1421 2007-03-30  Jason Merrill  <jason@redhat.com>
1422
1423         PR c++/31187
1424         * typeck.c (cp_type_readonly): New fn.
1425         * cp-tree.h: Declare it.
1426         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1427         (cp_finish_decl): Not here.
1428
1429 2007-03-31  Richard Guenther  <rguenther@suse.de>
1430
1431         * optimize.c (maybe_clone_body): Replace splay-tree usage by
1432         pointer-map.
1433
1434 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
1435
1436         PR c++/31138
1437         PR c++/31140
1438         PR c++/31141
1439         * parser.c (declarator_can_be_parameter_pack): New.
1440         (cp_parser_template_parameter): Only parse the `...' if the
1441         declarator can be a parameter pack.
1442         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1443         is NULL.
1444         * pt.c (find_parameter_packs_r): Look into the bounds on integer
1445         types (they could be used as array bounds). 
1446         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1447         (tsubst_pack_expansion): Handle failure to expand parameter
1448         packs.
1449         
1450 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
1451
1452         PR c++/26099
1453         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1454         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1455         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1456         (CLASS_TYPE_NON_UNION_P): Add.
1457         (struct lang_type_class): Add has_complex_dflt.
1458         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1459         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1460         * cp-tree.def: Add TRAIT_EXPR.
1461         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1462         * lex.c (struct resword): Add __has_nothrow_assign,
1463         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1464         __has_trivial_constructor, __has_trivial_copy,
1465         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1466         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1467         __is_pod, __is_polymorphic, __is_union.
1468         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1469         (cp_parser_trait_expr): New.
1470         * semantics.c (finish_trait_expr, trait_expr_value
1471         classtype_has_nothrow_copy_or_assign_p): New.
1472         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1473         as static.
1474         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1475         * class.c (check_bases, check_field_decl, check_bases_and_members):
1476         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1477         * pt.c (uses_template_parms, tsubst_copy_and_build,
1478         value_dependent_expression_p, type_dependent_expression_p): Deal with
1479         TRAIT_EXPR.
1480         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1481
1482 2007-03-29  Richard Guenther  <rguenther@suse.de>
1483
1484         * tree.c (cp_walk_subtrees): Do not set input_location.
1485
1486 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
1487
1488         PR c++/29077
1489         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1490         destructor.
1491
1492 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1493
1494         * parser.c (struct cp_parser): Update comment for
1495         greater_than_is_operator_p.
1496         (cp_parser_primary_expression): In C++0x mode, a cast operator can
1497         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1498         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1499         !GREATER_THAN_IS_OPERATOR_P.
1500         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1501         `>>' operators that will become two `>' tokens in C++0x.
1502         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1503         mode, allowing it to terminate default arguments.
1504         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1505         `>>' like two consecutive `>' tokens.
1506         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1507         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1508         ends a template argument.
1509
1510 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
1511
1512         * decl.c (redeclaration_error_message): Complain when redeclaring
1513         a friend function with default template arguments (C++0x mode only).
1514         * cp-tree.h (check_default_tmpl_args): Declare.
1515         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1516         template arguments in function templates. Add support for checking
1517         the default template arguments of friend templates.
1518         (push_template_decl_real): Fix call to check_default_tmpl_args.
1519         (type_unification_real): If a template parameter has not been
1520         deduced but provides a default template argument, substitute into
1521         that default template argument.
1522         * parser.c (cp_parser_init_declarator): When declaring (but not
1523         defining!) a function template in C++0x mode, check for default
1524         template arguments.
1525
1526 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1527
1528         PR c++/29993
1529         * decl.c (grokdeclarator): Deal with cv-qualified function type
1530         typedefs in the same way for member and non-member functions.
1531
1532 2007-03-26  Dirk Mueller  <dmueller@suse.de>
1533
1534         * parser.c (cp_parser_member_declaration): Pedwarn
1535         about stray semicolons after member declarations.
1536
1537 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
1538
1539         PR c++/30500
1540         * pt.c (instantiate_decl): Set in_system_header.
1541
1542 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
1543
1544         * cp-tree.h (current_tempalte_parms): Improve documentation.
1545         * pt.c (current_template_args): Likewise.
1546
1547         PR c++/30863
1548         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1549         not consume tokens when failing.
1550
1551 2007-03-22  Jim Wilson  <wilson@specifix.com>
1552             Mark Mitchell  <mark@codesourcery.com>
1553
1554         PR c++/31273
1555         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
1556         consistent with FROM.
1557
1558 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1559
1560         * error.c (dump_expr): Handle dependent names that designate types.
1561         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1562
1563 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
1564
1565         * cp-tree.def, parser.c, pt.c: Fix comment typos.
1566
1567 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1568
1569         * cvt.c (cp_convert_and_check) : Define.
1570         * cp-tree.h (cp_convert_and_check): Declare.
1571         * call.c (convert_conversion_warnings): Rename to
1572         conversion_null_warnings.  The warning for floating-point to
1573         integer is handled by convert_and_check in convert_like_real.
1574         (convert_like_real): convert_conversion_warnings was renamed as
1575         conversion_null_warnings.
1576         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1577         overflow and changes of value during conversion.
1578
1579 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1580
1581         PR c++/30891
1582         * parser.c (cp_parser_statement): If 'namespace' is found, this
1583         only can be a namespace alias definition, so parse it now.
1584         (cp_parser_namespace_alias_definition): if we find an open brace
1585         instead of '=', then this is actually a misplaced namespace
1586         definition.
1587         
1588 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1589
1590         PR c++/24924
1591         * decl.c (cxx_init_decl_processing): Move command-line options
1592         processing to c-opts.c.
1593         
1594 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
1595
1596         * ptree.c (cxx_print_type): Use formatting markup for integers
1597         when printing template parameter index/level/orig level.
1598         (cxx_print_xnode): Ditto.
1599         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1600         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1601         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1602         HOST_WIDE_INTs.
1603         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1604         rather than a HOST_WIDE_INT.
1605         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1606         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1607         better bit-packing.
1608         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1609         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1610         IN_BASE_INITIALIZER bool bitfields.
1611         (struct cp_declarator): Make KIND a 4-bit field. Make
1612         PARAMETER_PACK_P a bool bitfield just after KIND.
1613         * pt.c (uses_parameter_packs): Destroy the pointer set.
1614         (make_pack_expansion): Ditto.
1615         (check_for_bare_parameter_packs): Ditto.
1616         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1617         
1618 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1619
1620         PR c++/31165
1621         * call.c  (convert_default_arg): Instead of copying the node,
1622         unshare it.
1623
1624 2007-03-15  Dirk Mueller  <dmueller@suse.de>
1625
1626         PR c++/30860
1627         * call.c (convert_conversion_warnings): New..
1628         (convert_like_real): .. factored out from here.
1629         (convert_conversion_warnings): Add warning about
1630         false being converted to NULL in argument passing.
1631
1632 2007-03-14  Dirk Mueller  <dmueller@suse.de>
1633
1634         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1635         (finish_do_body): Warn about empty body in do/while statement.
1636
1637 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1638
1639         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1640         
1641 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1642
1643         PR c/21438
1644         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1645         warning.
1646         
1647 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
1648
1649         * cp/repo.c (init_repo): Initialize random_seed saved options.
1650         (finish_repo): Adjust.
1651
1652 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
1653
1654         PR bootstrap/30899
1655         * Make-lang.in (doc/g++.1): Use $< to specify the location from
1656         which to copy.
1657
1658 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
1659
1660         * decl.c (compute_array_index_type): New warning flag warn_vla.
1661
1662 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
1663
1664         PR c++/30108
1665         * call.c (convert_default_arg): Copy non-constant arguments.
1666
1667 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
1668
1669         PR c++/31038
1670         * parser.c (cp_parser_postfix_expression): Disallow compound
1671         literals in constant expressions.
1672
1673         PR c++/30328
1674         * semantics.c (finish_typeof): Use unlowered_expr_type.
1675         
1676 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
1677
1678         PR c++/30274
1679         * cp-tree.h (unlowered_expr_type): New function.
1680         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1681         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1682         (unlowered_expr_type): New function.
1683         (build_unary_op): Disallow predecrements of bool bitfields.
1684         * call.c (build_conditional_expr): Use unlowered_expr_type.
1685         * pt.c (type_unification_real): Likewise.
1686
1687 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
1688
1689         PR c++/20599
1690         * typeck.c (check_return_expr): Check for bare parameter packs.
1691         (comptypes): Compare template parameter packs and
1692         type pack expansions.
1693         * decl.c (grokdeclarator): Deal with the declaration of function
1694         parameter packs.
1695         (grokparms): Verify that the (optional) function parameter pack is
1696         at the end of the parameter list.
1697         (xref_basetypes): Handle pack expansions in the base class.
1698         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1699         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1700         (NONTYPE_ARGUMENT_PACK): New.
1701         (TYPE_PACK_EXPANSION): New.
1702         (EXPR_PACK_EXPANSION): New.
1703         (ARGUMENT_PACK_SELECT): New.
1704         * cp-objcp-common.c (cp_tree_size): Compute size of
1705         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1706         ARGUMENT_PACK_SELECT.
1707         * error.c (dump_template_argument): Print template argument packs.
1708         (dump_template_argument_list): Ditto.
1709         (dump_template_parameter): Dump `...' for template type parameter
1710         packs.
1711         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1712         (dump_parameters): Print function parameter packs.
1713         (dump_template_parms): Print template argument packs.
1714         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1715         (maybe_warn_variadic_templates): New.
1716         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1717         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1718         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1719         CAST_EXPR. 
1720         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1721         (write_template_arg): Write argument packs as separate arguments.
1722         * cp-tree.h (struct template_parm_index_s): Add flag that
1723         indicates that the template parameter is actually a parameter
1724         pack.
1725         (struct tree_argument_pack_select): New.
1726         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1727         (union lang_tree_node): Add argument_pack_select.
1728         (FUNCTION_PARAMETER_PACK_P): New.
1729         (PACK_EXPANSION_P): New.
1730         (PACK_EXPANSION_PATTERN): New.
1731         (SET_PACK_EXPANSION_PATTERN): New.
1732         (PACK_EXPANSION_PARAMETER_PACKS): New.
1733         (ARGUMENT_PACK_P): New.
1734         (ARGUMENT_PACK_ARGS): New.
1735         (SET_ARGUMENT_PACK_ARGS): New.
1736         (ARGUMENT_PACK_INCOMPLETE_P): New.
1737         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1738         (TEMPLATE_PARM_PARAMETER_PACK): New.
1739         (TEMPLATE_TYPE_PARAMETER_PACK): New.
1740         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1741         (ARGUMENT_PACK_SELECT_INDEX): New.
1742         (ARGUMENT_PACK_SELECT_ARG): New.
1743         (struct cp_declarator): Add parameter_pack_p flag.
1744         (maybe_warn_variadic_templates): Declare.
1745         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1746         indicate a template parameter pack. 
1747         (uses_parameter_packs): Declare.
1748         (template_parameter_pack_p): Declare.
1749         (template_parms_variadic_p): Declare.
1750         (make_pack_expansion): Declare.
1751         (check_for_bare_parameter_packs): Declare.
1752         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1753         sizeof... expressions. 
1754         (pp_cxx_expression): Print pack expansions and non-type argument
1755         packs.
1756         (pp_cxx_exception_specification): Print pack expansions. 
1757         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1758         (pp_cxx_ctor_initializer): Print pack expansions.
1759         (pp_cxx_type_id): Print pack expansions.
1760         (pp_cxx_template_argument_list): Print argument packs.
1761         (pp_cxx_template_parameter): Print ellipsis for template parameter
1762         packs.
1763         * pt.c (comp_template_parms): Compare template parameter packs.
1764         (template_parameter_pack_p): New.
1765         (template_parms_variadic_p): New.
1766         (template_args_variadic_p): New.
1767         (make_ith_pack_parameter_name): New.
1768         (struct find_parameter_pack_data): New.
1769         (find_parameter_packs_r): New.
1770         (uses_parameter_packs): New.
1771         (make_pack_expansion): New.
1772         (check_for_bare_parameter_packs): New.
1773         (expand_template_argument_pack): New.
1774         (reduce_template_parm_level): Propagate parameter pack flag.
1775         (process_template_parm): Add is_parameter_pack parameter to state
1776         when the parameter is actually a parameter pack. Create template
1777         parameter packs when is_parameter_pack is true.
1778         (current_template_args): The argument for a template parameter
1779         pack is an argument pack containing a single pack expansion.
1780         (process_partial_specialization): When checking that non-type
1781         argument expressions do not involve template parameters, loop over
1782         the arguments in argument packs separately.
1783         (push_template_decl_real): Check that the type of the declaration
1784         does not have any bare parameter packs. Check that primary
1785         templates have no more than one parameter pack, and that it comes
1786         at the end of the template parameter list.
1787         (convert_template_argument): Handle coercions for pack expansion
1788         expressions by coercing the pattern then rebuilding the expansion.
1789         (coerce_template_parms): When coercing the arguments for a
1790         variadic template, pack "extra" arguments into an argument pack.
1791         (coerce_template_template_parms): Cannot coerce between parameter
1792         packs and non-pack parameters.
1793         (template_args_equal): Compare PACK_EXPANSION_P expressions.
1794         (comp_template_args): Expand all template arguments packs before
1795         comparing template argument lists.
1796         (mangle_class_name_for_template): Make argument packs as separate
1797         template arguments.
1798         (for_each_template_parm_r): No need to handle BASELINK. 
1799         (instantiate_class_template): Handle pack expansions in the base
1800         class list.
1801         (tsubst_pack_expansion): New.
1802         (tsubst_template_args): Handle substitutions of argument packs and
1803         pack expansion into template argument lists.
1804         (tsubst_decl): Expand function parameter packs into separate
1805         function parameters.
1806         (tsubst_arg_types): Expand a type pack expansion into separate
1807         argument types.
1808         (tsubst_exception_specification): Handle pack expansions in
1809         exception specifiers.
1810         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
1811         replacing a template parameter with its argument. If we encounter
1812         a substitution for an argument pack, just return the parameter
1813         itself. 
1814         (tsubst_copy): sizeof(X...) returns the number of elements in
1815         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
1816         PARM_DECL is a parameter pack.
1817         (tsubst_expr): Expression pack expansions and argument packs
1818         cannot show up here; they will all be handled through function
1819         calls, sizeof, and template argument lists.
1820         (tsubst_copy_and_build): sizeof(X...) returns the number of
1821         elements in parameter pack X.  Handle pack expansions in TREE_LIST
1822         and CONSTRUCTOR nodes.
1823         (fn_type_unification): Handle "incomplete" explicit template
1824         argument lists that specify some of the arguments for a template
1825         parameter pack.
1826         (type_unification_real): Unify arguments against pack expansions.
1827         (template_parm_level_and_index): New, helper function.
1828         (unify_pack_expansion): New.
1829         (unify): Unify argument packs on an argument-by-argument basis,
1830         handling variadic argument packs as well.
1831         (more_specialized_fn): Handle unification of function parameter
1832         packs. All things being equal, prefer non-variadic function
1833         templates to variadic function templates.
1834         (more_specialized_class): Prefer the variadic class template
1835         partial specialization that binds fewer arguments to a parameter
1836         pack.
1837         (regenerate_decl_from_template): Expand function parameter packs
1838         into separate parameters.
1839         (instantiate_decl): Ditto.
1840         (tsubst_initializer_list): Handle pack expansions for base-class
1841         initializers.
1842         (dependent_type_p_r): Determine dependent types in argument packs
1843         and pack expansions.
1844         (value_dependent_expression_p): Determine value-dependence of
1845         non-type argument packs.
1846         (dependent_template_arg_p): Handle argument packs.
1847         * semantics.c (finish_cond): Check for bare parameter packs.
1848         (finish_expr_stmt): Ditto.
1849         (finish_for_expr): Ditto.
1850         (finish_switch_cond): Ditto.
1851         (finish_mem_initializers): Ditto.
1852         * name-lookup.c (arg_assoc_type): Handle pack expansions and
1853         argument packs.
1854         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1855         * parser.c (make_declarator): Declarator is not an expansion.
1856         (make_pointer_declarator): Transfer parameter pack flag to outer
1857         declarator.
1858         (make_reference_declarator): Ditto.
1859         (make_ptrmem_declarator): Ditto.
1860         (make_call_declarator): Ditto.
1861         (make_array_declarator): Ditto.
1862         (cp_parser_postfix_expression): Allow pack expansion expressions
1863         in the argument list for a call expression.
1864         (cp_parser_parenthesized_expression_list): Add new parameter
1865         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1866         into separate arguments."
1867         (cp_parser_new_placement): Allow pack expansion expressions.
1868         (cp_parser_new_initializer): Ditto.
1869         (cp_parser_mem_initializer_list): Allow ellipsis to create a
1870         base-class initializer expansion.
1871         (cp_parser_mem_initializer): Ditto.
1872         (cp_parser_template_parameter_list): Keep track of whether the
1873         template parameter is a template parameter pack.
1874         (cp_parser_template_parameter): Parse the ellipsis to indicate a
1875         template parameter pack.
1876         (cp_parser_type_parameter): Ditto.
1877         (cp_parser_template_argument_list): Parse the ellipsis to indicate
1878         a pack expansion.
1879         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1880         this declarator is a parameter pack.
1881         (cp_parser_parameter_declaration): The ellipsis does not end the
1882         parameter declaration, because it might be a parameter pack. Parse
1883         the ellipsis to indicate a parameter pack.
1884         (cp_parser_initializer): Allow pack expansions.
1885         (cp_parser_initializer_list): Allow ellipsis to create an
1886         initializer expansion.
1887         (cp_parser_base_clause): Allow ellipsis to create a base specifier
1888         expansion.
1889         (cp_parser_type_id_list): Allow ellipsis to create an exception
1890         specifier expansion.
1891         (cp_parser_attribute_list): Don't allow pack expansions.
1892         (cp_parser_functional_cast): Allow pack expansions.
1893         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1894         compute the length of a parameter pack.
1895         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1896         end a template argument.
1897         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1898         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1899         CAST_EXPR. 
1900
1901 2007-03-09  Dirk Mueller  <dmueller@suse.de>
1902
1903         * cp/call.c (build_new_op): Call warn_logical_operator.
1904
1905 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
1906
1907         PR c++/30852
1908         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1909
1910         PR c++/30534
1911         * pt.c (any_template_arguments_need_structural_equality_p):
1912         Robustify.
1913
1914 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
1915
1916         * decl.c (grokdeclarator): Disable warnings for anonymous
1917         bitfields.
1918
1919 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
1920
1921         * typeck2.c (readonly_error): Always emit a hard error.
1922         Remove last argument.
1923         * cp-tree.h (readonly_error): Adjust prototype.
1924         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1925         * typeck.c (build_unary_op): Likewise.
1926         (build_modify_expr): Likewise.
1927
1928 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
1929
1930         PR c++/30895
1931         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1932
1933 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1934
1935         PR c++/15787
1936         * parser.c (struct cp_parser): New IN_IF_STMT.
1937         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1938         returning if parsing the body of an 'if' statement or issuing an
1939         error and continuing.
1940         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1941         body of 'if'.
1942         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1943         
1944 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
1945
1946         PR c++/28253
1947         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1948         for thunks.
1949
1950 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
1951
1952         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1953         Objective-C++.  Don't exit early if -shared-libgcc needs to be
1954         added.
1955
1956 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1957
1958         * typeck.c (common_base_type): Delete unused function.
1959         
1960 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
1961
1962         * Make-lang.in: Add dummy lang.install-pdf target.
1963
1964 2007-03-01  Simon Baldwin <simonb@google.com>
1965
1966         PR c++/23689
1967         * decl.c (check_tag_decl): Added new warning for typedef ignored
1968         when it precedes an otherwise valid non-typedef declaration.
1969
1970 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
1971
1972         * typeck.c (build_function_call): Store converted arguments
1973         in a stack-allocated array instead of building a list.
1974         (convert_arguments): Store arguments in the array passed in as an
1975         argument, and return the actual number of arguments.
1976         * call.c (build_call): Delete, and replace with...
1977         (build_call_n, build_call_a): New.
1978         (build_op_delete_call): Rewrite to avoid constructing argument lists.
1979         (build_over_call): Store converted arguments in a stack-allocated
1980         array instead of building a list.
1981         (build_cxx_call): Pass arguments in an array instead of as a list.
1982         (build_java_interface_fn_ref): Rewrite to avoid constructing
1983         argument lists.
1984         * tree.h: Update declarations to reflect above changes.
1985         * method.c (use_thunk): Use a stack-allocated array to hold
1986         the arguments instead of a list.
1987         * rtti.c (throw_bad_cast): Update call to cxx_call.
1988         (throw_bad_typeid): Likewise.
1989         (build_dynamic_cast_1): Likewise.
1990         * init.c (build_builtin_delete_call): Use build_call_n.
1991         * decl.c (expand_static_init): Likewise.
1992         * except.c (cp_protect_cleanup_actions): Likewise.
1993         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1994         (gimplify_must_not_throw_expr): Likewise.
1995         (cxx_omp_apply_fn): Use build_call_a.
1996
1997 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
1998
1999         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2000         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2001
2002 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
2003
2004         * cp-tree.h (static_ctors): Remove.
2005         * cp-tree.h (static_dtors): Likewise.
2006         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2007         refactoring of tree_map hierarchy.
2008         (decl_shadowed_for_var_insert): Likewise.
2009         * semantics.c (expand_body): Use c_expand_body.
2010         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2011         * decl2.c (static_ctors): Remove.
2012         (static_dtors): Likewise.
2013         (generate_ctor_or_dtor_function): Pass NULL_TREE to
2014         objc_generate_static_init_call.  Do not call static_[cd]tors.
2015         (generate_ctor_and_dtor_functions_for_priority): Do not check for
2016         static_[cd]tors.
2017         (cp_write_global_declarations): Likewise.
2018
2019 2007-02-23  Richard Guenther  <rguenther@suse.de>
2020
2021         * class.c (note_name_declared_in_class): Make declaration
2022         changes meaning a pedwarn.
2023
2024 2007-02-22  Michael Matz  <matz@suse.de>
2025
2026         PR c++/29433
2027         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2028         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2029         dump_function_decl): Guard emitting outer scopes by new flag.
2030         * cp-lang.c (cxx_dwarf_name): New function.
2031         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2032         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2033         Remove functions.
2034         (push_template_decl_real, lookup_template_class): Remove calls
2035         to above functions.
2036
2037 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
2038
2039         * call.c (build_new_method_call): Ensure that explicit calls of
2040         destructors have type "void".
2041
2042 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2043
2044         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2045         and -Walways-true with -Waddress.
2046         * cvt.c (convert_to_void): Replace unconditional warning with
2047         -Waddress.
2048
2049 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
2050
2051         * decl.c, tree.c: Fix comment typos.
2052
2053 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2054
2055         PR C++/30158
2056         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
2057         statement expression if we had an error mark node.
2058
2059 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
2060             Brooks Moses  <brooks.moses@codesourcery.com>
2061             Lee Millward  <lee.millward@codesourcery.com>
2062
2063         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2064         Change class to tcc_vl_exp.
2065
2066         * call.c (build_call): Use build_call_list instead 
2067         of build3. 
2068         (build_over_call): Likewise.
2069         (build_new_method_call): Use build_min_non_dep_call_list 
2070         instead of build_min_non_dep.
2071
2072         * error.c (dump_call_expr_args): New function.
2073         (dump_aggr_init_expr_args): New function.
2074         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
2075         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2076
2077         * cvt.c (convert_to_void): Use build_call_array instead
2078         of build3; use new AGGR_INIT_EXPR accessor macros.
2079
2080         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2081         instead of TREE_CODE_LENGTH.
2082
2083         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2084         AGGR_INIT_EXPR accessor macros.
2085
2086         * cp-gimplify.c (cp_gimplify_init_expr): Use 
2087         AGGR_INIT_EXPR_SLOT to set the slot operand.
2088
2089         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2090         (AGGR_INIT_EXPR_SLOT): New macro.
2091         (AGGR_INIT_EXPR_ARG): New macro.
2092         (aggr_init_expr_nargs): New macro.
2093         (AGGR_INIT_EXPR_ARGP): New macro.
2094         (aggr_init_expr_arg_iterator): New.
2095         (init_aggr_init_expr_arg_iterator): New.
2096         (next_aggr_init_expr_arg): New.
2097         (first_aggr_init_expr_arg): New.
2098         (more_aggr_init_expr_args_p): New.
2099         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2100         (stabilize_aggr_init): New declaration.
2101         (build_min_non_dep_call_list): Likewise.
2102
2103         * tree.c (process_aggr_init_operands): New function.
2104         (build_aggr_init_array) New function.
2105         (build_cplus_new): Update to use new CALL_EXPR and
2106         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2107         build_aggr_init_array.
2108         (build_min_non_dep_call_list) New function.
2109         (build_min_nt): Assert input code parameter is not a variable
2110         length expression class.
2111         (build_min, build_min_non_dep): Likewise.
2112         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2113         to check for equality instead of recursing. Handle tcc_vl_exp
2114         tree code classes.
2115         (stabilize_call): Update to only handle CALL_EXPRs, not 
2116         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2117         (stabilize_aggr_init): New function.
2118         (stabilize_init): Use it.
2119
2120         * cxx-pretty-print.c (pp_cxx_postfix_expression)
2121         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2122         AGGR_INIT_EXPR accessor macros and argument iterators.
2123         
2124         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2125         build_vl_exp. Iterate through the operands, recursively 
2126         processing each one.
2127         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2128         CALL_EXPR accessor macros.
2129         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2130         tree code classes. Use TREE_OPERAND_LENGTH instead of 
2131         TREE_CODE_LENGTH.
2132
2133         * semantics.c (finish_call_expr): Use build_nt_call_list
2134         instead of build_nt.
2135         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
2136         accessor macros. Use build_call_array to construct the 
2137         CALL_EXPR node instead of build3
2138         
2139         * decl2.c (build_offset_ref_call_from_tree): Use 
2140         build_nt_call_list and build_min_non_dep_call_list instead
2141         of build_min_nt and build_min_non_dep.
2142
2143         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2144         Use build_nt_call_list instead of build_min_nt.
2145
2146 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2147
2148         PR c++/28943
2149         * call.c (build_conditional_expr): Improve error message.
2150         
2151 2007-02-13  Dirk Mueller  <dmueller@suse.de>
2152
2153         * friend.c (do_friend): Annotate warning about friend
2154         declarations in templates with OPT_Wnon_template_friend.
2155         Convert informal message from warning() to inform().
2156
2157 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
2158             Mark Mitchell  <mark@codesourcery.com>
2159
2160         PR c++/14622
2161         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2162         instantiations for variables.
2163
2164 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2165
2166         PR middle-end/7651
2167         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2168         Check warn_unused_value just once.
2169
2170 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
2171
2172         PR c++/26988
2173         * pt.c (determine_specialization): Use skip_artificial_parms_for.
2174         (fn_type_unificiation): Likewise.
2175         (get_bindings): Likewise.
2176
2177 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
2178
2179         PR target/29487
2180         * decl.c (finish_function): Use DECL_REPLACEABLE.
2181         * tree.c (cp_cannot_inline_tree_fn): Likewise.
2182
2183 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2184
2185         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2186
2187 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
2188
2189         * decl.c (grokvardecl): Don't error if !have_tls.
2190         (grokdeclarator): Likewise.
2191         * parser.c (cp_parser_omp_threadprivate): Likewise.
2192
2193 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
2194
2195         PR c++/30703
2196         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2197         parameters and result decls in omp clauses.
2198         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2199         by reference.
2200
2201 2007-02-05  Dirk Mueller  <dmueller@suse.de>
2202
2203         PR bootstrap/30510
2204         * parser.c (cp_parser_class_specifier): Always initialize bases.
2205
2206 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
2207
2208         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2209         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2210         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2211         expressions.
2212         * semantics.c (finish_omp_atomic): Store a whole expression node
2213         in operand 1, and integer_zero_node in operand 0, for dependent
2214         OMP_ATOMIC.  Rewrite to make flow easier to understand.
2215
2216 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2217
2218         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2219
2220 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
2221
2222         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2223         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2224
2225 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
2226
2227        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2228        keyword warning to -Wc++0x-compat.
2229         
2230 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2231
2232         * decl.c (grokdeclarator): Update documentation.
2233
2234 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
2235
2236         PR c++/30536
2237         * decl.c (grokdeclarator): If __thread is used together with
2238         a storage class other than extern and static, clear thread_p
2239         after issuing diagnostics and fall through to checking the
2240         storage class.
2241
2242 2007-01-30  Roger Sayle  <roger@eyesopen.com>
2243
2244         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2245         calculating the size of an array (to avoid recursive errors).
2246
2247 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2248
2249         PR c++/24745
2250         * typeck.c (build_binary_op): Fix logic for warning. Move warning
2251         to -Wpointer-arith.
2252         * call.c (convert_like_real): Don't warn when converting to
2253         boolean type.
2254         
2255 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2256
2257         * decl.c (pop_label): Replace warning with call to
2258         warn_for_unused_label.
2259
2260 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
2261
2262         PR C++/28988
2263         * semantics.c (finish_pseudo_destructor_expr): Check the
2264         destrutor name by calling check_dtor_name.
2265
2266 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
2267
2268         * lex.c (D_CPP0X): Rename.
2269         (D_CXX0X): To this.
2270         (reswords): D_CPP0X -> D_CXX0X.
2271         (init_reswords): Ditto.
2272         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2273         of C++0x keywords as identifiers.
2274
2275 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
2276
2277         PR c++/27492
2278         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2279         function decls.
2280
2281 2007-01-23  Ian Lance Taylor  <iant@google.com>
2282
2283         * typeck.c (convert_for_assignment): Only warn about a = b = c
2284         when converting to bool.
2285
2286 2007-01-23  Roger Sayle  <roger@eyesopen.com>
2287
2288         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2289         TREE_OVERFLOW.
2290         * typeck.c (ignore_overflows): Remove the remaining uses of
2291         TREE_CONSTANT_OVERFLOW.
2292
2293 2007-01-20  Jan Hubicka  <jh@suse.cz>
2294
2295         * decl2.c (start_objects, start_static_storage_duration_function):
2296         Do not make the functions uninlinable.
2297
2298 2007-01-17  Ian Lance Taylor  <iant@google.com>
2299
2300         * class.c (add_method): Call VEC_reserve_exact rather than passing
2301         a negative size to VEC_reserve.
2302
2303 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
2304
2305         PR c++/29573
2306         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2307
2308 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
2309
2310         PR c++/28999
2311         * decl.c (make_typename_type): If the qualified name is not a
2312         type, issue an error.
2313         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2314         formatting.
2315
2316 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
2317
2318         * rtti.c: Include target.h.
2319         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2320         don't emit typeinfo for fundamental types as weak.
2321         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2322
2323 2007-01-08  Richard Guenther  <rguenther@suse.de>
2324
2325         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2326
2327 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
2328
2329         * call.c (standard_conversion): Pass flag to
2330         vector_types_convertible_p to disallow emission of note.
2331         * typeck.c (convert_for_assignment): Pass flag to
2332         vector_types_convertible_p to allow emission of note.
2333         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2334         to disallow emission of note.
2335
2336 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2337
2338         PR c++/28986
2339         * typeck.c (build_binary_op): Call overflow_warning if
2340         TREE_OVERFLOW_P is true for the result and not for any of the
2341         operands.
2342         
2343 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
2344
2345        PR c++/19439
2346        * class.c (add_method): Don't wait until template
2347        instantiation time to complain about duplicate methods.
2348         
2349 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2350
2351         PR c/19978
2352         * semantics.c (finish_unary_op_expr): Warn only if result
2353         overflowed and operands did not.
2354
2355 2007-01-05  Ian Lance Taylor  <iant@google.com>
2356
2357         * typeck.c (build_binary_op): Warn about comparing a non-weak
2358         address to NULL.
2359
2360 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
2361
2362         * pt.c (tsubst): Propagate the need for structural equality checks
2363         when reducing the level of template parameters.
2364
2365 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
2366
2367         * pt.c: Fix a comment typo.
2368
2369 2007-01-02  Ian Lance Taylor  <iant@google.com>
2370
2371         * semantics.c (maybe_convert_cond): Optionally warn when using an
2372         assignment as a condition.
2373         * typeck.c (convert_for_assignment): Optionally warn about
2374         assigning the result of an assignment to a bool.
2375
2376 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
2377
2378         * pt.c (canonical_template_parms): Correct typo in comment.
2379         
2380 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
2381
2382         * typeck.c (structural_comptypes): Renamed from "comptypes".
2383         (comptypes): Use canonical type information to perform fast type
2384         comparison. When VERIFY_CANONICAL_TYPES, verify that the
2385         canonical type comparison returns the same results as we would see
2386         from the current, structural check. Support COMPARE_STRUCTURAL
2387         when we need structural checks.
2388         * decl.c (typename_compare): Fix comment.
2389         (build_typename_type): TYPENAME_TYPE nodes require structural
2390         equality checks, because they resolve different based on the
2391         current class type.
2392         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2393         require structural equality checks (for now).
2394         (build_ptrmemfunc_type): Build the canonical pointer to member
2395         function type.
2396         (compute_array_index_type): Whenever we build a new index type
2397         to represent the size of an array in a template, we need to mark
2398         this index type as requiring structural equality. This goes for
2399         arrays with value-dependent sizes with the current ABI, or all
2400         arrays with ABI-1.
2401         * tree.c (cplus_array_hash): New.
2402         (struct cplus_array_info): New.
2403         (cplus_array_compare): New.
2404         (cplus_array_htab): New.
2405         (build_cplus_array_type_1): Use a hash table to cache the array
2406         types we build. Build the canonical array type for each array
2407         type.
2408         (cp_build_qualified_type_real): When building a cv-qualified array
2409         type, use the hash table of array types and build canonical array
2410         types as necessary.
2411         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2412         use structural equality (for now).
2413         * cp-tree.h (COMPARE_STRUCTURAL): New.
2414         * pt.c (canonical_template_parms): New.
2415         (canonical_type_parameter): New.
2416         (process_template_parm): Find the canonical type parameter.
2417         (lookup_template_class): When we have named the primary template
2418         type, set the canonical type for our template class to the primary
2419         template type. If any of the template arguments need structural
2420         equality checks, the template class needs structural equality
2421         checks.
2422         (tsubst): When reducing the level of a template template
2423         parameter, we require structural equality tests for the resulting
2424         parameter because its template parameters have not had their types
2425         canonicalized. When reducing a template type parameter, find the
2426         canonical reduced type parameter.
2427         (any_template_arguments_need_structural_equality_p): New.
2428