OSDN Git Service

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