OSDN Git Service

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