OSDN Git Service

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