OSDN Git Service

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