OSDN Git Service

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