OSDN Git Service

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