OSDN Git Service

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