OSDN Git Service

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