OSDN Git Service

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