OSDN Git Service

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