OSDN Git Service

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