OSDN Git Service

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