OSDN Git Service

cac8a1a9534f5044cdc085f4ae6cafe06592b541
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2010-11-02  Dodji Seketeli  <dodji@redhat.com>
2
3         * cp-tree.h (enum tsubst_flags)<tf_no_class_instantiations>:
4         Remove.
5         * pt.c (tsubst): Remove the use of tf_no_class_instantiations.
6
7 2010-11-03  Jason Merrill  <jason@redhat.com>
8
9         PR c++/46277
10         * init.c (expand_default_init): Avoid ICE if we can't figure out
11         which function is being called.
12
13 2010-11-02  Nathan Froyd  <froydnj@codesourcery.com>
14
15         * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
16         instead of fold_convert.
17         * init.c (build_zero_init): Likewise.
18         * typeck.c (cp_build_binary_op): Likewise.
19
20 2010-11-02  Dodji Seketeli  <dodji@redhat.com>
21
22         PR c++/46170
23         PR c++/46162
24         * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
25          control diagnostic.
26         (convert_nontype_argument, convert_nontype_argument): Pass the
27         complain parameter down to check_valid_ptrmem_cst_expr.
28
29 2010-11-02  Dodji Seketeli  <dodji@redhat.com>
30
31         PR c++/45606
32         * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
33         (struct template_parm_index_s)<num_siblings>: New field.
34         (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
35         (process_template_parm): Extend the API to accept the number of
36         template parms in argument.
37         (cp_set_underlying_type): Remove this.
38         * class.c (build_self_reference): Require canonical type equality
39         back on the self reference of class.
40         * decl2.c (grokfield): Require canonical type equality back on
41         typedef class fields.
42         * name-lookup.c (pushdecl_maybe_friend): Require canonical type
43         equality back on typedefs.
44         * parser.c (cp_parser_template_parameter_list): Do not require
45         canonical type equality on dependent types created during template
46         parameters parsing.
47         * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
48         (fixup_template_parm, fixup_template_parms): New private
49         functions.
50         (current_template_args): Declare this.
51         (process_template_parm): Pass the total number of template parms
52         to canonical_type_parameter.
53         (build_template_parm_index): Add a new argument to carry the total
54         number of template parms.
55         (reduce_template_parm_level, process_template_parm, make_auto):
56         Adjust.
57         (current_template_args): Fix this for template template
58         parameters.
59         (tsubst_template_parm): Split out of ...
60         (tsubst_template_parms): ... this.
61         (reduce_template_parm_level): Don't loose
62         TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
63         (template_parm_to_arg): Extracted this function from
64         current_template_args. Make it represent invalid template parms
65         with an error_mark_node instead of a LIST_TREE containing an
66         error_mark_node.
67         (current_template_args): Use template_parm_to_arg.
68         (dependent_template_arg_p): Consider an invalid template argument
69         as dependent.
70         (end_template_parm_list): Do not update template sibling parms
71         here anymore. Use fixup_template_parms instead.
72         (process_template_parm): Pass the number of template parms to
73         canonical_type_parameter.
74         (make_auto): Require structural equality on auto
75         TEMPLATE_TYPE_PARM for now.
76         (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
77         using all the arguments deduced so far.
78         (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
79         canonical_type_parameter.
80         * tree.c (cp_set_underlying_type): Remove.
81         * typeck.c (get_template_parms_of_dependent_type)
82         (incompatible_dependent_types_p): Remove.
83         (structural_comptypes): Do not call incompatible_dependent_types_p
84         anymore.
85         (comp_template_parms_position): Re-organized. Take the length of
86         template parms list in account.
87
88 2010-11-01  Jason Merrill  <jason@redhat.com>
89
90         * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
91         (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
92         (cxx_eval_call_expression): Call push/pop_cx_call_context instead
93         of giving follow-on errors.
94         * error.c (maybe_print_constexpr_context): New.
95         (cp_diagnostic_starter): Call it.
96         * cp-tree.h: Declare cx_error_context.
97
98         * semantics.c (cxx_eval_constant_expression): Explain
99         unacceptable use of variable better.
100
101 2010-11-01  Gabriel Dos Reis  <gdr@cse.tamu.edu>
102             Jason Merrill  <jason@redhat.com>
103
104         * call.c (null_ptr_cst_p): Use maybe_constant_value.
105         (set_up_extended_ref_temp): Support constant initialization.
106         (initialize_reference): Adjust.
107         * class.c (check_bitfield_decl): Use cxx_constant_value.
108         * cvt.c (ocp_convert): Don't use integral_constant_value when
109         converting to class type.
110         * decl.c (finish_case_label): Use maybe_constant_value.
111         (build_init_list_var_init): Support constant initialization.
112         (check_initializer): Likewise.  Reorganize.
113         (cp_finish_decl): Likewise.
114         (expand_static_init): Likewise.
115         (compute_array_index_type): Use maybe_constant_value.
116         Add complain parm.
117         (create_array_type_for_decl, grokdeclarator): Pass it.
118         (build_enumerator): Use cxx_constant_value.
119         * decl2.c (grokfield): Use maybe_constant_init.
120         * except.c (check_noexcept_r): Handle constexpr.
121         (build_noexcept_spec): Use maybe_constant_value.
122         * init.c (expand_default_init): Support constant initialization.
123         (build_vec_init): Likewise.
124         (constant_value_1): Adjust.
125         (build_new_1): Adjust.
126         * parser.c (cp_parser_constant_expression): Allow non-integral
127         in C++0x mode.
128         (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
129         (cp_parser_initializer_clause): Toss folded result if non-constant.
130         * pt.c (fold_decl_constant_value): Remove.
131         (convert_nontype_argument): Use maybe_constant_value.  Give clearer
132         error about overflow.
133         (tsubst): Move array bounds handling into compute_array_index_type.
134         (value_dependent_expression_p): Handle constant CALL_EXPR.
135         (tsubst_decl): Don't set
136         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
137         (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
138         (instantiate_decl): Here too.
139         * semantics.c (finish_static_assert): Use maybe_constant_value.
140         (ensure_literal_type_for_constexpr_object): Make sure type is complete.
141         (potential_constant_expression): Use maybe_constant_value.
142         * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
143         is potentially valid in C++0x.
144         * typeck2.c (store_init_value): Handle constant init.
145         (check_narrowing): Use maybe_constant_value.
146         (build_functional_cast): Set TREE_CONSTANT on literal T().
147         * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
148         (LOOKUP_ALREADY_DIGESTED): New.
149         (compute_array_index_type): Adjust prototype.
150
151         * semantics.c (constexpr_call): New datatype.
152         (constexpr_call_table): New global table.
153         (constexpr_call_hash): New.
154         (constexpr_call_equal): Likewise.
155         (maybe_initialize_constexpr_call_table): Likewise.
156         (lookup_parameter_binding): Likewise.
157         (cxx_eval_builtin_function_call): Likewise.
158         (cxx_bind_parameters_in_call): Likewise.
159         (cxx_eval_call_expression): Likewise.
160         (cxx_eval_unary_expression): Likewise.
161         (cxx_eval_binary_expression): Likewise.
162         (cxx_eval_conditional_expression): Likewise.
163         (cxx_eval_array_reference): Likewise.
164         (cxx_eval_component_reference): Likewise.
165         (cxx_eval_logical_expression): Likewise.
166         (cxx_eval_object_construction): Likewise.
167         (cxx_eval_constant_expression): Likewise.
168         (cxx_eval_indirect_ref): Likewise.
169         (cxx_constant_value): Likewise.
170         (cxx_eval_bare_aggregate): Likewise.
171         (adjust_temp_type): New.
172         (reduced_constant_expression_p): New.
173         (verify_constant): New.
174         (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
175         (cxx_eval_outermost_constant_expr): New.
176         (maybe_constant_value, maybe_constant_init): New.
177         (cxx_eval_constant_expression): Use them.
178         * pt.c (iterative_hash_template_arg): No longer static.
179         * cp-tree.h: Declare fns.
180
181         * cp-tree.h (register_constexpr_fundef): Declare.
182         * decl.c (maybe_save_function_definition): New.
183         (finish_function): Use it.
184         * semantics.c (constexpr_fundef): New datatype.
185         (constexpr_fundef_table): New global table.
186         (constexpr_fundef_equal): New.
187         (constexpr_fundef_hash): Likewise.
188         (retrieve_constexpr_fundef): Likewise.
189         (validate_constexpr_fundecl): Store in the table.
190         (build_data_member_initialization): New fn.
191         (build_constexpr_constructor_member_initializers): New.
192         (register_constexpr_fundef): Define.
193         (is_this_parameter): New.
194         (get_function_named_in_call): Likewise.
195         (get_nth_callarg): Likewise.
196         (check_automatic_or_tls): New.
197         (morally_constexpr_builtin_function_p): New.
198         (potential_constant_expression): New.
199
200 2010-11-01  Jason Merrill  <jason@redhat.com>
201
202         * decl2.c (decl_constant_var_p): New fn.
203         (decl_maybe_constant_var_p): New fn.
204         (mark_used): Rework instantiation of things needed for constant
205         expressions.
206         * cp-tree.h: Declare new fns.
207         * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
208         (always_instantiate_p): Use decl_maybe_constant_var_p.
209         (instantiate_decl): Don't defer constexpr functions.
210         * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
211         * semantics.c (finish_id_expression): Use decl_constant_var_p.
212         Check for valid name in constant expr after mark_used.
213
214 2010-10-31  Jason Merrill  <jason@redhat.com>
215
216         * class.c (is_really_empty_class): Work when type is not complete.
217         (synthesized_default_constructor_is_constexpr): New.
218         (add_implicitly_declared_members): Use it.
219         (type_has_constexpr_default_constructor): Likewise.
220         * cp-tree.h: Declare it.
221         * method.c (synthesized_method_walk): Use it.
222
223         * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
224         * typeck.c (convert_for_assignment): Likewise.
225
226         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
227         message about constexpr without -std=c++0x.
228
229         * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
230         member.
231
232 2010-10-30  Nathan Froyd  <froydnj@codesourcery.com>
233
234         * class.c (layout_vtable_decl): Call build_array_of_n_type.
235         (build_vtt, build_ctor_vtabl_group): Likewise.
236
237 2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>
238
239         Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
240         * parser.c (cp_parser_objc_at_property_declaration): Removed
241         parsing of RID_COPIES and RID_IVAR.  Updated call to
242         objc_add_property_declaration.
243         * typecheck.c (finish_class_member_access_expr): Call
244         objc_maybe_build_component_ref instead of objc_build_setter_call.
245         (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
246         of objc_build_getter_call.
247
248 2010-10-27  Jason Merrill  <jason@redhat.com>
249
250         * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
251         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
252         * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
253         * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
254         (cp_parser_trait_expr): Likewise.
255
256 2010-10-27  Gabriel Dos Reis  <gdr@cse.tamu.edu>
257             Jason Merrill  <jason@redhat.com>
258
259         * decl.c (finish_case_label): Use decl_constant_value.
260
261         * method.c (synthesized_method_walk): Track constexprness too.
262         (process_subob_fn, walk_field_subobs): Likewise.
263         (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
264         (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
265         * class.c (add_implicitly_declared_members): Handle
266         constexpr default ctor.
267
268         * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
269         Make sure a constexpr ctor has an empty body.
270         * class.c (type_has_constexpr_default_constructor): New.
271         * cp-tree.h: Declare it.
272         * init.c (perform_member_init): Complain about uninitialized
273         member in constexpr ctor.
274         (emit_mem_initializers): And uninitialized base.
275         * decl.c (check_tag_decl): Fix typo.
276
277         * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
278         (is_valid_constexpr_fn): New fn.
279         (validate_constexpr_fundecl): Use it.
280         * decl.c (validate_constexpr_redeclaration): New.
281         (duplicate_decls): Use it.
282         (cp_finish_decl): Call validate_constexpr_fundecl and
283         ensure_literal_type_for_constexpr_object here.
284         (start_decl): Not here.  Don't ICE on constexpr reference.
285         (check_for_uninitialized_const_var): Don't handle constexpr specially.
286         (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
287         (check_static_variable_definition): Give friendly message about
288         missing constexpr.
289         (grokdeclarator): Complain about typedef and volatile with constexpr.
290         Reorganize.  Give sorry about non-static data members in C++0x mode.
291         (start_preparsed_function): Check validate_constexpr_fundecl here.
292         (check_function_type): Not here.
293         * decl2.c (finish_static_data_member_decl): Don't complain about
294         in-class init.
295         * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
296         (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
297         (cp_parser_decl_specifier_seq): Handle it.
298         (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
299
300         * class.c (check_bases): Propagate non-literality.
301         (check_field_decls): Likewise.
302         (finalize_literal_type_property): New.
303         (check_bases_and_members): Call it.
304         * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
305         (lang_type_class): Add has_constexpr_ctor field.
306         (DECL_DECLARED_CONSTEXPR_P): Strip template.
307         * decl.c (grok_special_member_properties): Set
308         TYPE_HAS_CONSTEXPR_CTOR.
309
310 2010-10-27  Jason Merrill  <jason@redhat.com>
311
312         * call.c (build_integral_nontype_arg_conv): New.
313         * cp-tree.h: Declare it.
314         * pt.c (convert_nontype_argument): Use it.
315
316         * error.c (dump_simple_decl): Print constexpr.
317
318         * cvt.c (build_up_reference): Use target_type for the temporary var.
319
320         * except.c (build_throw): Set EXPR_LOCATION.
321
322         * tree.c (build_cplus_new): Handle CONSTRUCTOR.
323
324         * semantics.c (finish_compound_stmt): Avoid creating an
325         unnecessary BIND_EXPR.
326
327         * call.c (convert_like_real): Don't check narrowing if the element
328         is also an initializer-list.
329
330 2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>
331
332         * parser.c (cp_parser_objc_at_property_declaration): Recognize
333         RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
334         Do not use objc_set_property_attr, but use local variables
335         instead.  Detect repeated usage of setter, getter and ivar
336         attributes.  Improved error processing when a setter name does not
337         end in ':'.  Do not check for CPP_CLOSE_PAREN after we determined
338         that the token is a keyword.  Updated call to
339         objc_add_property_declaration.
340
341 2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>
342
343         * parser.c (cp_parser_objc_property_decl): Renamed to
344         cp_parser_objc_struct_declaration.  Return the parsed trees
345         instead of calling objc_add_property_variable directly.  Detect
346         missing or invalid declspecs.  Implemented attributes.  Do not eat
347         the ';' at the end.  Exit loop whenever a non-comma is parsed, not
348         just EOF.
349         (cp_parser_objc_at_property): Renamed to
350         cp_parser_objc_at_property_declaration.  Updated calls to
351         objc_add_property_variable, now objc_add_property_declaration, and
352         to cp_parser_objc_property_decl, now
353         cp_parser_objc_struct_declaration.  Rewritten all code to be more
354         robust in dealing with syntax errors, and almost identical to the
355         one in c_parser_objc_at_property_declaration.
356         (cp_parser_objc_property_attrlist): Removed.
357         (cp_parser_objc_method_prototype_list): Updated call to
358         cp_parser_objc_at_property.
359         (cp_parser_objc_method_definition_list): Same change.
360         (cp_parser_objc_class_ivars): Detect a number of invalid
361         declarations of instance variables and produce errors when they
362         are found.
363         
364 2010-10-26  Jason Merrill  <jason@redhat.com>
365
366         * tree.c (build_vec_init_expr): Split out from...
367         (build_array_copy): ...here.
368         * init.c (perform_member_init): Use it.
369         * cp-tree.h: Declare it.
370         * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
371         VEC_INIT_EXPR and AGGR_INIT_EXPR here.  Drop pre/post parameters.
372         (cp_gimplify_expr): Handle array default-initialization via
373         VEC_INIT_EXPR.
374
375         * tree.c (stabilize_expr): Handle xvalues properly.
376
377         * call.c (build_over_call): Use argarray[0] for 'this' argument.
378
379         * decl.c (finish_function): Don't look at function_depth.
380
381 2010-10-25  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
382
383         Implement opaque-enum-specifiers for C++0x.
384         * cp-tree.h (SET_OPAQUE_ENUM_P): New.
385         (OPAQUE_ENUM_P): New.
386         (ENUM_FIXED_UNDERLYING_TYPE_P): New.
387         (start_enum): Update prototype.
388         (finish_enum_value_list): New prototype.
389         * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
390         "enum class" is used in an elaborated-type-specifier.
391         (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
392         * decl.c (copy_type_enum): New.
393         (finish_enum_value_list): New, with code from finish_enum.
394         (finish_enum): A lot of code removed. Added a gcc_assert.
395         (start_enum): Add parameters enumtype and is_new.
396         Rewrite to work with opaque-enum-specifiers.
397         * pt.c (maybe_process_partial_specialization): Allow for template
398         specialization of enumerations, with a pedwarn.
399         (lookup_template_class): Update call to start_enum. Call to
400         SET_OPAQUE_ENUM_P.
401         (tsubst_enum): Call to begin_scope, finish_scope and
402         finish_enum_value_list.
403
404 2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>
405
406         Removed Objective-C++ specific replacement of cxx_printable_name.
407         * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
408         to cxx_printable_name for both C++ and Objective-C++.
409         * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
410
411         * error.c (dump_decl): For Objective-C++, call
412         objc_maybe_printable_name here ...
413         * tree.c (cxx_printable_name_internal): ... instead of here.
414         
415 2010-10-23  Nicola Pero  <nicola.pero@meta-innovation.com>
416
417         * tree.c (cxx_printable_name_internal): In Objective-C++, call
418         objc_maybe_printable_name.
419
420 2010-10-22  Jason Merrill  <jason@redhat.com>
421
422         PR c++/46129
423         * pt.c (instantiate_class_template): Don't instantiate default
424         arguments.
425
426         PR c++/46103
427         * init.c (build_vec_init): Handle memberwise move.
428
429 2010-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
430
431         PR c++/46117
432         * call.c (add_function_candidate): Don't use TREE_VALUE on null
433         parmnode.
434
435 2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>
436
437         * parser.c (cp_parser_objc_method_type): Mark inline.  Return a
438         bool instead of calling objc_set_method_type.
439         (cp_parser_objc_method_signature): Updated calls to
440         cp_parser_objc_method_type and to objc_build_method_signature.
441         (cp_parser_objc_method_prototype_list): Updated calls to
442         objc_add_method_declaration.  Use token->type to determine if it
443         is a class method or not.
444         (cp_parser_objc_method_definition_list): Same change.
445
446 2010-10-20  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
447
448         PR c++/46056
449         * parser.c (cp_convert_range_for): Call cp_finish_decl
450         instead of finish_expr_stmt.
451
452 2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>
453
454         * cp-lang.c (finish_file): Removed.
455         * decl2.c (cp_write_global_declarations): Call
456         objc_write_global_declarations when compiling Objective-C++.
457
458 2010-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
459
460         PR c++/46046
461         * pt.c (add_to_template_args): Check extra_args for error_mark_node.
462         (coerce_template_parms): Likewise for args.
463
464 2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
465
466         Implemented parsing @synthesize and @dynamic for Objective-C++.
467         * parser.c (cp_parser_objc_method_definition_list): Recognize
468         RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
469         (cp_parser_objc_at_dynamic_declaration): New.
470         (cp_parser_objc_at_synthesize_declaration): New.
471
472 2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
473
474         * parser.c (cp_parser_objc_identifier_list): Check the return
475         value of cp_parser_identifier and react if it is error_mark_node.
476
477 2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
478
479         Merge from apple/trunk branch on FSF servers.
480
481         2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
482
483         Radar 4451818
484         * call.c (standard_conversion, implicit_conversion): Ignore
485         'volatile' attribute of artificially volatized type in objc when
486         evaluating various conversion weights.
487
488         2005-11-08  Fariborz Jahanian <fjahanian@apple.com>
489
490         Radar 4330422
491         * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
492         artiificially 'volatized' type before doing pointer comparison.
493
494 2010-10-18  Jakub Jelinek  <jakub@redhat.com>
495
496         PR c/46015
497         * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
498         goto destination.
499
500 2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
501
502         Merge from apple/trunk branch on FSF servers.
503
504         2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
505
506         Radar 4516785
507         * parser.c (cp_parser_simple_type_specifier): Don't lookup for
508         objc object types if type is scope qualified.
509
510 2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
511
512         Merge from apple/trunk branch on FSF servers.
513
514         2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
515
516         Radar 4133425
517         * lex.c (unqualified_name_lookup_error): Issue diagnostic
518         for private 'ivar' access.
519
520 2010-10-17  Iain Sandoe  <iains@gcc.gnu.org>
521
522         * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
523         enum, and handle @package.
524
525 2010-10-15  Jason Merrill  <jason@redhat.com>
526
527         PR c++/45983
528         * tree.c (cp_build_qualified_type_real): Don't reuse a variant
529         with a different typedef variant of the element type.
530
531 2010-10-14  Iain Sandoe  <iains@gcc.gnu.org>
532
533         merge from FSF apple 'trunk' branch.
534         2006 Fariborz Jahanian <fjahanian@apple.com>
535
536         Radars 4436866, 4505126, 4506903, 4517826
537         * typeck.c (finish_class_member_access_expr): Handle CLASS.property
538         syntax.
539         (cp_build_modify_expr): Likewise.
540         * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
541         (cp_parser_objc_method_definition_list): Likewise.
542         (cp_parser_objc_property_decl): New.
543         (cp_parser_objc_property_attrlist): New.
544         (cp_parser_objc_at_property): New.
545
546 2010-10-14  Richard Guenther  <rguenther@suse.de>
547
548         PR lto/44561
549         * cp-tree.h (NULLPTR_TYPE_P): Adjust.
550         * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
551         use build_int_cst.
552         * error.c (dump_type): Handle NULLPTR_TYPE.
553         (dump_type_prefix): Likewise.
554         (dump_type_suffix): Likewise.
555         * mangle.c (write_type): Likewise.
556         * name-lookup.c (arg_assoc_type): Likewise.
557         * rtti.c (typeinfo_in_lib_p): Likewise.
558         * pt.c (tsubst): Likewise.
559
560 2010-10-13  Jason Merrill  <jason@redhat.com>
561
562         PR c++/45984
563         * class.c (fixup_attribute_variants): New fn.
564         * cp-tree.h: Declare it.
565         * pt.c (instantiate_class_template): Call it.
566         * semantics.c (begin_class_definition): Call it.
567
568 2010-10-13  Richard Henderson  <rth@redhat.com>
569
570         * cp-lang.c (cp_eh_personality): Update call to
571         build_personality_function.
572         * except.c (choose_personality_routine): Update function comment.
573
574 2010-10-13  Richard Guenther  <rguenther@suse.de>
575
576         * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
577         clear DECL_CHAIN of NAMESPACE_DECLs.
578
579 2010-10-11  Martin Jambor  <mjambor@suse.cz>
580
581         PR c++/45562
582         * cp-tree.h (current_class_ref): Check that cp_function_chain is
583         non-NULL.
584         * call.c (build_cxx_call): Likewise.
585
586 2010-10-10  Jason Merrill  <jason@redhat.com>
587
588         * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
589         (tsubst_default_arguments): Only do this once for cloned fns.
590         (tsubst): Use typedef_variant_p.  Handle LANG_TYPE.  Don't
591         handle expressions.
592         (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
593         (tsubst_copy_and_build): Likewise.
594         (tsubst_initializer_list): Likewise.
595         (tsubst_copy): Change default to gcc_unreachable.  Handle
596         OVERLOAD and PTRMEM_CST.
597
598 2010-10-10  Jason Merrill  <jason@redhat.com>
599
600         PR lto/45959
601         PR lto/45960
602         * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
603
604 2010-10-07  Andi Kleen  <ak@linux.intel.com>
605
606         * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
607         (cc1plus-dummy): Remove.
608         (cc1plus-checksum): Change to run checksum over object files
609         and options only.
610
611 2010-10-08  Joseph Myers  <joseph@codesourcery.com>
612
613         * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
614
615 2010-10-07  Nicola Pero  <nicola.pero@meta-innovation.com>
616
617         * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
618         tcc_expression.
619         * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
620         AT_ENCODE_EXPR.
621         * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
622         * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
623         (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
624         (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
625         * parser.c (cp_parser_objc_encode_expression): Updated comment.
626
627 2010-10-07  Nicola Pero  <nicola@nicola.brainstorm.co.uk>
628
629         Merge from apple/trunk branch on FSF servers.
630
631         2006-04-26  Fariborz Jahanian <fjahanian@apple.com>
632
633         Radar 4508851
634         * parser.c (cp_parser_objc_interstitial_code): Recognize
635         and parse RID_NAMESPACE keyword.
636
637 2010-10-07  Iain Sandoe  <iains@gcc.gnu.org>
638
639         * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
640         finding ellipsis, before checking for attributes.
641
642 2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>
643
644         Merge from apple/trunk branch on FSF servers.
645         * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
646         longer existing gcc/c-common.def.
647
648         2005-12-14  Fariborz Jahanian <fjahanian@apple.com>
649
650         Radar 4278774
651         * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
652         * parser.c (cp_parser_objc_encode_expression): Build a templatized
653         parse tree for @encode(T).
654
655         2005-12-14  Fariborz Jahanian <fjahanian@apple.com>
656
657         Radar 4278774
658         * c-common.def: Add new expression code AT_ENCODE_EXPR.
659
660 2010-10-06  Eric Botcazou  <ebotcazou@adacore.com>
661
662         PR c++/45908
663         * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
664         code folding offsetof-like computations.
665
666 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
667
668         PR objc++/31125
669         * parser.c (cp_parser_objc_class_interface): If no identifier
670         follows an @interface token, stop parsing the interface after
671         printing an error.
672         (cp_parser_objc_class_implementation): If no identifier follows an
673         @implementation token, stop parsing the implementation after
674         printing an error.
675
676 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
677
678         PR objc++/23707
679         * parser.c (cp_parser_objc_method_keyword_params): If the required
680         colon is not found while parsing parameters, stop parsing them.
681
682 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
683
684         PR objc++/31126
685         * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
686         @end after detecting it.  Print an error if @end is found without
687         a '}'.
688         (cp_parser_objc_method_prototype_list): Do not eat the EOF after
689         detecting it.  Fixed reading the next token when continuing
690         because of an error in a method signature.  Print an error if EOF
691         is found without an '@end'.
692         (cp_parser_objc_method_definition_list): Same change.
693
694 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
695
696         Merge from apple/trunk branch on FSF servers:
697
698         2005-10-17  Fariborz Jahanian <fjahanian@apple.com>
699
700         Radar 4290840
701         * parser.c (cp_parser_objc_method_keyword_params): Check for valid
702         method parameters and issue error.
703         (cp_parser_objc_method_definition_list): Check for invalid tokens
704         which cannot start a function definition.
705
706         2005-10-14  Fariborz Jahanian <fjahanian@apple.com>
707
708         Radar 4294425
709         * parser.c (cp_parser_objc_message_args): Check for missing message
710         arguments and syntax error.
711
712         2005-10-13  Fariborz Jahanian <fjahanian@apple.com>
713
714         Radar 4261146
715         * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
716         looking for '}'.
717
718         2005-08-15  Ziemowit Laski  <zlaski@apple.com>
719
720         Radar 4093475
721         * parser.c (cp_parser_objc_interstitial_code): Catch stray
722         '{' and '}' tokens and issue appropriate errors.
723
724         2005-08-02  Ziemowit Laski  <zlaski@apple.com>
725
726         Radar 4185810
727         (cp_parser_statement_seq_opt): In addition to '}' and
728         end-of-file, a statement sequence may also be terminated
729         by a stray '@end'.
730
731 2010-10-05  Joseph Myers  <joseph@codesourcery.com>
732
733         * cp-tree.h (cxx_print_error_function,
734         cxx_initialize_diagnostics): Declare using diagnostic_context
735         typedef.
736
737 2010-10-04  Andi Kleen <ak@linux.intel.com>
738
739         * Make-lang.in (g++, cc1plus): Add + to build rule.
740
741 2010-10-04  Jason Merrill  <jason@redhat.com>
742
743         * tree.c (decl_storage_duration): New.
744         * cp-tree.h: Declare it.
745         (duration_kind): Return values.
746
747 2010-10-03  Jason Merrill  <jason@redhat.com>
748
749         * typeck.c (require_complete_type_sfinae): Add complain parm to...
750         (require_complete_type): ...this function.
751         (cp_build_array_ref, convert_arguments): Use it.
752         (convert_for_initialization, cp_build_modify_expr): Likewise.
753         * cp-tree.h: Declare it.
754         * call.c (build_over_call): Use it.
755
756 2010-09-30  Iain Sandoe  <iains@gcc.gnu.org>
757
758         merge from FSF 'apple/trunk' branch.
759         2006-01-30  Fariborz Jahanian <fjahanian@apple.com>
760
761         Radar 4386773
762         * cp/parser.c (cp_parser_objc_interstitial_code): For
763         @optional/@required set the optional/required flag.
764
765 2010-09-30  Nicola Pero  <nicola.pero@meta-innovation.com>
766
767         * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
768         and indentation when finding an Objective-C++ CPP_AT_NAME token.
769
770 2010-09-29  Richard Guenther  <rguenther@suse.de>
771
772         * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
773         (CP_TYPE_CONTEXT): Similar.
774         (FROB_CONTEXT): Frob global_namespace to the global
775         TRANSLATION_UNIT_DECL.
776         * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
777         set DECL_CONTEXT of global_namespace to it.
778         (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
779         instead of zeroing context.
780         (cp_finish_decl): Use DECL_FILE_SCOPE_P.
781         (grokfndecl): Likewise.
782         (start_preparsed_function): Likewise.
783         * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
784         (namespace_binding): Use SCOPE_FILE_SCOPE_P.
785         * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
786         (is_specialization_of_friend): Use CP_DECL_CONTEXT.
787         (push_template_decl_real): Likewise.
788         (tsubst_friend_class): Likewise.  Adjust context comparisons.
789         (instantiate_class_template): Use CP_TYPE_CONTEXT.
790         (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
791         * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
792         SCOPE_FILE_SCOPE_P.
793
794 2010-09-29  Yao Qi  <yao@codesourcery.com>
795
796         * decl.c (get_atexit_node): Fix typo.
797
798 2010-09-28  Jason Merrill  <jason@redhat.com>
799
800         * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
801         (real_lvalue_p): Take const_tree.
802         * cp-tree.h: Adjust.
803         * typeck.c (lvalue_or_else): Make temporary arg a permerror.
804         (cp_build_addr_expr_1): Likewise.
805
806 2010-09-28  Iain Sandoe  <iains@gcc.gnu.org>
807
808         Partially merged from apple/trunk branch on FSF servers:
809         2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
810         Radar 3803157 (method attributes)
811
812         * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
813         (cp_parser_objc_method_tail_params_opt): Likewise.
814         (cp_parser_objc_method_signature): Likewise.
815         (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
816         (cp_parser_objc_method_prototype_list): Handle attributes.
817         (cp_parser_objc_method_definition_list): Likewise.
818
819 2010-09-28  Richard Henderson  <rth@redhat.com>
820
821         * cp-lang.c: Include "target.h".
822         (cp_eh_personality): Use targetm.except_unwind_info.
823         * Make-lang.in (cp-lang.o): Update deps.
824
825 2010-09-28  Iain Sandoe  <iains@gcc.gnu.org>
826
827         * parser.c (cp_parser_objc_valid_prefix_attributes): New.
828         (cp_parser_declaration): Parse prefix attributes for ObjC++.
829         (cp_parser_objc_protocol_declaration): Handle attributes.
830         (cp_parser_objc_class_interface): Likewise.
831         (cp_parser_objc_declaration): Likewise.
832
833 2010-09-27  Jason Merrill  <jason@redhat.com>
834
835         Require lvalues as specified by the standard.
836         * typeck.c (lvalue_or_else): Use real_lvalue_p.
837         (cp_build_addr_expr_1): Split out of cp_build_unary_op.
838         (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
839         (decay_conversion, get_member_function_from_ptrfunc): Adjust.
840         (build_x_unary_op, build_reinterpret_cast_1): Adjust.
841         (build_const_cast_1): Adjust.
842         * cp-tree.h: Declare new fns.
843         * call.c (build_this, convert_like_real, build_over_call): Adjust.
844         (initialize_reference): Adjust.
845         * class.c (build_base_path, convert_to_base_statically): Adjust.
846         (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
847         * cvt.c (build_up_reference, convert_to_reference): Adjust.
848         * decl.c (register_dtor_fn): Adjust.
849         * decl2.c (build_offset_ref_call_from_tree): Adjust.
850         * except.c (initialize_handler_parm): Adjust.
851         * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
852         * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
853         * tree.c (stabilize_expr): Adjust.
854
855 2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>
856
857         Merge from apple/trunk branch on FSF servers:
858
859         2005-12-15  Fariborz Jahanian <fjahanian@apple.com>
860
861         Radar 4229905
862         * typeck.c (composite_pointer_type): Call objc_have_common_type
863         when comparing two objective-c pointer types.
864
865         2005-07-18  Ziemowit Laski  <zlaski@apple.com>
866
867         Radar 4175534
868         * call.c (standard_conversion): Do not issue warnings when
869         comparing ObjC pointer types.
870
871         2005-06-22  Ziemowit Laski  <zlaski@apple.com>
872
873         Radar 4154928
874         * call.c (standard_conversion): Allow for a pointer conversion
875         between any two ObjC pointer types.
876         * typeck.c (composite_pointer_type): Determine common type
877         for two ObjC pointer types.
878
879 2010-09-24  Jan Hubicka  <jh@suse.cz>
880
881         * decl.c (finish_function): Use decl_replaceable_p
882         * method.c (make_alias_for_thunk): Update call of
883         cgraph_same_body_alias.
884
885 2010-09-24  Jason Merrill  <jason@redhat.com>
886
887         * decl.c (compute_array_index_type): Remember type dependence of
888         array bound.
889         * pt.c (dependent_type_p_r): Don't recompute it here.
890
891         * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
892         reference and pointer to the same type as "*" or "&".
893
894 2010-09-24  Nicola Pero  <nicola.pero@meta-innovation.com>
895
896         * typeck.c (warn_args_num): Use warning 'too many arguments to
897         method [methodname]' for an Objective-C method instead of the less
898         satisfactory 'too many arguments to function' (with no method
899         name).
900
901 2010-09-21  Jason Merrill  <jason@redhat.com>
902
903         * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
904         special handling if we know the member.
905
906 2010-09-18  Jason Merrill  <jason@redhat.com>
907
908         * call.c (compare_ics): Do lvalue/rvalue reference binding
909         comparison for ck_list, too.
910
911 2010-09-15  Jason Merrill  <jason@redhat.com>
912
913         * semantics.c (finish_id_expression): Diagnose use of function
914         parms in evaluated context outside function body.
915
916         * decl2.c (grokbitfield): Diagnose non-integral width.
917
918         * call.c (convert_like_real): Use the underlying type of the
919         reference for the temporary.
920
921 2010-09-15  Jakub Jelinek  <jakub@redhat.com>
922
923         PR c++/45635
924         * class.c (build_vtbl_initializer): Use fn instead of init's operand
925         as first argument to FDESC_EXPR.
926
927 2010-09-15  Paolo Carlini  <paolo.carlini@oracle.com>
928
929         PR c++/45665
930         * decl.c (grokdeclarator): Check build_memfn_type return value
931         for error_mark_node.
932
933 2010-09-13  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
934
935         * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
936         (begin_range_for_stmt): Likewise.
937
938 2010-09-11  Rodrigo Rivas <rodrigorivascosta@gmail.com>
939
940         Implement range-based for-statements.
941         * cp-tree.def (RANGE_FOR_STMT): New.
942         * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
943         (cp_convert_range_for): Declare.
944         * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
945         (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
946         * semantics.c (begin_range_for_stmt): New.
947         (finish_range_for_decl): New.
948         (finish_for_stmt): Accept also RANGE_FOR_STMT.
949         (perform_koenig_lookup): Add extra argument include_std.
950         * parser.c (cp_parser_c_for): New with code from
951         cp_parser_iteration_statement().
952         (cp_parser_range_for): New.
953         (cp_convert_range_for): New.
954         (cp_parser_iteration_statement): Add range-for support.
955         (cp_parser_condition): Adjust comment.
956         (cp_parser_postfix_expression): perform_koenig_lookup takes extra
957         argument.
958         * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
959         * cxx-pretty-print.c: Likewise.
960         * lex.c (cxx_init): Likewise.
961         * name-lookup.c (lookup_function_nonclass): Add extra argument
962         include_std.
963         (lookup_arg_dependent): Likewise.
964         * name-lookup.h: Likewise.
965
966 2010-09-10  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
967
968         PR c++/43824
969         * error.c (maybe_warn_cpp0x): Add new warning
970         CPP0X_INLINE_NAMESPACES.
971         * parser.c (cp_parser_namespace_definition): Likewise.
972         * cp-tree.h (cpp0x_warn_str): Likewise.
973
974 2010-09-10  Richard Guenther  <rguenther@suse.de>
975
976         * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
977         TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
978
979 2010-09-10  Jan Hubicka  <jh@suse.cz>
980
981         PR tree-optimization/45605
982         * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
983         ADDR_EXPR.
984
985 2010-09-08  Jakub Jelinek  <jakub@redhat.com>
986
987         PR c++/45588
988         * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
989         before calling fold_decl_constant_value.
990
991 2010-09-07  Arnaud Charlet  <charlet@adacore.com>
992
993         * cp-tree.h (build_enumerator): Add new location_t parameter.
994         (build_lang_decl_loc): New function.
995         * decl.c (build_enumerator): New parameter loc. Use it when calling
996         build_decl. Replace build_lang_decl with build_lang_decl_loc.
997         * pt.c (tsubst_enum): Adjust call to build_enumerator.
998         * parser.c (cp_parser_enumerator_definition): Ditto.
999         * lex.c (build_lang_decl_loc): New function.
1000
1001 2010-09-06  Dodji Seketeli  <dodji@redhat.com>
1002
1003         PR c++/45200
1004         PR c++/45293
1005         PR c++/45558
1006         * tree.c (strip_typedefs): Strip typedefs from the context of
1007         TYPENAME_TYPEs.
1008
1009 2010-09-06  Mark Mitchell  <mark@codesourcery.com>
1010
1011         * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
1012         * call.c (build_conditional_expr): Likewise.
1013         (convert_arg_to_ellipsis): Likewise.
1014
1015 2010-09-06  Arnaud Charlet  <charlet@adacore.com>
1016
1017         * parser.c (make_pointer_declarator, make_reference_declarator,
1018         make_call_declarator, make_array_declarator): Set declarator->id_loc.
1019         (cp_parser_init_declarator): Adjust location of decl if appropriate.
1020
1021 2010-09-06  Jason Merrill  <jason@redhat.com>
1022
1023         * call.c (implicit_conversion): Fix value-init of enums.
1024         (convert_like_real): Likewise.
1025
1026         * decl.c (cp_finish_decl): Don't change init for auto deduction.
1027
1028         * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1029         (fold_non_dependent_expr): ...here.
1030         (convert_nontype_argument): Use it.  Take complain parm.
1031         Use perform_implicit_conversion instead of ocp_convert.
1032         Allow cv-qual changes.
1033         (convert_template_argument): Pass complain down.
1034         (tsubst_template_arg): Suppress constant expression warnings.
1035         Don't fold here.
1036
1037         * method.c (synthesized_method_walk): In constructors, also check
1038         subobject destructors.
1039
1040         * semantics.c (finish_compound_literal): Always build a
1041         TARGET_EXPR.
1042
1043 2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
1044
1045         PR c++/45043
1046         * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1047
1048 2010-08-30  Jakub Jelinek  <jakub@redhat.com>
1049
1050         PR middle-end/45423
1051         * parser.c (cp_parser_omp_atomic): Handle boolean
1052         {PRE,POST}_INCREMENT.
1053
1054 2010-08-29  Jason Merrill  <jason@redhat.com>
1055
1056         PR c++/44991
1057         * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1058         after tentative parsing.
1059
1060 2010-08-22  Joseph Myers  <joseph@codesourcery.com>
1061
1062         * Make-lang.in (g++spec.o): Update dependencies.
1063         * g++spec.c: Include opts.h
1064         (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1065         (lang_specific_driver): Use cl_decoded_option structures.
1066
1067 2010-08-20  Nathan Froyd  <froydnj@codesourcery.com>
1068
1069         * call.c: Use FOR_EACH_VEC_ELT.
1070         * class.c: Likewise.
1071         * decl.c: Likewise.
1072         * decl2.c: Likewise.
1073         * error.c: Likewise.
1074         * except.c: Likewise.
1075         * mangle.c: Likewise.
1076         * method.c: Likewise.
1077         * name-lookup.c: Likewise.
1078         * parser.c: Likewise.
1079         * pt.c: Likewise.
1080         * repo.c: Likewise.
1081         * semantics.c: Likewise.
1082         * typeck2.c: Likewise.
1083
1084 2010-08-19  Jason Merrill  <jason@redhat.com>
1085
1086         * call.c (reference_related_p): Check for error_mark_node.
1087         (add_function_candidate): Check it instead of
1088         same_type_ignoring_top_level_qualifiers_p.
1089
1090         PR c++/45315
1091         * init.c (build_new_1): Don't use build_value_init in a template.
1092         (build_value_init): Make sure we don't.
1093
1094         PR c++/45307
1095         * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1096         of empty class CONSTRUCTOR.
1097
1098         * except.c (pending_noexcept, pending_noexcept_checks): New.
1099         (perform_deferred_noexcept_checks): New.
1100         (maybe_noexcept_warning): Split from...
1101         (finish_noexcept_expr): ...here.  Adjust.
1102         * decl2.c (cp_write_global_declarations): Call
1103         perform_deferred_noexcept_checks.
1104         * cp-tree.h: And declare it.
1105
1106 2010-08-18  Nathan Froyd  <froydnj@codesourcery.com>
1107
1108         PR c++/45049
1109         * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1110         TREE_CHAIN.
1111
1112 2010-08-17  Kai Tietz  <kai.tietz@onevision.com>
1113
1114         * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1115         or if -fms-extensions is enabled check, check permissive.
1116
1117 2010-08-09  Jason Merrill  <jason@redhat.com>
1118
1119         PR c++/45236
1120         * pt.c (lookup_template_class): Don't re-coerce outer parms.
1121
1122 2010-08-09  Nathan Froyd  <froydnj@codesourcery.com>
1123
1124         * call.c (add_builtin_candidates): Use VECs for local variable
1125         `types'.  Adjust remainder of function accordingly.
1126
1127 2010-08-09  Nathan Froyd  <froydnj@codesourcery.com>
1128
1129         * name-lookup.c (is_associated_namespace): Convert local variables
1130         to be VECs instead of TREE_LISTs.
1131
1132 2010-08-09  Nathan Froyd  <froydnj@codesourcery.com>
1133
1134         * tree.c (varargs_function_p): Use stdarg_p.
1135
1136 2010-08-07  Nathan Froyd  <froydnj@codesourcery.com>
1137
1138         * parser.c (cp_default_arg_entry): Declare.  Declare a VEC of it.
1139         (cp_unparsed_functions_entry): Declare.  Declare a VEC of it.
1140         (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1141         Change type to a VEC.
1142         (unparsed_funs_with_default_args): Define.
1143         (unparsed_funs_with_definitions): Define.
1144         (push_unparsed_function_queues): New function.
1145         (cp_parser_new): Call it.
1146         (pop_unparsed_function_queues): New function.
1147         (cp_parser_class_specifier): Adjust processing of unparsed functions.
1148         (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1149         (cp_parser_save_member_function_body): Likewise.
1150         (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1151         and pop_unparsed_function_queues.
1152         (cp_parser_late_parsing_default_args): Likewise.
1153         (cp_parser_save_default_args): Use VEC_safe_push.
1154
1155 2010-08-07  Nathan Froyd  <froydnj@codesourcery.com>
1156
1157         * name-lookup.h (cp_label_binding): Declare.  Declare a VEC type
1158         containing it.
1159         (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1160         fields to VECs.
1161         * decl.c (poplevel): Adjust for type changes.
1162         (declare_local_label): Likewise.
1163
1164 2010-08-06  Jason Merrill  <jason@redhat.com>
1165
1166         * typeck.c (complete_type_or_maybe_complain): Split out from...
1167         (complete_type_or_else): Here.
1168         (build_class_member_access_expr): Call it.
1169         (finish_class_member_access_expr): Likewise.
1170         * call.c (build_special_member_call): Likewise.
1171         * cvt.c (build_expr_type_conversion): Likewise.
1172         * init.c (build_new): Likewise.
1173         * typeck2.c (build_functional_cast): Likewise.
1174         * cp-tree.h: Declare it.
1175
1176         * init.c (build_value_init): Add complain parm.
1177         (build_value_init_noctor): Likewise.
1178         (perform_member_init): Pass it.
1179         (expand_aggr_init_1): Likewise.
1180         (build_new_1): Likewise.
1181         (build_vec_init): Likewise.
1182         * pt.c (tsubst_expr): Likewise.
1183         * typeck2.c (build_functional_cast): Likewise.
1184         * cp-tree.h: Adjust.
1185         * tree.c (build_target_expr_with_type): Handle error_mark_node.
1186
1187         * typeck.c (decay_conversion): Any expression with type nullptr_t
1188         decays to nullptr.
1189
1190 2010-07-30  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1191
1192         PR c++/45112
1193         * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1194
1195 2010-07-27  Jason Merrill  <jason@redhat.com>
1196
1197         * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1198         from build_value_init.
1199         * init.c (build_value_init_noctor): Give error for unknown array
1200         bound.
1201
1202 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
1203
1204         * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1205
1206 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
1207
1208         * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1209         c_common_initialize_diagnostics.
1210         * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1211         LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1212
1213 2010-07-21  Jason Merrill  <jason@redhat.com>
1214
1215         * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1216
1217         * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1218         to cp_finish_decl.
1219
1220 2010-07-20  Jeffrey Yasskin  <jyasskin@google.com>
1221
1222         PR c++/44641
1223         * pt.c (instantiate_class_template): Propagate the template's
1224         location to its instance.
1225
1226 2010-07-20  Jason Merrill  <jason@redhat.com>
1227
1228         PR c++/44967
1229         * pt.c (tsubst_copy_and_build): Rework last change.
1230
1231         PR c++/44967
1232         * pt.c (tsubst_copy_and_build): Handle partial substitution of
1233         CALL_EXPR.
1234
1235 2010-07-19  Jason Merrill  <jason@redhat.com>
1236
1237         PR c++/44996
1238         * semantics.c (finish_decltype_type): Correct decltype
1239         of parenthesized rvalue reference variable.
1240
1241         PR c++/44969
1242         * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1243         * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1244
1245 2010-07-19  Paolo Carlini  <paolo.carlini@oracle.com>
1246
1247         PR c++/44969
1248         * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1249         parameter.
1250         * cp-tree.h: Adjust declaration.
1251         * init.c (perform_member_init): Adjust caller.
1252         * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1253         * typeck2.c (store_init_value): Likewise.
1254         (build_functional_cast): Pass complain argument to
1255         build_x_compound_expr_from_list.
1256
1257 2010-07-16  Jason Merrill  <jason@redhat.com>
1258
1259         PR c++/32505
1260         * pt.c (process_partial_specialization): Diagnose partial
1261         specialization after instantiation.
1262         (most_specialized_class): Add complain parm.
1263
1264         * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1265
1266 2010-07-15  Nathan Froyd  <froydnj@codesourcery.com>
1267
1268         * init.c (build_new_1): Use cp_build_function_call_nary instead of
1269         cp_build_function_call.
1270
1271 2010-07-15  Jason Merrill  <jason@redhat.com>
1272
1273         PR c++/44909
1274         * call.c (add_function_candidate): If we're working on an implicit
1275         declaration, don't consider candidates that won't match.
1276         * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1277         * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1278
1279         Revert:
1280         * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1281         (TYPE_HAS_USER_OPEQ): New.
1282         * decl.c (grok_special_member_properties): Set it.
1283         * class.c (add_implicitly_declared_members): Don't lazily declare
1284         constructors/operator= if a base or member has a user-declared one.
1285         (check_bases_and_members, check_bases): Adjust.
1286         (check_field_decls, check_field_decl): Adjust.
1287
1288 2010-07-15  Anatoly Sokolov  <aesok@post.ru>
1289
1290         * decl.c (integer_three_node): Remove.
1291         (cxx_init_decl_processing): Do not initialize the integer_three_node.
1292         * cp-tree.h (integer_three_node): Remove.
1293
1294 2010-07-15  Nathan Froyd  <froydnj@codesourcery.com>
1295
1296         * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1297         * call.c: Likewise.
1298         * class.c: Likewise.
1299         * cp-gimplify.c: Likewise.
1300         * decl.c: Likewise.
1301         * decl2.c: Likewise.
1302         * init.c: Likewise.
1303         * mangle.c: Likewise.
1304         * name-lookup.c: Likewise.
1305         * optimize.c: Likewise.
1306         * parser.c: Likewise.
1307         * pt.c: Likewise.
1308         * rtti.c: Likewise.
1309         * search.c: Likewise.
1310         * semantics.c: Likewise.
1311         * typeck.c: Likewise.
1312         * typeck2.c: Likewise.
1313
1314 2010-07-14  Jason Merrill  <jason@redhat.com>
1315
1316         * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1317         (build_field_list): Cache field type.
1318
1319         Implement C++0x unrestricted unions (N2544)
1320         * class.c (check_field_decl): Loosen union handling in C++0x.
1321         * method.c (walk_field_subobs): Split out from...
1322         (synthesized_method_walk): ...here.  Set msg before loops.
1323         (process_subob_fn): Check for triviality in union members.
1324         * init.c (sort_mem_initializers): Splice out uninitialized
1325         anonymous unions and union members.
1326         (push_base_cleanups): Don't automatically destroy anonymous unions
1327         and union members.
1328
1329 2010-07-13  Jason Merrill  <jason@redhat.com>
1330
1331         PR c++/44909
1332         * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1333         (TYPE_HAS_USER_OPEQ): New.
1334         * decl.c (grok_special_member_properties): Set it.
1335         * class.c (add_implicitly_declared_members): Don't lazily declare
1336         constructors/operator= if a base or member has a user-declared one.
1337         (check_bases_and_members, check_bases): Adjust.
1338         (check_field_decls, check_field_decl): Adjust.
1339         * method.c (synthesized_method_walk): Initialize check_vdtor.
1340
1341         PR c++/44540
1342         * mangle.c (write_type): Canonicalize.
1343         (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1344         (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1345
1346 2010-07-13  Paolo Carlini  <paolo.carlini@oracle.com>
1347
1348         PR c++/44908
1349         * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1350         complain argument.
1351         * typeck.c (get_delta_difference): Update prototype, add a
1352         tsubst_flags_t parameter; update get_delta_difference_1 calls and
1353         add checks for error_mark_node.
1354         (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1355         parameter; update lookup_base call.
1356         (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1357         parameter; update get_delta_difference call and add check for
1358         error_mark_node.
1359         (convert_ptrmem): Update prototype, add a tsubst_flags_t
1360         parameter; update get_delta_difference call and add check for
1361         error_mark_node;  update build_ptrmemfunc call.
1362         (build_static_cast_1): Adjust convert_ptrmem call.
1363         (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1364         (cp_build_unary_op): Adjust build_ptrmemfunc call.
1365         * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1366         and build_ptrmemfunc calls.
1367         * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1368
1369 2010-07-12  Paolo Carlini  <paolo.carlini@oracle.com>
1370
1371         PR c++/44907
1372         * call.c (build_temp): Add tsubst_flags_t complain parameter;
1373         adjust build_special_member_call call, pass complain.
1374         (convert_like_real): Adjust build_temp call, pass complain.
1375
1376 2010-07-09  Jason Merrill  <jason@redhat.com>
1377
1378         PR c++/43120
1379         * cp-tree.h (BV_LOST_PRIMARY): New macro.
1380         * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1381         Set BV_LOST_PRIMARY.
1382         (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1383
1384 2010-07-08  Jason Merrill  <jason@redhat.com>
1385
1386         PR c++/43120
1387         * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1388         virtual bases for covariant thunks.
1389
1390 2010-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1391
1392         * cp-tree.h: Do not include toplev.h.
1393
1394 2010-07-06  Jason Merrill  <jason@redhat.com>
1395
1396         PR c++/44703
1397         * call.c (is_std_init_list): Look through typedefs.
1398
1399         PR c++/44778
1400         * init.c (build_offset_ref): If scope isn't dependent,
1401         don't exit early.  Look at TYPE_MAIN_VARIANT.
1402         * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1403
1404         * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1405
1406 2010-07-06  Shujing Zhao  <pearly.zhao@oracle.com>
1407
1408         * cp-tree.h (impl_conv_void): New type.
1409         (convert_to_void): Adjust prototype.
1410         * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1411         diagnostic for easy translation. Change caller.
1412         * typeck.c: Update call to convert_to_void.
1413         * semantics.c: Likewise.
1414         * init.c: Likewise.
1415
1416 2010-07-05  Nathan Froyd  <froydnj@codesourcery.com>
1417
1418         * decl.c (cp_finish_decl): Call add_local_decl.
1419         * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1420
1421 2010-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
1422
1423         * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1424         throughout.
1425
1426 2010-07-05  Shujing Zhao  <pearly.zhao@oracle.com>
1427
1428         PR c++/22138
1429         * parser.c (cp_parser_primary_expression): Error if local template is
1430         declared.
1431
1432 2010-07-02  Le-Chun Wu  <lcwu@google.com>
1433
1434         PR/44128
1435         * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1436         (variable or type) shadows another type.
1437
1438 2010-07-02  Jakub Jelinek  <jakub@redhat.com>
1439
1440         PR c++/44780
1441         * typeck.c (convert_for_assignment): When converting a convertible
1442         vector type or objc++ types, call mark_rvalue_use.
1443         * typeck2.c (build_m_component_ref): Use return values from
1444         mark_rvalue_use or mark_lvalue_use.
1445         * class.c (build_base_path): Likewise.
1446         * call.c (build_conditional_expr): Likewise.
1447
1448 2010-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
1449
1450         PR c++/44039
1451         * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1452         returns NULL_TREE.
1453
1454 2010-07-01  Richard Guenther  <rguenther@suse.de>
1455
1456         * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1457         predicate we are looking for, allow non-gimplified
1458         INDIRECT_REFs.
1459
1460 2010-06-30  Paolo Carlini  <paolo.carlini@oracle.com>
1461
1462         PR c++/44628
1463         * typeck.c (cp_build_unary_op): Early return error_mark_node when
1464         arg is NULL_TREE too.
1465         * call.c (convert_class_to_reference): Return error_mark_node when
1466         expr is NULL_TREE.
1467
1468 2010-06-30  Michael Matz  <matz@suse.de>
1469
1470         * repo.c (finish_repo): Fix typo.
1471
1472 2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
1473
1474         * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1475
1476 2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
1477
1478         * repo.c (pending_repo): Change type to a VEC.
1479         (finish_repo): Adjust for new type of pending_repo.
1480         (repo_emit_p): Likewise.
1481
1482 2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1483
1484         * tree.c: Include gimple.h. Do not include tree-flow.h
1485         * decl.c: Do not include tree-flow.h
1486         * Make-lang.in: Adjust dependencies.
1487
1488 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
1489
1490         * decl.c (incomplete_var): Declare.  Declare VECs containing them.
1491         (incomplete_vars): Adjust comment.  Change type to a VEC.
1492         (maybe_register_incomplete_var): Adjust for new type.
1493         (complete_vars): Adjust iteration over incomplete_vars.
1494
1495 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
1496
1497         * decl.c (struct named_label_entry): Change type of bad_decls field
1498         to a VEC.
1499         (poplevel_named_label_1): Adjust for new type of bad_decls.
1500         (check_goto): Likewise.
1501
1502 2010-06-29  Jason Merrill  <jason@redhat.com>
1503
1504         Enable implicitly declared move constructor/operator= (N3053).
1505         * class.c (add_implicitly_declared_members): A class with no
1506         explicitly declared copy or move constructor gets both declared
1507         implicitly, and similarly for operator=.
1508         (check_bases): A type with no copy ctor does not inhibit
1509         a const copy ctor in a derived class.  It does mean the derived
1510         one is non-trivial.
1511         (check_field_decl): Likewise.
1512         (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1513         * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1514         (trivially_copyable_p): Likewise.
1515         * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1516         * class.c (finish_struct_bits): Likewise.
1517         * tree.c (build_target_expr_with_type): Likewise.
1518         * typeck2.c (store_init_value): Likewise.
1519
1520         Enable implicitly deleted functions (N2346)
1521         * class.c (check_bases_and_members): Adjust lambda flags.
1522         * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1523
1524         * decl2.c (mark_used): Adjust error for use of deleted function.
1525
1526         Machinery to support implicit delete/move.
1527         * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1528         has_complex_move_ctor, has_complex_move_assign bitfields.
1529         (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1530         (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1531         (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1532         (enum special_function_kind): Add sfk_move_assignment.
1533         (LOOKUP_SPECULATIVE): New.
1534         * call.c (build_over_call): Return early if it's set.
1535         (build_over_call): Use trivial_fn_p.
1536         * class.c (check_bases): If the base has no default constructor,
1537         the derived one is non-trivial.  Handle move ctor/op=.
1538         (check_field_decl): Likewise.
1539         (check_bases_and_members): Handle move ctor/op=.
1540         (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1541         (type_has_move_constructor, type_has_move_assign): New.
1542         * decl.c (grok_special_member_properties): Handle move ctor/op=.
1543         * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1544         (trivial_fn_p): New.
1545         (do_build_copy_constructor): Use it.
1546         (do_build_assign_ref): Likewise.  Handle move assignment.
1547         (build_stub_type, build_stub_object, locate_fn_flags): New.
1548         (locate_ctor): Use locate_fn_flags.
1549         (locate_copy, locate_dtor): Remove.
1550         (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1551         (process_subob_fn, synthesized_method_walk): New.
1552         (maybe_explain_implicit_delete): New.
1553         (implicitly_declare_fn): Use synthesized_method_walk,
1554         type_has_trivial_fn, and type_set_nontrivial_flag.
1555         (defaulted_late_check): Set DECL_DELETED_FN.
1556         (defaultable_fn_check): Handle sfk_move_assignment.
1557         (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early.  Don't declare
1558         implicitly deleted move ctor/op=.
1559         * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1560         (lookup_fnfields_slot): New.
1561         * semantics.c (omp_clause_info_fndecl): Remove.
1562         (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1563         get_copy_assign, trivial_fn_p.
1564         (trait_expr_value): Adjust call to locate_ctor.
1565         * tree.c (special_function_p): Handle sfk_move_assignment.
1566
1567         * class.c (type_has_virtual_destructor): New.
1568         * cp-tree.h: Declare it.
1569         * semantics.c (trait_expr_value): Use it.
1570
1571         * call.c (build_over_call): Only give warnings with tf_warning.
1572
1573         * name-lookup.c (pop_scope): Handle NULL_TREE.
1574
1575         * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1576         (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1577         (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1578         (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1579         (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1580         (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1581         (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1582         (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1583         (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1584         (sfk_assignment_operator): Rename to sfk_copy_assignment.
1585         * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1586         * search.c, semantics.c, tree.c: Adjust.
1587
1588         * pt.c (dependent_scope_ref_p): Remove.
1589         (value_dependent_expression_p): Don't call it.
1590         (type_dependent_expression_p): Here either.
1591         * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1592         if the scope isn't dependent.
1593
1594         * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1595         a reference.
1596
1597         PR c++/44587
1598         * pt.c (has_value_dependent_address): New.
1599         (value_dependent_expression_p): Check it.
1600         (convert_nontype_argument): Likewise.  Call decay_conversion before
1601         folding if we want a pointer.
1602         * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1603         scope is the current instantiation.
1604
1605 2010-06-28  Jakub Jelinek  <jakub@redhat.com>
1606
1607         PR c++/44682
1608         * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1609         on expr.
1610
1611 2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>
1612
1613         * init.c: Do not include except.h.
1614         * decl.c: Likewise.
1615         * expr.c: Likewise.
1616         * cp-lang.c: Likewise.
1617         * pt.c: Likewise.
1618         * semantics.c: Likewise.
1619         * decl2.c: Likewise.
1620         * except.c: Likewise.
1621         (init_exception_processing): Do not set the removed
1622         lang_protect_cleanup_actions here.
1623         (cp_protect_cleanup_actions): Make non-static and remove prototype.
1624         (doing_eh): New, moved from except.c but removed the do_warning flag.
1625         (expand_start_catch_block): Update doing_eh call.
1626         (expand_end_catch_block): Likewise.
1627         (build_throw): Likewise.
1628         * cp-tree.h: Prototype cp_protect_cleanup_actions.
1629         * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1630         cp_protect_cleanup_actions.
1631         * Make-lang.in: Update dependencies.
1632
1633 2010-06-26  Jason Merrill  <jason@redhat.com>
1634
1635         * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1636         constructor called with a single argument that takes a reference
1637         to the constructor's class.
1638         (BAD_CONVERSION_RANK): New.
1639         (compare_ics): Use it to compare bad ICSes.
1640
1641 2010-06-25  Joseph Myers  <joseph@codesourcery.com>
1642
1643         * lang-specs.h: Remove +e handling.
1644
1645 2010-06-24  Andi Kleen  <ak@linux.intel.com>
1646
1647         * parser.c: (cp_parser_question_colon_clause):
1648         Switch to use cp_lexer_peek_token.
1649         Call warn_for_omitted_condop. Call pedwarn for omitted
1650         middle operand.
1651
1652 2010-06-22  Jakub Jelinek  <jakub@redhat.com>
1653
1654         PR c++/44619
1655         * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1656         datum and mark_rvalue_use on component.
1657
1658         PR c++/44627
1659         * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1660         the CALL_EXPR has no arguments.
1661
1662 2010-06-21  Jason Merrill  <jason@redhat.com>
1663
1664         * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1665
1666         * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1667         element type.
1668
1669 2010-06-17  Nathan Froyd  <froydnj@codesourcery.com>
1670
1671         * name-lookup.c (struct arg_lookup): Convert namespaces and
1672         classes fields to VEC.
1673         (arg_assoc_namespace): Adjust for new type of namespaces.
1674         (arg_assoc_class): Adjust for new type of classes.
1675         (lookup_arg_dependent): Use make_tree_vector and
1676         release_tree_vector.
1677         * typeck2.c (build_x_arrow): Use vec_member.
1678
1679 2010-06-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1680
1681         PR c++/44486
1682         * error.c (dump_decl): Better wording for anonymous namespace.
1683
1684 2010-06-16  Nathan Froyd  <froydnj@codesourcery.com>
1685
1686         * class.c (build_vtbl_initializer): Adjust computation of new_position
1687         and which entry to add padding for.
1688
1689 2010-06-16  Jason Merrill  <jason@redhat.com>
1690
1691         * except.c (check_noexcept_r): Return the problematic function.
1692         (finish_noexcept_expr): Give -Wnoexcept warning.  Add complain parm.
1693         * pt.c (tsubst_copy_and_build): Pass it.
1694         * parser.c (cp_parser_unary_expression): Likewise.
1695         * cp-tree.h: Adjust prototype.
1696
1697         * method.c (defaulted_late_check): Give the defaulted method
1698         the same exception specification as the implicit declaration.
1699
1700 2010-06-15  Jason Merrill  <jason@redhat.com>
1701
1702         * class.c (add_implicitly_declared_members): Implicit assignment
1703         operators can also be virtual overriders.
1704         * method.c (lazily_declare_fn): Likewise.
1705
1706         * call.c (convert_like_real): Give "initializing argument of"
1707         information for ambiguous conversion.  Give source position
1708         of function.
1709
1710         * call.c (print_z_candidates): Do print viable deleted candidates.
1711         (joust): Don't choose a deleted function just because its worst
1712         conversion is better than another candidate's worst.
1713
1714         * call.c (convert_like_real): Don't complain about
1715         list-value-initialization from an explicit constructor.
1716
1717         * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1718         DECL_SOURCE_LOCATION directly.
1719
1720         * class.c (type_has_user_provided_default_constructor): Use
1721         sufficient_parms_p.
1722
1723         * call.c (is_subseq): Handle ck_aggr, ck_list.
1724         (compare_ics): Treat an aggregate or ambiguous conversion to the
1725         same type as involving the same function.
1726
1727 2010-06-13  Shujing Zhao  <pearly.zhao@oracle.com>
1728
1729         * typeck.c (convert_for_assignment): Fix comment. Change message
1730         format from %d to %qP.
1731         (convert_for_initialization): Fix comment. 
1732
1733 2010-06-11  Shujing Zhao  <pearly.zhao@oracle.com>
1734
1735         * cp-tree.h (expr_list_kind): New type.
1736         (impl_conv_rhs): New type.
1737         (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1738         prototype.
1739         (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1740         diagnostics for easy translation. Change caller.
1741         (convert_for_initialization): Use impl_conv_rhs and change caller.
1742         (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1743         diagnostics for easy translation. Change caller.
1744         * decl.c (bad_spec_place): New enum.
1745         (bad_specifiers): Use it and emit the diagnostics for easy
1746         translation. Change caller.
1747         * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1748
1749 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
1750
1751         * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1752         to a VEC.
1753         * decl2.c (cp_write_global_declarations): Adjust for new type of
1754         decl_namespace_list.
1755         * name-lookup.c (current_decl_namespace): Likewise.
1756         (push_decl_namespace): Likewise.
1757         (pop_decl_namespace): Likewise.
1758
1759 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
1760
1761         * call.c (build_java_interface_fn_ref): Call build_function_type_list
1762         instead of build_function_type.
1763         * decl.c (cxx_init_decl_processing): Likewise.
1764         (declare_global_var): Likewise.
1765         (get_atexit_node): Likewise.
1766         (expand_static_init): Likewise.
1767         * decl2.c (start_objects): Likewise.
1768         (start_static_storage_duration_function): Likewise.
1769         * except.c (init_exception_processing): Likewise.
1770         (build_exc_ptr): Likewise.
1771         (build_throw): Likewise.
1772         * rtti.c (throw_bad_cast): Likewise.
1773         (throw_bad_typeid): Likewise.
1774         (build_dynamic_cast_1): Likewise.
1775
1776 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
1777
1778         * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1779         (build_op_delete_call): Likewise.
1780         (build_over_call): Likewise.
1781         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1782         * pt.c (process_partial_specialization): Likewise.
1783         (tsubst_template_args): Likewise.
1784         * semantics.c (finish_asm_stmt): Likewise.
1785
1786 2010-06-08  Nathan Sidwell  <nathan@codesourcery.com>
1787
1788         * decl.c (record_key_method_defined): New, broken out of ...
1789         (finish_function): ... here.  Call it.  
1790         (start_decl): Treat aliases as definitions.
1791
1792 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
1793
1794         * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1795
1796         * pt.c (maybe_process_partial_specialization): Likewise.
1797         (register_specialization): Likewise.
1798         (add_pending_template): Likewise.
1799         (lookup_template_class): Likewise.
1800         (push_tinst_level): Likewise.
1801
1802         * parser.c (cp_lexer_new_main): Likewise.
1803         (cp_lexer_new_from_tokens): Likewise.
1804         (cp_token_cache_new): Likewise.
1805         (cp_parser_context_new): Likewise.
1806         (cp_parser_new): Likewise.
1807         (cp_parser_nested_name_specifier_opt): Likewise.
1808         (cp_parser_template_id): Likewise.
1809
1810         * name-lookup.c (binding_entry_make): Likewise.
1811         (binding_table_construct): Likewise.
1812         (binding_table_new): Likewise.
1813         (cxx_binding_make): Likewise.
1814         (pushdecl_maybe_friend): Likewise.
1815         (begin_scope): Likewise.
1816         (push_to_top_level): Likewise.
1817
1818         * lex.c (init_reswords): Likewise.
1819         (retrofit_lang_decl): Likewise.
1820         (cxx_dup_lang_specific_decl): Likewise.
1821         (copy_lang_type): Likewise.
1822         (cxx_make_type): Likewise.
1823
1824         * decl.c (make_label_decl): Likewise.
1825         (check_goto): Likewise.
1826         (start_preparsed_function): Likewise.
1827         (save_function_data): Likewise.
1828
1829         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1830
1831         * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1832
1833         * class.c (finish_struct_1): Likewise.
1834
1835         * cp-tree.h (struct lang_type): Add variable_size GTY option.
1836         (struct lang_decl): Likewise.
1837
1838         * parser.c (cp_parser_new): Update comment to not reference
1839         ggc_alloc.
1840
1841 2010-06-07  Jason Merrill  <jason@redhat.com>
1842
1843         PR c++/44366
1844         * error.c (dump_parameters): Mask out TFF_SCOPE.
1845         (dump_simple_decl): Don't print the scope of a PARM_DECL.
1846         (dump_scope): Remove no-op mask.
1847
1848         PR c++/44401
1849         * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1850
1851         * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1852         * init.c (build_offset_ref): Use it.
1853         * pt.c (maybe_process_partial_specialization): Use it.
1854         (instantiate_class_template): Use it.
1855         * search.c (lookup_base): Use it.
1856
1857 2010-06-07  Jakub Jelinek  <jakub@redhat.com>
1858
1859         PR c++/44444
1860         * expr.c (mark_exp_read): Handle INDIRECT_REF.
1861         * cvt.c (convert_to_void): Handle INDIRECT_REF like
1862         handled_component_p.
1863
1864         PR c++/44443
1865         * decl.c (initialize_local_var): If TREE_USED is set on the type,
1866         set also DECL_READ_P on the decl.
1867
1868 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
1869
1870         PR c++/44188
1871         * cp-tree.h (typedef_variant_p): Move this declaration to
1872         gcc/tree.h.
1873         * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1874         * decl.c (grokdeclarator): Do not rename debug info of an
1875         anonymous tagged type named by a typedef.
1876
1877 2010-06-05  Fabien Chêne  <fabien@gcc.gnu.org>
1878
1879         PR c++/44086
1880         * class.c (check_field_decls): Move the call to
1881         check_bitfield_decl before trying to set the
1882         CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1883
1884 2010-06-05  Steven Bosscher  <steven@gcc.gnu.org>
1885
1886         * typeck.c: Update include path for moved files.
1887         * decl.c: Likewise.
1888         * rtti.c: Likewise.
1889         * cp-gimplify.c: Likewise.
1890         * cp-lang.c: Likewise.
1891         * pt.c: Likewise.
1892         * semantics.c: Likewise.
1893         * cxx-pretty-print.h: Likewise.
1894         * decl2.c: Likewise.
1895         * parser.c: Likewise.
1896         * cp-objcp-common.c: Likewise.
1897         * cp-tree.h: Likewise.
1898         * name-lookup.c: Likewise.
1899         * lex.c: Likewise.
1900         * name-lookup.h: Likewise.
1901         * config-lang.in: Update paths in gtfiles for files in c-family/.
1902         * Make-lang.in: Likewise.
1903
1904 2010-06-04  Magnus Fromreide  <magfr@lysator.liu.se>
1905
1906         * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1907         * typeck.c (build_ptrmemfunc): Likewise.
1908
1909 2010-06-04  Jason Merrill  <jason@redhat.com>
1910
1911         * typeck2.c (merge_exception_specifiers): Adjust merging of
1912         throw() and noexcept(true).
1913
1914         * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1915         using an uninitialized variable.
1916
1917         * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1918         (pp_cxx_expression): Likewise.
1919
1920         Implement noexcept-specification (15.4)
1921         * parser.c (cp_parser_exception_specification_opt): Parse it.
1922         Give -Wdeprecated warning about throw() specs.
1923         * pt.c (tsubst_exception_specification): Handle it.
1924         * error.c (dump_exception_spec): Handle it.
1925         (dump_expr): Handle NOEXCEPT_EXPR.
1926         * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1927         * typeck.c (comp_except_specs): Handle compatibility rules.
1928         Change exact parm to take an enum.
1929         * typeck2.c (merge_exception_specifiers): Handle noexcept.
1930         * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1931         (type_throw_all_p, build_noexcept_spec): New fns.
1932         * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1933         (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1934         (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1935         (noexcept_true_spec, noexcept_false_spec): New macros.
1936         * name-lookup.c (pushdecl_maybe_friend): Adjust.
1937         * search.c (check_final_overrider): Adjust.
1938         * decl.c (check_redeclaration_exception_specification): Adjust.
1939         (use_eh_spec_block): Use type_throw_all_p.
1940         (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1941         Give operator new a noexcept-specification in C++0x mode.
1942         * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1943         (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1944
1945         Implement noexcept operator (5.3.7)
1946         * cp-tree.def (NOEXCEPT_EXPR): New.
1947         * except.c (check_noexcept_r, finish_noexcept_expr): New.
1948         * cp-tree.h: Declare finish_noexcept_expr.
1949         * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1950         * pt.c (tsubst_copy_and_build): And tsubst it.
1951         (type_dependent_expression_p): Handle it.
1952         (value_dependent_expression_p): Handle it.
1953
1954         * call.c (build_conditional_expr): Never fold in unevaluated context.
1955         * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1956         * semantics.c (simplify_aggr_init_expr): Likewise.
1957         * typeck.c (merge_types): Call merge_exception_specifiers.
1958         * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1959         DECL_ANTICIPATED for preferring new type.
1960
1961 2010-06-04  Joseph Myers  <joseph@codesourcery.com>
1962
1963         * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1964         diagnostics.
1965
1966 2010-06-04  Jakub Jelinek  <jakub@redhat.com>
1967
1968         PR c++/44412
1969         * typeck.c (build_class_member_access_expr): Call mark_exp_read
1970         on object for static data members.
1971
1972 2010-06-04  Jakub Jelinek  <jakub@redhat.com>
1973             Jason Merrill  <jason@redhat.com>
1974
1975         PR c++/44362
1976         * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1977         with the same type, call mark_lvalue_use on both.
1978
1979 2010-06-03  Nathan Froyd  <froydnj@codesourcery.com>
1980
1981         * class.c (struct vtbl_init_data_s): Remove last_init field.
1982         (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1983         to a VEC.
1984         (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1985         initializers.
1986         (build_vtt): Likewise.
1987         (initialize_vtable): Take a VEC instead of a tree.
1988         (build_vtt_inits): Change return type to void.  Take a VEC **
1989         instead of a tree *; accumulate results into said VEC.
1990         (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1991         accumulated initializers.  Pass the vtable to accumulate_vtbl_inits.
1992         (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1993         instead of a tree.
1994         (dfs_accumulate_vtbl_inits): Likewise.  Change return type to void.
1995         (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1996         into it.
1997         (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1998         rather than tree_cons.
1999         (build_vbase_offset_vtbl_entries): Likewise.
2000         (add_vcall_offset): Likewise.
2001         (build_rtti_vtbl_entries): Likewise.
2002         * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
2003         * decl.c (initialize_artificial_var): Use build_constructor instead
2004         of build_constructor_from_list.
2005
2006 2010-06-03  H.J. Lu  <hongjiu.lu@intel.com>
2007
2008         PR c++/44294
2009         * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
2010         bit-field.
2011
2012 2010-06-02  Jonathan Wakely  <jwakely.gcc@gmail.com>
2013
2014         * parser.c (cp_parser_mem_initializer_list): Change error text.
2015
2016 2010-06-02  Jakub Jelinek  <jakub@redhat.com>
2017
2018         * cp-objcp-common.c (shadowed_var_for_decl): Change into
2019         tree_decl_map hashtab from tree_map.
2020         (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2021         (init_shadowed_var_for_decl): Adjust initialization.
2022
2023         PR c++/44361
2024         * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2025         instead of calling mark_exp_read only when not an assignment.
2026
2027         PR debug/44367
2028         * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2029         DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2030         Set DECL_VALUE_EXPR on var.
2031
2032 2010-06-02  Jason Merrill  <jason@redhat.com>
2033
2034         * error.c (dump_type): Improve typedef handling.
2035
2036         PR c++/9726
2037         PR c++/23594
2038         PR c++/44333
2039         * name-lookup.c (same_entity_p): New.
2040         (ambiguous_decl): Multiple declarations of the same entity
2041         are not ambiguous.
2042
2043 2010-06-01  Jason Merrill  <jason@redhat.com>
2044
2045         DR 990
2046         * call.c (add_list_candidates): Prefer the default constructor.
2047         (build_aggr_conv): Treat missing initializers like { }.
2048         * typeck2.c (process_init_constructor_record): Likewise.
2049         * init.c (expand_default_init): Use digest_init for
2050         direct aggregate initialization, too.
2051
2052         * call.c (add_list_candidates): Split out...
2053         (build_user_type_conversion_1): ...from here.
2054         (build_new_method_call): And here.
2055         (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2056
2057         PR c++/44358
2058         * call.c (build_list_conv): Set list-initialization flags properly.
2059
2060 2010-06-01  Nathan Froyd  <froydnj@codesourcery.com>
2061
2062         * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2063
2064 2010-06-01  Arnaud Charlet  <charlet@adacore.com>
2065             Matthew Gingell  <gingell@adacore.com>
2066
2067         * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2068         * decl2.c: Include langhooks.h and c-ada-spec.h.
2069         (cpp_check, collect_source_refs, collect_ada_namespace,
2070         collect_all_refs): New functions.
2071         (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2072         * lang-specs.h: Ditto.
2073
2074 2010-05-29  Nathan Froyd  <froydnj@codesourcery.com>
2075
2076         * cp-tree.h (cp_build_function_call_nary): Declare.
2077         * typeck.c (cp_build_function_call_nary): Define.
2078         * decl.c (register_dtor_fn): Use it instead of
2079         cp_build_function_call.
2080         (cxx_maybe_build_cleanup): Likewise.
2081         * decl2.c (generate_ctor_or_dtor_function): Likewise.
2082         * except.c (do_get_exception_ptr): Likewise.
2083         (do_begin_catch): Likewise.
2084         (do_allocate_exception): Likewise.
2085         (do_free_exception): Likewise.
2086         (build_throw): Likewise.  Use cp_build_function_call_vec instead
2087         of cp_build_function_call.
2088         (do_end_catch): Likewise.
2089
2090 2010-05-29  Nathan Froyd  <froydnj@codesourcery.com>
2091
2092         * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2093         (struct cp_declarator): Move id_loc field up.
2094
2095 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
2096
2097         * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove.  Require that
2098         this file is included before c-common.h.  Define GCC_DIAG_STYLE
2099         before including diagnostic-core.h and toplev.h.
2100         (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2101         * pt.c: Include cp-tree.h before c-common.h.
2102
2103 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
2104
2105         * tree.c (c_register_addr_space): Add stub.
2106
2107 2010-05-28  Joseph Myers  <joseph@codesourcery.com>
2108
2109         * g++spec.c (lang_specific_driver): Use fatal_error instead of
2110         fatal.
2111
2112 2010-05-28  Dodji Seketeli  <dodji@redhat.com>
2113
2114         Revert fix of PR c++/44188
2115         * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2116         gcc/tree.h.
2117         * tree.c (typedef_variant_p): Revert moving this definition to
2118         gcc/tree.c.
2119         * decl.c (grokdeclarator): Revert naming typedef handling.
2120
2121 2010-05-27  Joseph Myers  <joseph@codesourcery.com>
2122
2123         * call.c: Include diagnostic-core.h instead of diagnostic.h.
2124         * cp-lang.c: Don't include diagnostic.h
2125         * name-lookup.c: Include diagnostic-core.h instead of
2126         diagnostic.h.
2127         (cp_emit_debug_info_for_using): Use seen_error.
2128         * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2129         * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2130         * pt.c (iterative_hash_template_arg): Use seen_error.
2131         * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2132         * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2133         * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2134         cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2135         dependencies.
2136
2137 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
2138
2139         PR c++/44188
2140         * cp-tree.h (typedef_variant_p): Move this declaration to
2141         gcc/tree.h.
2142         * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2143         * decl.c (grokdeclarator): Do not rename debug info of an
2144         anonymous tagged type named by a typedef.
2145
2146 2010-05-27  Jason Merrill  <jason@redhat.com>
2147
2148         PR c++/43555
2149         * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2150         anonymous VLA size.
2151
2152 2010-05-27  Kai Tietz  <kai.tietz@onevision.com>
2153
2154         PR bootstrap/44287
2155         * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2156         * class.c (layout_class_type): Likewise.
2157         * decl.c (finish_enum): Likewise.
2158         * mangle.c (write_builitin_type): Likewise.
2159
2160 2010-05-26  Kai Tietz  <kai.tietz@onevision.com>
2161
2162         * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2163         explicit_int128_p.
2164         * decl.c (grokdeclarator): Handle __int128.
2165         * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2166         (cp_parser_simple_type_specifier): Likewise.
2167         * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2168         * typeck.c (cp_common_type): Handle __int128.
2169         * mangle.c (integer_type_codes): Add itk_int128 and
2170         itk_unsigned_int128.
2171
2172 2010-05-26  Jason Merrill  <jason@redhat.com>
2173
2174         PR c++/43382
2175         * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2176         unification.
2177
2178 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
2179
2180         * cp-lang.c: Do not include expr.h.
2181
2182 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
2183
2184         * decl.c: Do not include rtl.h
2185         * semantics.c: Likewise.
2186
2187 2010-05-25  Steven Bosscher  <steven@gcc.gnu.org>
2188
2189         * cp-tree.h: Do not include splay-tree.h.
2190         (struct prtmem_cst): Remove unused field and false comment.
2191         * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2192         * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2193         * init.c: Do not include rtl.h and expr.h.
2194         * class.c: Do not include rtl.h.  Include splay-tree.h.
2195         (build_clone): Use plain NULL instead of NULL_RTX.
2196         * decl.c: Do not include expr.h.  Explain why rtl.h has to be
2197         included.  Include splay-tree.h.
2198         * method.c: Do not include rtl.h and expr.h.
2199         (use_thunk): Use plain NULL instead of NULL_RTX.
2200         * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2201         * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2202         and target.h.  Include splay-tree.h.
2203         * expr.c: Do not include rtl.h and expr.h.
2204         * pt.c: Do not include obstack.h and rtl.h.
2205         (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2206         (tsubst_decl): Likewise.
2207         (instantiate_decl): Likewise.
2208         * semantics.c: Do not include exprt.h and debug.h.  Explain why
2209         rtl.h has to be included.
2210         * decl2.c: Do not include rtl.h and expr.h.  Include splay-tree.h.
2211         * call.c: Do not include rtl.h and expr.h.
2212         * search.c: Do not include obstack.h and rtl.h.
2213         * friend.c: Do not include rtl.h and expr.h.
2214         * Make-lang.in: Update dependencies.
2215
2216 2010-05-25  Jakub Jelinek  <jakub@redhat.com>
2217
2218         PR c++/18249
2219         * parser.c (non_integral_constant): Add NIC_NONE.
2220         (required_token): Add RT_NONE.
2221         (cp_parser_unary_expression): Initialize non_constant_p
2222         to NIC_NONE.
2223         (cp_parser_asm_definition): Initialize missing to RT_NONE.
2224         (cp_parser_primary_expression, cp_parser_postfix_expression,
2225         cp_parser_cast_expression, cp_parser_binary_expression,
2226         cp_parser_functional_cast): Fix formatting.
2227
2228 2010-05-25  Shujing Zhao  <pearly.zhao@oracle.com>
2229         
2230         PR c++/18249
2231         * parser.c: Remove inclusion of dyn-string.h.
2232         (non_integral_constant): New enum.
2233         (name_lookup_error): New enum.
2234         (required_token): New enum.
2235         (cp_parser_required_error): New function.
2236         (cp_parser_require): Change the type of variable token_desc to
2237         required_token and use cp_parser_required_error.
2238         (cp_parser_require_keyword): Likewise.
2239         (cp_parser_error): Use gmsgid as parameter.
2240         (cp_parser_name_lookup_error): Change the type of variable desired to
2241         name_lookup_error and put the diagnostic in the full sentences. Change
2242         caller.
2243         (cp_parser_non_integral_constant_expression): Change the type of the
2244         variable thing to non_integral_constant and put the diagnostics in
2245         full sentences. Change caller.
2246
2247 2010-05-24  Eric Botcazou  <ebotcazou@adacore.com>
2248
2249         PR middle-end/44100
2250         * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2251
2252 2010-05-24  Joseph Myers  <joseph@codesourcery.com>
2253
2254         * error.c (cp_diagnostic_starter): Update call to
2255         diagnostic_build_prefix.
2256         (cp_print_error_function,
2257         print_instantiation_partial_context_line): Check show_column flag
2258         in context.
2259
2260 2010-05-24  Jason Merrill  <jason@redhat.com>
2261
2262         PR c++/41510
2263         * decl.c (check_initializer): Don't wrap an init-list in a
2264         TREE_LIST.
2265         * init.c (build_aggr_init): Don't assume copy-initialization if
2266         init has CONSTRUCTOR_IS_DIRECT_INIT.
2267         * call.c (build_new_method_call): Sanity check.
2268
2269 2010-05-24  Nathan Froyd  <froydnj@codesourcery.com>
2270
2271         * rtti.c (tinfo_base_init): Use build_constructor instead of
2272         build_constructor_from_list.  Don't cons a tree node for
2273         returning.
2274         (generic_initializer): Use build_constructor_single instead of
2275         build_constructor_from_list.
2276         (ptr_initializer): Use build_constructor instead of
2277         build_constructor_from_list
2278         (ptm_initializer): Likewise.
2279         (class_initializer): Likewise.  Take varargs instead of TRAIL.
2280         (get_pseudo_ti_init): Adjust calls to class_initializer.  Use
2281         build_constructor instead of build_constructor_from_list.
2282
2283 2010-05-22  Steven Bosscher  <steven@gcc.gnu.org>
2284
2285         * semantics.c: Include bitmap.h.
2286         * Make-lang.in: Update dependencies.
2287
2288 2010-05-22  Jan Hubicka  <jh@suse.cz>
2289
2290         * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2291         comdat vtables.
2292         (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2293
2294 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
2295
2296         * cxx-pretty-print.c: Correct merge error.
2297
2298 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
2299
2300         * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2301         (cp_print_error_function): Use diagnostic_abstract_origin macro.
2302         (cp_printer): Handle %K here using percent_K_format.
2303         * cxx-pretty-print.c: Include tree-pretty-print.h.
2304         * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2305         dependencies.
2306
2307 2010-05-21  Steven Bosscher  <steven@gcc.gnu.org>
2308
2309         * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2310         Clean up redundant includes.
2311
2312 2010-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
2313
2314         PR c++/30298
2315         * decl.c (xref_basetypes): Return false in case of ill-formed
2316         redefinition.
2317
2318 2010-05-19  Jason Merrill  <jason@redhat.com>
2319
2320         * call.c (reference_binding): Use cp_build_qualified_type_real
2321         and cp_type_quals consistently.
2322         (add_function_candidate): Likewise.
2323         (build_conditional_expr): Likewise.
2324         (convert_like_real): Likewise.
2325         (type_passed_as): Likewise.
2326         * class.c (add_method): Likewise.
2327         (same_signature_p): Likewise.
2328         (layout_class_type): Likewise.
2329         * decl.c (cxx_init_decl_processing): Likewise.
2330         (cp_fname_init): Likewise.
2331         (grokdeclarator): Likewise.
2332         * decl2.c (cp_reconstruct_complex_type): Likewise.
2333         * init.c (build_new_1): Likewise.
2334         * method.c (do_build_copy_constructor): Likewise.
2335         (implicitly_declare_fn): Likewise.
2336         * pt.c (tsubst_aggr_type): Likewise.
2337         (tsubst): Likewise.
2338         * rtti.c (init_rtti_processing): Likewise.
2339         (build_headof): Likewise.
2340         (build_dynamic_cast_1): Likewise.
2341         (tinfo_base_init): Likewise.
2342         (emit_support_tinfos): Likewise.
2343         * semantics.c (capture_decltype): Likewise.
2344         * tree.c (cv_unqualified): Likewise.
2345         * typeck.c (composite_pointer_type): Likewise.
2346         (string_conv_p): Likewise.
2347
2348         * mangle.c (write_CV_qualifiers_for_type): Tweak.
2349
2350         * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2351         * decl.c (start_decl): Likewise.
2352         * semantics.c (finish_compound_literal): Likewise.
2353         * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2354         (cp_type_readonly): Remove.
2355         * cp-tree.h: Remove declaration.
2356
2357         * typeck.c (merge_types): Preserve memfn quals.
2358
2359         * decl.c (grokdeclarator): Don't check quals on fn type.
2360         * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2361         * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2362
2363         PR c++/44193
2364         * typeck.c (type_memfn_quals): New fn.
2365         (apply_memfn_quals): New fn.
2366         (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2367         (cp_type_readonly): Use cp_type_quals.
2368         * cp-tree.h: Add declarations.
2369         * tree.c (cp_build_qualified_type_real): Don't set, but do
2370         preserve, quals on FUNCTION_TYPE.
2371         (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2372         * decl.c (build_ptrmem_type): Likewise.
2373         (grokdeclarator): Likewise.
2374         (static_fn_type): Likewise.
2375         * decl2.c (change_return_type): Likewise.
2376         (cp_reconstruct_complex_type): Likewise.
2377         * pt.c (tsubst_function_type): Likewise.
2378         (unify): Likewise.
2379         (tsubst): Likewise.  Drop special FUNCTION_TYPE substitution code.
2380
2381 2010-05-18  Nathan Froyd  <froydnj@codesourcery.com>
2382
2383         * tree.c (build_min_non_dep_call_vec): Update comment.
2384
2385 2010-05-17  Jason Merrill  <jason@redhat.com>
2386
2387         * call.c (struct z_candidate): Add explicit_targs field.
2388         (add_template_candidate_real): Set it.
2389         (build_over_call): Use it to control init-list warning.
2390
2391         PR c++/44157
2392         * call.c (build_over_call): Limit init-list deduction warning to
2393         cases where the argument is actually an init-list.
2394
2395         PR c++/44158
2396         * call.c (build_over_call): Don't do bitwise copy for move ctor.
2397
2398 2010-05-17  Dodji Seketeli  <dodji@redhat.com>
2399             Jason Merrill  <jason@redhat.com>
2400
2401         PR c++/44108
2402         * decl.c (compute_array_index_type): Call mark_rvalue_use.
2403
2404 2010-05-15  Jason Merrill  <jason@redhat.com>
2405
2406         * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2407         * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2408         TYPE_NOEXCEPT_P.
2409         (finish_eh_spec_block): Adjust.
2410
2411 2010-05-15  Jakub Jelinek  <jakub@redhat.com>
2412
2413         PR c++/44148
2414         * pt.c (tsubst): Unshare template argument.
2415
2416 2010-05-15  Steven Bosscher  <steven@gcc.gnu.org>
2417
2418         * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2419         * Make-lang.in: Fix dependencies accordingly.
2420
2421 2010-05-14  Jason Merrill  <jason@redhat.com>
2422
2423         C++ DR 475
2424         * except.c (build_throw): Simplify, adjust for DR 475.
2425
2426         PR c++/44127
2427         * except.c (dtor_nothrow): Return nonzero for type with
2428         trivial destructor.
2429
2430         PR c++/44127
2431         * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2432         gimple_build_eh_must_not_throw.
2433
2434 2010-05-14  Martin Jambor  <mjambor@suse.cz>
2435
2436         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2437         and define.
2438
2439 2010-05-14  Jonathan Wakely  <jwakely.gcc@gmail.com>
2440
2441         * call.c (build_new_method_call): Change warning text.
2442         * typeck2.c (build_functional_cast): Change error text.
2443
2444 2010-05-14  Shujing Zhao  <pearly.zhao@oracle.com>
2445
2446         PR c++/30566
2447         * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2448         shadowing the outer parameter or variables by the declaration of
2449         nested function in nested structure or class. Warn the shadowing by
2450         the declaration of nested lambda expression.
2451
2452 2010-05-13  Jason Merrill  <jason@redhat.com>
2453
2454         * typeck.c (cp_build_array_ref): Factor out from...
2455         (build_array_ref): ...here.  Drop complain parm.
2456         (build_new_op): Adjust.
2457         * class.c (build_vtbl_ref_1): Adjust.
2458         * decl2.c (grok_array_decl): Adjust.
2459         * cp-tree.h: Adjust prototypes.
2460
2461 2010-05-13  Jan Hubicka  <jh@suse.cz>
2462
2463         * decl.c (cp_finish_decl): Do not worry about used attribute.
2464
2465 2010-05-12  Jason Merrill  <jason@redhat.com>
2466
2467         * typeck.c (build_array_ref): Take complain parm.
2468         * cp-tree.h: Add it to prototype.
2469         * call.c (build_new_op): Pass it.
2470         * class.c (build_vtbl_ref): Pass it.
2471         * decl2.c (grok_array_decl): Pass it.
2472
2473         PR bootstrap/44048
2474         PR target/44099
2475         * cp-tree.def (NULLPTR_TYPE): Remove.
2476         * cp-tree.h (NULLPTR_TYPE_P): New.
2477         (SCALAR_TYPE_P): Use it.
2478         (nullptr_type_node): New.
2479         (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2480         * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2481         nullptr_type_node.
2482         * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2483         * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2484         * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2485         * mangle.c (write_type): Likewise.
2486         * name-lookup.c (arg_assoc_type): Likewise.
2487         * typeck.c (build_reinterpret_cast_1): Likewise.
2488         * rtti.c (typeinfo_in_lib_p): Likewise.
2489         (emit_support_tinfos): Remove local nullptr_type_node.
2490
2491         * cp-tree.h (UNKNOWN_TYPE): Remove.
2492         * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2493         * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2494         * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2495         * class.c (instantiate_type): Check unknown_type_node rather than
2496         UNKNOWN_TYPE.
2497         * name-lookup.c (maybe_push_decl): Likewise.
2498         * rtti.c (get_tinfo_decl_dynamic): Likewise.
2499         (get_typeid): Likewise.
2500         * semantics.c (finish_offsetof): Likewise.
2501
2502         PR c++/20669
2503         * call.c (add_template_candidate_real): If deduction fails, still
2504         add the template as a non-viable candidate.
2505         (equal_functions): Handle template candidates.
2506         (print_z_candidate): Likewise.
2507         (print_z_candidates): Likewise.
2508         (build_new_function_call): Likewise.
2509
2510         * cp-tree.h (LOOKUP_LIST_ONLY): New.
2511         * call.c (add_candidates): Enforce it.
2512         (build_new_method_call): Try non-list ctor if no viable list ctor.
2513         (build_user_type_conversion_1): Likewise.
2514
2515         * call.c (add_candidates): Distinguish between type(x) and
2516         x.operator type().
2517         (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2518         (build_new_method_call): Give better error for conversion op.
2519
2520         * call.c (add_candidates): Add first_arg and return_type parms.
2521         Add special constructor/conversion op handling.
2522         (convert_class_to_reference): Use it.
2523         (build_user_type_conversion_1): Likewise.
2524         (build_op_call): Likewise.
2525         (build_new_method_call): Likewise.
2526         (build_new_op): Adjust.
2527         (perform_overload_resolution): Adjust.
2528
2529 2010-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
2530
2531         PR c++/34272
2532         PR c++/43630
2533         PR c++/34491
2534         * pt.c (process_partial_specialization): Return error_mark_node
2535         in case of unused template parameters in partial specialization.
2536
2537 2010-05-11  Jakub Jelinek  <jakub@redhat.com>
2538
2539         PR c++/44062
2540         * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2541         * cvt.c (convert_to_void): ... but here.  If expr is a COMPOUND_EXPR,
2542         look at its second operand.
2543
2544 2010-05-10  Jason Merrill  <jason@redhat.com>
2545
2546         PR c++/44017
2547         * semantics.c (baselink_for_fns): Revert earlier change.
2548
2549         PR c++/44045
2550         * typeck.c (cp_build_modify_expr): Complain about assignment to
2551         array from init list.
2552
2553 2010-05-10  Fabien Chêne  <fabien.chene@gmail.com>
2554
2555         PR c++/43719
2556         * decl.c (check_initializer): strip array type before checking for
2557         uninitialized const or ref members.
2558
2559 2010-05-07  Fabien Chêne  <fabien.chene@gmail.com>
2560
2561         PR c++/43951
2562         * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2563         error count. Emit errors only if compain is true.
2564         (build_new_1): Do not return error_mark_node if
2565         diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2566         errors. Delay the check for user-provided constructor.
2567         (perform_member_init): Adjust.
2568         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2569         prototype.
2570
2571 2010-05-06  Magnus Fromreide  <magfr@lysator.liu.se>
2572             Jason Merrill  <jason@redhat.com>
2573
2574         Add support for C++0x nullptr.
2575         * cp-tree.def: Add NULLPTR_TYPE.
2576         * cp-tree.h: Add nullptr_node.
2577         (cp_tree_index): Add CPTI_NULLPTR.
2578         (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2579         * call.c (null_ptr_cst_p): Handle nullptr.
2580         (standard_conversion): Likewise.
2581         (convert_arg_to_ellipsis): Likewise.
2582         * mangle.c (write_type): Likewise.
2583         * name-lookup.c (arg_assoc_type): Likewise.
2584         * parser.c (cp_parser_primary_expression): Likewise.
2585         * typeck.c (cp_build_binary_op): Likewise.
2586         (build_reinterpret_cast_1): Likewise.
2587         * error.c (dump_type): Likewise.
2588         (dump_type_prefix, dump_type_suffix): Likewise.
2589         * decl.c (cxx_init_decl_processing): Likewise.
2590         * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2591         * cvt.c (ocp_convert): Likewise.
2592         * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2593         nullptr_t tinfo in libsupc++.
2594
2595 2010-05-06  Jason Merrill  <jason@redhat.com>
2596
2597         * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2598
2599 2010-04-22  Jakub Jelinek <jakub@redhat.com>
2600             Dodji Seketeli <dodji@redhat.com>
2601
2602         PR c/18624
2603         * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2604         Declare ...
2605         * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2606         * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2607         (decay_conversion, perform_integral_promotions): Call rvalue_use.
2608         (cp_build_unary_op): Call lvalue_use.
2609         * decl.c (unused_but_set_errorcount): New variable.
2610         (poplevel): Issue -Wunused-but-set-variable diagnostics.
2611         (duplicate_decls): Merge DECL_READ_P flags.
2612         (start_cleanup_fn): Set DECL_READ_P flag.
2613         (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2614         * tree.c (rvalue): Call rvalue_use.
2615         * pt.c (convert_nontype_argument): Likewise.
2616         * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2617         finish_decltype_type): Likewise.
2618         * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2619         (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2620         or rvalue_use depending on the expr.
2621         * init.c (build_new, build_delete): Likewise.
2622         * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2623
2624 2010-05-05  Jason Merrill  <jason@redhat.com>
2625
2626         PR c++/43787
2627         * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2628         * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2629
2630 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
2631
2632         PR c++/43028
2633         * pt.c (unify): Check each elt for error_mark_node.
2634
2635 2010-05-04  Jason Merrill  <jason@redhat.com>
2636
2637         PR c++/38064
2638         * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2639
2640 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
2641
2642         PR c++/43705
2643         * call.c (build_new_method_call): Return error_mark_node if fns is
2644         NULL_TREE.
2645
2646 2010-05-03  Dodji Seketeli  <dodji@redhat.com>
2647
2648         PR c++/43953
2649         * pt.c (most_specialized_class): Pretend we are processing
2650         a template decl during the call to coerce_template_parms.
2651
2652 2010-05-03  Jason Merrill  <jason@redhat.com>
2653
2654         PR c++/42810
2655         PR c++/43680
2656         * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2657         from the selected underlying type unless -fstrict-enums.  Set
2658         ENUM_UNDERLYING_TYPE to have the restricted range.
2659         * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2660         * class.c (check_bitfield_decl): Likewise.
2661
2662 2010-05-01  H.J. Lu  <hongjiu.lu@intel.com>
2663
2664         PR c++/43951
2665         * init.c (build_new_1): Revert the accidental checkin in
2666         revision 158918.
2667
2668 2010-04-30  Jason Merrill  <jason@redhat.com>
2669
2670         PR c++/43868
2671         * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2672         (pp_cxx_type_specifier_seq): ...here.
2673
2674 2010-04-30  Steven Bosscher  <steven@gcc.gnu.org>
2675
2676         * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2677         * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2678
2679 2010-04-30  Shujing Zhao  <pearly.zhao@oracle.com>
2680
2681         PR c++/43779
2682         * typeck.c (warn_args_num): New function.
2683         (convert_arguments): Use warn_args_num to print the diagnostic
2684         messages. 
2685
2686 2010-04-29  Fabien Chêne  <fabien.chene@gmail.com>
2687
2688         PR c++/43890
2689         * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2690         user-provided constructor while recursing.
2691
2692 2010-04-28  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2693
2694         PR c++/9335
2695         * error.c (print_instantiation_partial_context_line): Handle
2696         recursive instantiation.
2697         (print_instantiation_partial_context): Likewise.
2698
2699 2010-04-27  Jason Merrill  <jason@redhat.com>
2700
2701         * init.c (perform_member_init): Check CLASS_TYPE_P.
2702
2703 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
2704
2705         PR c++/29043
2706         * init.c (perform_member_init): check for uninitialized const or
2707         reference members, including array types.
2708
2709 2010-04-24  Jason Merrill  <jason@redhat.com>
2710
2711         * tree.c (get_fns): Split out from get_first_fn.
2712         * cp-tree.h: Declare it.
2713         * search.c (shared_member_p): Use it.
2714         * semantics.c (finish_qualified_id_expr): Simplify.
2715         (finish_id_expression): Simplify.
2716
2717         * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2718         whenever object is NULL_TREE.  Don't do 'this' capture here.
2719         (finish_qualified_id_expr): Pass NULL_TREE.
2720         (finish_id_expression): Likewise.
2721         (lambda_expr_this_capture): Likewise.
2722
2723         * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2724         rather than checking current_class_ref directly.
2725         (finish_call_expr): Likewise.
2726
2727         PR c++/43856
2728         * name-lookup.c (qualify_lookup): Disqualify lambda op().
2729         * class.c (current_nonlambda_class_type): New fn.
2730         * semantics.c (nonlambda_method_basetype): New.
2731         * cp-tree.h: Declare them.
2732         * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2733
2734         * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2735
2736         PR c++/43875
2737         * semantics.c (lambda_return_type): Complain about
2738         braced-init-list.
2739
2740         PR c++/43790
2741         * tree.c (cv_unqualified): Handle error_mark_node.
2742
2743         PR c++/41468
2744         * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2745         if we don't want errors.
2746
2747         PR c++/41468
2748         * class.c (convert_to_base): Add complain parameter.  Pass
2749         ba_quiet to lookup_base if we don't want errors.
2750         (build_vfield_ref): Pass complain to convert_to_base.
2751         * call.c (convert_like_real): Likewise.
2752         (initialize_reference): Likewise.
2753         (perform_direct_initialization_if_possible): Pass complain to
2754         convert_like_real.
2755         * cp-tree.h: Adjust.
2756
2757 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
2758             Jason Merrill  <jason@redhat.com>
2759
2760         PR c++/42844
2761         * decl.c (check_for_uninitialized_const_var): Handle classes that need
2762         constructing, too.
2763         (check_initializer): Call it for classes that need constructing, too.
2764         * class.c (in_class_defaulted_default_constructor): New.
2765         * cp-tree.h: Declare it.
2766
2767 2010-04-20  Jason Merrill  <jason@redhat.com>
2768
2769         PR c++/9335
2770         * init.c (constant_value_1): Treat error_mark_node as a constant
2771         if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2772         * cvt.c (ocp_convert): Handle getting error_mark_node from
2773         integral_constant_value.
2774         * decl.c (compute_array_index_type): Likewise.
2775
2776 2010-04-20  Dodji Seketeli  <dodji@redhat.com>
2777
2778         PR c++/43800
2779         PR c++/43704
2780         * typeck.c (incompatible_dependent_types_p): If one of the
2781         compared types if not a typedef then honour their main variant
2782         equivalence.
2783
2784 2010-04-20  Jakub Jelinek  <jakub@redhat.com>
2785
2786         * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2787
2788 2010-04-19  Dodji Seketeli  <dodji@redhat.com>
2789
2790         PR c++/43704
2791         * typeck.c (structural_comptypes): Test dependent typedefs
2792         incompatibility before testing for their main variant based
2793         equivalence.
2794
2795 2010-04-19  Jakub Jelinek  <jakub@redhat.com>
2796
2797         * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2798         ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2799
2800 2010-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2801
2802         * decl.c (cxx_init_decl_processing): Remove second argument in call to
2803         build_common_tree_nodes.
2804
2805 2010-04-14  Jason Merrill  <jason@redhat.com>
2806
2807         PR c++/36625
2808         * parser.c (cp_parser_parenthesized_expression_list): Change
2809         is_attribute_list parm to int to indicate whether or not to
2810         handle initial identifier specially.
2811         (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2812
2813 2010-04-13  Jason Merrill  <jason@redhat.com>
2814
2815         * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2816         CLASS_TYPE_P.
2817         * parser.c (cp_parser_lambda_expression): Complain about lambda in
2818         unevaluated context.
2819         * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2820
2821 2010-04-12  Jason Merrill  <jason@redhat.com>
2822
2823         PR c++/43641
2824         * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2825         return value directly.
2826
2827         * call.c (type_decays_to): Call cv_unqualified for non-class type.
2828
2829 2010-04-12  Fabien Chene  <fabien.chene@gmail.com>
2830
2831         PR c++/25811
2832         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2833         * init.c (build_new_1): Check for uninitialized const members and
2834         uninitialized reference members, when using new without
2835         new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2836         (diagnose_uninitialized_cst_or_ref_member): Define, call
2837         diagnose_uninitialized_cst_or_ref_member_1.
2838         (diagnose_uninitialized_cst_or_ref_member_1): New function.
2839
2840 2010-04-12  Richard Guenther  <rguenther@suse.de>
2841
2842         PR c++/43611
2843         * semantics.c (expand_or_defer_fn_1): Do not keep extern
2844         template inline functions.
2845
2846 2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2847
2848         PR c++/28584
2849         * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2850         pointer type.
2851
2852 2010-04-07  Jason Merrill  <jason@redhat.com>
2853
2854         PR c++/43016
2855         * decl.c (start_preparsed_function): Do defer nested functions.
2856
2857         PR c++/11094, DR 408
2858         * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2859         * decl2.c (finish_static_data_member_decl): Set it.
2860         * decl.c (duplicate_decls): Propagate it.
2861         * pt.c (tsubst_decl): Don't substitute the domain of an array
2862         VAR_DECL if it's set.
2863         (regenerate_decl_from_template): Substitute it here.
2864         (type_dependent_expression_p): Return true if it's set.
2865         * semantics.c (finish_decltype_type): Instantiate such a variable.
2866         * typeck.c (cxx_sizeof_expr): Likewise.
2867         (strip_array_domain): New.
2868
2869         PR c++/43145
2870         * name-lookup.c (current_decl_namespace): Non-static.
2871         (pop_nested_namespace): Sanity check.
2872         * cp-tree.h: Declare current_decl_namespace.
2873         * decl.c (grokvardecl): Use it instead of current_namespace.
2874         (grokfndecl): Likewise.
2875
2876         PR c++/38392
2877         * pt.c (tsubst_friend_function): Instatiate a friend that has already
2878         been used.
2879
2880         * pt.c (print_template_statistics): New.
2881         * cp-tree.h: Declare it.
2882         * tree.c (cxx_print_statistics): Call it.
2883
2884         PR c++/41970
2885         * decl.c (grokvardecl): Tweak warning message.
2886         (grokfndecl): Likewise.
2887
2888 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
2889
2890         PR c++/42697
2891         *pt.c (tsubst_decl): Get the arguments of a specialization from
2892         the specialization template, not from the most general template.
2893
2894 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
2895
2896         PR c++/40239
2897         * typeck2.c (process_init_constructor_record):
2898         value-initialize members that are are not explicitely
2899         initialized.
2900
2901 2010-04-07  Jie Zhang  <jie@codesourcery.com>
2902
2903         PR c++/42556
2904         * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2905         when all of its elements are non-constant and have been split out.
2906
2907 2010-04-06  Taras Glek  <taras@mozilla.com>
2908             Jason Merrill  <jason@redhat.com>
2909
2910         * parser.c (cp_parser_class_specifier): Set class location to that
2911         of IDENTIFIER_NODE instead of '{' when possible.
2912         * semantics.c (begin_class_definition): Do not overide locations
2913         with less precise ones.
2914
2915 2010-04-06  Jason Merrill  <jason@redhat.com>
2916
2917         PR c++/43648
2918         * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2919
2920         PR c++/43621
2921         * pt.c (maybe_update_decl_type): Check the return value from
2922         push_scope.
2923
2924 2010-04-01  Jason Merrill  <jason@redhat.com>
2925
2926         * decl.c (next_initializable_field): No longer static.
2927         * cp-tree.h: Declare it.
2928         * call.c (build_aggr_conv): Fail if there are more initializers
2929         than initializable fields.
2930
2931         * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2932         instead of void_zero_node.
2933
2934 2010-03-31  Dodji Seketeli  <dodji@redhat.com>
2935
2936         PR c++/43558
2937         * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2938         * pt.c (end_template_parm_list): Store sibling template parms of
2939         each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2940         (push_template_decl_real): Don't store the containing template decl
2941         into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2942         * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2943         of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2944         Simplify the logic.
2945
2946 2010-03-30  Jason Merrill  <jason@redhat.com>
2947
2948         PR c++/43076
2949         * pt.c (push_template_decl_real): Deal better with running out of
2950         scopes before running out of template parms.
2951
2952         PR c++/41185
2953         PR c++/41786
2954         * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2955         function parameter context.  Don't print an error if parsing
2956         tentatively.
2957
2958         PR c++/43559
2959         * pt.c (more_specialized_fn): Don't control cv-qualifier check
2960         with same_type_p.
2961
2962 2010-03-26  Jason Merrill  <jason@redhat.com>
2963
2964         PR c++/43509
2965         * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2966         c++0x mode, but not other type-names.
2967
2968 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
2969
2970         PR c++/43327
2971         * pt.c (add_to_template_args): Support NULL ARGS;
2972         (most_specialized_class): call coerce_template_parms on
2973         template arguments passed to get_class_bindings. Use
2974         add_to_template_args.
2975         (unify): Handle VAR_DECLs.
2976
2977 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
2978
2979         * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2980         into int.
2981         * pt.c (get_template_parms_at_level): Adjust.
2982
2983 2010-03-25  Dodji Seketeli  <dodji@redhat.com>
2984
2985         PR c++/43206
2986         * cp-tree.h (get_template_parms_at_level): Declare ...
2987         * pt.c (get_template_parms_at_level): ... new function.
2988         * typeck.c (get_template_parms_of_dependent_type): If a template
2989         type parm's DECL_CONTEXT isn't yet set, get its siblings from
2990         current_template_parms. Use get_template_parms_at_level. Remove
2991         useless test.
2992         (incompatible_dependent_types_p): If we get empty parms from just one
2993         of the template type parms we are comparing then the template parms are
2994         incompatible.
2995
2996 2010-03-24  Jason Merrill  <jason@redhat.com>
2997
2998         PR c++/43502
2999         * parser.c (make_declarator): Initialize id_loc.
3000         (cp_parser_lambda_declarator_opt): And set it.
3001
3002 2010-03-23  Jason Merrill  <jason@redhat.com>
3003
3004         Make lambda conversion op and op() non-static.
3005         * semantics.c (maybe_add_lambda_conv_op): Make non-static.
3006         Also add the thunk function returned by the conversion op.
3007         Mark the conversion deleted if the op() is variadic.
3008         * decl2.c (mark_used): Give helpful message about deleted conversion.
3009         * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
3010         * semantics.c (finish_this_expr): Adjust.
3011         * mangle.c (write_closure_type_name): Adjust.
3012         * decl.c (grok_op_properties): Don't allow it.
3013         * call.c (build_user_type_conversion_1): No static conversion ops.
3014         (build_op_call): Or op().
3015
3016         * decl2.c (change_return_type): Fix 'this' quals.
3017
3018 2010-03-22  Jason Merrill  <jason@redhat.com>
3019
3020         PR c++/43333
3021         * tree.c (pod_type_p): Use old meaning in C++98 mode.
3022
3023         PR c++/43281
3024         * pt.c (contains_auto_r): New fn.
3025         (do_auto_deduction): Use it.
3026         (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3027
3028 2010-03-20  Simon Martin  <simartin@users.sourceforge.net>
3029
3030         PR c++/43081:
3031         * decl2.c (grokfield): Handle invalid initializers for member
3032         functions.
3033
3034 2010-03-20  Dodji Seketeli  <dodji@redhat.com>
3035
3036         PR c++/43375
3037         * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3038         is NULL.
3039         * decl2.c (vague_linkage_p): Likewise.
3040
3041 2010-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
3042
3043         PR c++/43418
3044         * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3045         false, in the cp_parser_expression_statement call.
3046
3047 2010-03-05  Jason Merrill  <jason@redhat.com>
3048
3049         * mangle.c (mangle_decl): Give name collision error even without
3050         ASM_OUTPUT_DEF.
3051
3052 2010-03-04  Marco Poletti  <poletti.marco@gmail.com>
3053
3054         * pt.c (process_partial_specialization): Use error_n instead of
3055         error.
3056
3057 2010-03-03  Jason Merrill  <jason@redhat.com>
3058
3059         PR c++/12909
3060         * mangle.c (mangle_decl): Handle VAR_DECL, too.
3061
3062 2010-03-03  Jason Merrill  <jason@redhat.com>
3063
3064         PR c++/12909
3065         * mangle.c: Include cgraph.h.
3066         (mangle_decl): If the mangled name will change in a later
3067         ABI version, make the later mangled name an alias.
3068         * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3069         * Make-lang.in (mangle.o): Depend on cgraph.h.
3070         * method.c (make_alias_for): Handle VAR_DECL, too.
3071         * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3072         * tree.c (no_linkage_check): Adjust.
3073         * decl.c (maybe_commonize_var): Adjust.
3074         * cp-tree.h: Adjust.
3075
3076 2010-03-01  Marco Poletti  <poletti.marco@gmail.com>
3077
3078         * pt.c (redeclare_class_template): Use error_n and inform_n.
3079
3080 2010-02-27  Mark Mitchell  <mark@codesourcery.com>
3081
3082         PR c++/42748
3083         * cp-tree.h (push_tinst_level): Declare.
3084         (pop_tinst_level): Likewise.
3085         * pt.c (push_tinst_level): Give it external linkage.
3086         (pop_tinst_level): Likewise.
3087         * mangle.c (mangle_decl_string): Set the source location to that
3088         of the decl while mangling.
3089
3090 2010-02-27  Simon Martin  <simartin@users.sourceforge.net>
3091
3092         PR c++/42054
3093         * pt.c (redeclare_class_template): Return false if there are erroneous
3094         template parameters.
3095
3096 2010-02-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3097
3098         * pt.c (push_tinst_level): Replace -ftemplate-depth- with 
3099         -ftemplate-depth=.
3100
3101 2010-02-24  Jason Merrill  <jason@redhat.com>
3102
3103         PR c++/12909
3104         * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3105
3106         * class.c (layout_class_type): Don't give -Wabi warning for a bug
3107         in a previous ABI version.
3108
3109 2010-02-23  Jason Merrill  <jason@redhat.com>
3110
3111         PR c++/43143
3112         * typeck2.c (digest_init_r): Accept value init of array.
3113
3114 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3115
3116         PR c++/43126
3117         * typeck.c (convert_arguments): Update error message.
3118
3119 2010-02-22  Mike Stump  <mikestump@comcast.net>
3120
3121         PR c++/43125
3122         * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3123
3124 2010-02-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3125
3126         PR c++/23510
3127         * error.c (print_instantiation_partial_context_line): New.
3128         (print_instantiation_partial_context): Print at most 12 contexts,
3129         skip the rest with a message.
3130
3131 2010-02-21  Dodji Seketeli  <dodji@redhat.com>
3132
3133         PR c++/42824
3134         * pt.c (lookup_template_class): Better support of specialization
3135         of member of class template implicit instantiation.
3136
3137 2010-02-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3138
3139         PR c++/35669
3140         * call.c (conversion_null_warnings): Replace -Wconversion with
3141         -Wconversion-null.
3142         * cvt.c (build_expr_type_conversion): Likewise.
3143
3144 2010-02-18  Jason Merrill  <jason@redhat.com>
3145
3146         PR c++/42837
3147         * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3148
3149         PR c++/43108
3150         * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3151         C build_binary_op.
3152         * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3153         * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3154
3155         PR c++/43070
3156         * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3157
3158         PR c++/26261
3159         PR c++/43101
3160         * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3161         (maybe_update_decl_type): New fn.
3162         * parser.c (cp_parser_init_declarator): Use it.
3163
3164         PR c++/43109
3165         * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3166
3167 2010-02-17  Jason Merrill  <jason@redhat.com>
3168
3169         PR c++/43075
3170         * call.c (build_over_call): Don't create zero-sized assignments.
3171         * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3172         * cp-objcp-common.c (cp_expr_size): Remove.
3173         * cp-tree.h: Remove prototype.
3174
3175         PR c++/43069
3176         * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3177         decl we looked up doesn't match.
3178
3179         PR c++/43093
3180         * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3181         have an INIT_EXPR anymore.
3182
3183         PR c++/43079
3184         * pt.c (convert_nontype_argument): Change assert to test.
3185
3186 2010-02-16  Jason Merrill  <jason@redhat.com>
3187
3188         * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3189
3190         PR c++/43031
3191         * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3192         VIEW_CONVERT_EXPR for conversions between structural equality types
3193         that the back end can't tell are the same.
3194
3195         PR c++/43036
3196         * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3197         cv-quals from element here.
3198         (cp_build_qualified_type_real): Not here.  Preserve typedef name.
3199
3200 2010-02-14  Jason Merrill  <jason@redhat.com>
3201
3202         PR c++/41997
3203         * semantics.c (finish_compound_literal): Use
3204         cp_apply_type_quals_to_decl when creating a static variable.
3205
3206 2010-02-12  Jason Merrill  <jason@redhat.com>
3207
3208         PR c++/43024
3209         * name-lookup.h (current_binding_level): Check for null
3210         cp_function_chain.
3211
3212 2010-02-12  Jason Merrill  <jason@redhat.com>
3213
3214         PR c++/43054
3215         * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3216
3217 2010-02-12  Jakub Jelinek  <jakub@redhat.com>
3218
3219         PR c++/43033
3220         * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3221         instead of x.
3222
3223 2010-02-10  Jason Merrill  <jason@redhat.com>
3224
3225         PR c++/41896
3226         * semantics.c (outer_lambda_capture_p): Revert.
3227         (add_capture): Only finish_member_declaration if
3228         we're in the lambda class.
3229         (register_capture_members): New.
3230         * cp-tree.h: Declare it.
3231         * parser.c (cp_parser_lambda_expression): Call it.
3232
3233 2010-02-10  Jason Merrill  <jason@redhat.com>
3234
3235         PR c++/41896
3236         * semantics.c (outer_lambda_capture_p): Use current_function_decl
3237         instead of current_class_type.
3238
3239 2010-02-10  Jason Merrill  <jason@redhat.com>
3240
3241         PR c++/42983, core issue 906
3242         * method.c (defaultable_fn_check): Check virtualness.
3243
3244 2010-02-10  Jason Merrill  <jason@redhat.com>
3245
3246         PR c++/43016
3247         * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3248
3249 2010-02-10  Shujing Zhao  <pearly.zhao@oracle.com>
3250
3251         * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3252         * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3253         translation.
3254         * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3255         (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3256         (cp_parser_parameter_declaration)
3257         (cp_parser_exception_specification_opt)
3258         (cp_parser_exception_declaration): Likewise.
3259         * pt.c (check_default_tmpl_args): Likewise.
3260         * search.c (lookup_field_r): Likewise.
3261
3262 2010-02-09  Jason Merrill  <jason@redhat.com>
3263
3264         PR c++/42399
3265         * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3266
3267 2010-02-09  Jason Merrill  <jason@redhat.com>
3268
3269         PR c++/42370
3270         * decl2.c (change_return_type): New fn.
3271         * semantics.c (apply_lambda_return_type): Use it.
3272         * cp-tree.h: Declare it.
3273
3274 2010-02-05  Richard Guenther  <rguenther@suse.de>
3275
3276         * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3277         * cp-lang.c: Include gt-cp-cp-lang.h.
3278         * config-lang.in (gtfiles): Add cp/cp-lang.c.
3279
3280 2010-02-05  Dodji Seketeli  <dodji@redhat.com>
3281
3282         PR c++/42915
3283         * typeck.c (get_template_parms_of_dependent_type): Try getting
3284         the template parameters fromt the type itself first.
3285
3286 2010-02-03  Jason Merrill  <jason@redhat.com>
3287
3288         PR c++/4926
3289         PR c++/38600
3290         * mangle.c (write_unqualified_id): Split out from write_expression.
3291         (write_unqualified_name): Call it.
3292         (write_member_name): Likewise.
3293         (write_expression): Support TEMPLATE_ID_EXPR.
3294         Disambiguate operator names.
3295
3296         PR c++/12909
3297         * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3298         -fabi-version=4.
3299
3300 2010-02-02  Jason Merrill  <jason@redhat.com>
3301
3302         PR c++/41090
3303         * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3304         * optimize.c (clone_body): Remap their initializers when making base
3305         variants.
3306         (maybe_clone_body): Complain if multiple clones aren't safe.
3307
3308 2010-01-29  Dodji Seketeli  <dodji@redhat.com>
3309
3310         PR c++/42758
3311         PR c++/42634
3312         PR c++/42336
3313         PR c++/42797
3314         PR c++/42880
3315         * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3316         SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3317         GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3318         * pt.c (coerce_template_parms, type_unification_real,
3319         expand_template_argument_pack, coerce_template_parameter_pack):
3320         Set the non default template args count.
3321         (current_template_args): Always set non defaulted
3322         template args count when compiled with --enable-checking
3323         (tsubst_template_args, type_unification_real): Propagate the non
3324         defaulted template args count.
3325         * error.c (get_non_default_template_args_count): Renamed
3326         count_non_default_template_args into this. Don't calculate the
3327         non default template argument count anymore. Use the new
3328         accessor macros above to get it.
3329         (dump_template_argument_list, dump_type, dump_decl,
3330         dump_template_parms): Adjust.
3331         * parser.c (cp_parser_template_argument_list): Always set defaulted
3332         template args count when compiled with --enable-checking.
3333
3334 2010-01-29  Shujing Zhao  <pearly.zhao@oracle.com>
3335
3336         * decl.c (redeclaration_error_message): Wrap the return messages into
3337         G_() for easy translation.
3338
3339 2010-01-28  Jason Merrill  <jason@redhat.com>
3340
3341         PR c++/42880
3342         * semantics.c (begin_class_definition): Don't use type_as_string.
3343
3344 2010-01-28  Dodji Seketeli  <dodji@redhat.com>
3345
3346         PR c++/42713
3347         PR c++/42820
3348         * typeck.c (get_template_parms_of_dependent_type): Factorized
3349         this out of incompatible_template_type_parms_p
3350         (incompatible_dependent_types_p): Renamed
3351         incompatible_template_type_parms_p into this. Make it detect
3352         two incompatible dependent typedefs too.
3353         (structural_comptypes): Use incompatible_dependent_types_p.
3354         * pt.c (get_template_info):
3355         Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3356
3357 2010-01-20  Janis Johnson  <janis187@us.ibm.com>
3358             Jason Merrill  <jason@redhat.com>
3359
3360         * mangle.c (write_type): Mangle transparent record as member type.
3361         * semantics.c (begin_class_definition): Recognize decimal classes
3362         and set TYPE_TRANSPARENT_AGGR.
3363
3364 2010-01-20  Jason Merrill  <jason@redhat.com>
3365
3366         PR c++/42338
3367         * mangle.c (write_expression): Handle tree codes that have extra
3368         arguments in the middle-end.
3369
3370 2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
3371
3372         PR c++/42038
3373         * except.c (expand_start_catch_block): Deal correctly with
3374         do_begin_catch returning error_mark_node.
3375
3376 2010-01-20  Jason Merrill  <jason@redhat.com>
3377
3378         PR c++/41788
3379         * class.c (layout_class_type): Set packed_maybe_necessary for packed
3380         non-PODs.
3381
3382         PR c++/41920
3383         * semantics.c (build_lambda_object): Call mark_used on captured
3384         variables.
3385
3386         PR c++/40750
3387         * decl.c (grokdeclarator): Clear type_quals for a member function
3388         declared using a typedef.  Don't complain about adding cv-quals
3389         to a function typedef in C++0x mode.
3390
3391 2010-01-20  Jakub Jelinek  <jakub@redhat.com>
3392
3393         * decl.c (create_array_type_for_decl): Remove set but not used
3394         variable error_msg.  Remove break stmts after return stmts.
3395
3396 2010-01-19  Dodji Seketeli  <dodji@redhat.com>
3397
3398         * error.c (dump_template_parms, count_non_default_template_args):
3399         Revert fix of PR c++/42634.
3400
3401 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
3402
3403         PR c++/42634
3404         * error.c (dump_template_parms): Use innermost template
3405         arguments before calling count_non_default_template_args.
3406         (count_non_default_template_args): We are being called with
3407         template innermost arguments now. There is no need to ensure
3408         that again.
3409
3410 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
3411
3412         PR c++/42766
3413         * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3414
3415 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
3416
3417         PR c++/42697
3418         *pt.c (tsubst_decl):  Revert commit for PR c++/42697.
3419
3420 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
3421
3422         PR c++/42697
3423         *pt.c (tsubst_decl): Get the arguments of a specialization from
3424         the specialization template, not from the most general template.
3425
3426 2010-01-16  Jason Merrill  <jason@redhat.com>
3427
3428         PR c++/42761
3429         * semantics.c (finish_decltype_type): Within a template, treat
3430         unresolved CALL_EXPR as dependent.
3431
3432 2010-01-15  Dodji Seketeli  <dodji@redhat.com>
3433
3434         * error.c (dump_template_parms,count_non_default_template_args):
3435         Revert changes of PR c++/42634.
3436
3437 2010-01-14  Jakub Jelinek  <jakub@redhat.com>
3438
3439         PR middle-end/42674
3440         * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3441         functions with noreturn attribute.
3442
3443 2010-01-14  Jason Merrill  <jason@redhat.com>
3444
3445         PR c++/42701
3446         * call.c (build_new_method_call): Don't free the vec here.
3447
3448         PR c++/42655
3449         * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3450
3451 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
3452
3453         PR c++/42634
3454         * error.c (dump_template_parms): Use innermost template
3455         arguments before calling count_non_default_template_args.
3456         (count_non_default_template_args): We are being called with
3457         template innermost arguments now. There is no need to ensure
3458         that again.
3459
3460 2010-01-07  Dodji Seketeli  <dodji@redhat.com>
3461
3462         c++/40155
3463         * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3464         arguments that were previously deduced.
3465
3466 2010-01-05  Jason Merrill  <jason@redhat.com>
3467
3468         * pt.c (unify_pack_expansion): Handle deduction from init-list.
3469         * call.c (build_over_call): Don't complain about it.
3470
3471 2010-01-04  Jason Merrill  <jason@redhat.com>
3472
3473         PR c++/42555
3474         * pt.c (tsubst_decl): Don't apply type attributes in place.
3475
3476         PR c++/42567
3477         * semantics.c (describable_type): Remove decltype comment and
3478         semantics.
3479
3480
3481 \f
3482 Copyright (C) 2010 Free Software Foundation, Inc.
3483
3484 Copying and distribution of this file, with or without modification,
3485 are permitted in any medium without royalty provided the copyright
3486 notice and this notice are preserved.
3487