OSDN Git Service

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