OSDN Git Service

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