OSDN Git Service

PR c++/44540
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2010-07-13  Jason Merrill  <jason@redhat.com>
2
3         PR c++/44540
4         * mangle.c (write_type): Canonicalize.
5         (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
6         (write_CV_qualifiers_for_type): Ignore them in abi>=5.
7
8 2010-07-13  Paolo Carlini  <paolo.carlini@oracle.com>
9
10         PR c++/44908
11         * call.c (convert_like_real): Adjust convert_ptrmem call, pass
12         complain argument.
13         * typeck.c (get_delta_difference): Update prototype, add a
14         tsubst_flags_t parameter; update get_delta_difference_1 calls and
15         add checks for error_mark_node.
16         (get_delta_difference_1): Update prototype, add a tsubst_flags_t
17         parameter; update lookup_base call.
18         (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
19         parameter; update get_delta_difference call and add check for
20         error_mark_node.
21         (convert_ptrmem): Update prototype, add a tsubst_flags_t
22         parameter; update get_delta_difference call and add check for
23         error_mark_node;  update build_ptrmemfunc call.
24         (build_static_cast_1): Adjust convert_ptrmem call.
25         (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
26         (cp_build_unary_op): Adjust build_ptrmemfunc call.
27         * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
28         and build_ptrmemfunc calls.
29         * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
30
31 2010-07-12  Paolo Carlini  <paolo.carlini@oracle.com>
32
33         PR c++/44907
34         * call.c (build_temp): Add tsubst_flags_t complain parameter;
35         adjust build_special_member_call call, pass complain.
36         (convert_like_real): Adjust build_temp call, pass complain.
37
38 2010-07-09  Jason Merrill  <jason@redhat.com>
39
40         PR c++/43120
41         * cp-tree.h (BV_LOST_PRIMARY): New macro.
42         * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
43         Set BV_LOST_PRIMARY.
44         (build_vtbl_initializer): Check BV_LOST_PRIMARY.
45
46 2010-07-08  Jason Merrill  <jason@redhat.com>
47
48         PR c++/43120
49         * class.c (update_vtable_entry_for_fn): Fix handling of dummy
50         virtual bases for covariant thunks.
51
52 2010-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
53
54         * cp-tree.h: Do not include toplev.h.
55
56 2010-07-06  Jason Merrill  <jason@redhat.com>
57
58         PR c++/44703
59         * call.c (is_std_init_list): Look through typedefs.
60
61         PR c++/44778
62         * init.c (build_offset_ref): If scope isn't dependent,
63         don't exit early.  Look at TYPE_MAIN_VARIANT.
64         * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
65
66         * error.c (dump_function_decl): Don't crash on null DECL_NAME.
67
68 2010-07-06  Shujing Zhao  <pearly.zhao@oracle.com>
69
70         * cp-tree.h (impl_conv_void): New type.
71         (convert_to_void): Adjust prototype.
72         * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
73         diagnostic for easy translation. Change caller.
74         * typeck.c: Update call to convert_to_void.
75         * semantics.c: Likewise.
76         * init.c: Likewise.
77
78 2010-07-05  Nathan Froyd  <froydnj@codesourcery.com>
79
80         * decl.c (cp_finish_decl): Call add_local_decl.
81         * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
82
83 2010-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
84
85         * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
86         throughout.
87
88 2010-07-05  Shujing Zhao  <pearly.zhao@oracle.com>
89
90         PR c++/22138
91         * parser.c (cp_parser_primary_expression): Error if local template is
92         declared.
93
94 2010-07-02  Le-Chun Wu  <lcwu@google.com>
95
96         PR/44128
97         * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
98         (variable or type) shadows another type.
99
100 2010-07-02  Jakub Jelinek  <jakub@redhat.com>
101
102         PR c++/44780
103         * typeck.c (convert_for_assignment): When converting a convertible
104         vector type or objc++ types, call mark_rvalue_use.
105         * typeck2.c (build_m_component_ref): Use return values from
106         mark_rvalue_use or mark_lvalue_use.
107         * class.c (build_base_path): Likewise.
108         * call.c (build_conditional_expr): Likewise.
109
110 2010-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
111
112         PR c++/44039
113         * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
114         returns NULL_TREE.
115
116 2010-07-01  Richard Guenther  <rguenther@suse.de>
117
118         * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
119         predicate we are looking for, allow non-gimplified
120         INDIRECT_REFs.
121
122 2010-06-30  Paolo Carlini  <paolo.carlini@oracle.com>
123
124         PR c++/44628
125         * typeck.c (cp_build_unary_op): Early return error_mark_node when
126         arg is NULL_TREE too.
127         * call.c (convert_class_to_reference): Return error_mark_node when
128         expr is NULL_TREE.
129
130 2010-06-30  Michael Matz  <matz@suse.de>
131
132         * repo.c (finish_repo): Fix typo.
133
134 2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
135
136         * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
137
138 2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
139
140         * repo.c (pending_repo): Change type to a VEC.
141         (finish_repo): Adjust for new type of pending_repo.
142         (repo_emit_p): Likewise.
143
144 2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
145
146         * tree.c: Include gimple.h. Do not include tree-flow.h
147         * decl.c: Do not include tree-flow.h
148         * Make-lang.in: Adjust dependencies.
149
150 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
151
152         * decl.c (incomplete_var): Declare.  Declare VECs containing them.
153         (incomplete_vars): Adjust comment.  Change type to a VEC.
154         (maybe_register_incomplete_var): Adjust for new type.
155         (complete_vars): Adjust iteration over incomplete_vars.
156
157 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
158
159         * decl.c (struct named_label_entry): Change type of bad_decls field
160         to a VEC.
161         (poplevel_named_label_1): Adjust for new type of bad_decls.
162         (check_goto): Likewise.
163
164 2010-06-29  Jason Merrill  <jason@redhat.com>
165
166         Enable implicitly declared move constructor/operator= (N3053).
167         * class.c (add_implicitly_declared_members): A class with no
168         explicitly declared copy or move constructor gets both declared
169         implicitly, and similarly for operator=.
170         (check_bases): A type with no copy ctor does not inhibit
171         a const copy ctor in a derived class.  It does mean the derived
172         one is non-trivial.
173         (check_field_decl): Likewise.
174         (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
175         * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
176         (trivially_copyable_p): Likewise.
177         * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
178         * class.c (finish_struct_bits): Likewise.
179         * tree.c (build_target_expr_with_type): Likewise.
180         * typeck2.c (store_init_value): Likewise.
181
182         Enable implicitly deleted functions (N2346)
183         * class.c (check_bases_and_members): Adjust lambda flags.
184         * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
185
186         * decl2.c (mark_used): Adjust error for use of deleted function.
187
188         Machinery to support implicit delete/move.
189         * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
190         has_complex_move_ctor, has_complex_move_assign bitfields.
191         (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
192         (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
193         (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
194         (enum special_function_kind): Add sfk_move_assignment.
195         (LOOKUP_SPECULATIVE): New.
196         * call.c (build_over_call): Return early if it's set.
197         (build_over_call): Use trivial_fn_p.
198         * class.c (check_bases): If the base has no default constructor,
199         the derived one is non-trivial.  Handle move ctor/op=.
200         (check_field_decl): Likewise.
201         (check_bases_and_members): Handle move ctor/op=.
202         (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
203         (type_has_move_constructor, type_has_move_assign): New.
204         * decl.c (grok_special_member_properties): Handle move ctor/op=.
205         * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
206         (trivial_fn_p): New.
207         (do_build_copy_constructor): Use it.
208         (do_build_assign_ref): Likewise.  Handle move assignment.
209         (build_stub_type, build_stub_object, locate_fn_flags): New.
210         (locate_ctor): Use locate_fn_flags.
211         (locate_copy, locate_dtor): Remove.
212         (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
213         (process_subob_fn, synthesized_method_walk): New.
214         (maybe_explain_implicit_delete): New.
215         (implicitly_declare_fn): Use synthesized_method_walk,
216         type_has_trivial_fn, and type_set_nontrivial_flag.
217         (defaulted_late_check): Set DECL_DELETED_FN.
218         (defaultable_fn_check): Handle sfk_move_assignment.
219         (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early.  Don't declare
220         implicitly deleted move ctor/op=.
221         * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
222         (lookup_fnfields_slot): New.
223         * semantics.c (omp_clause_info_fndecl): Remove.
224         (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
225         get_copy_assign, trivial_fn_p.
226         (trait_expr_value): Adjust call to locate_ctor.
227         * tree.c (special_function_p): Handle sfk_move_assignment.
228
229         * class.c (type_has_virtual_destructor): New.
230         * cp-tree.h: Declare it.
231         * semantics.c (trait_expr_value): Use it.
232
233         * call.c (build_over_call): Only give warnings with tf_warning.
234
235         * name-lookup.c (pop_scope): Handle NULL_TREE.
236
237         * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
238         (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
239         (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
240         (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
241         (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
242         (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
243         (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
244         (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
245         (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
246         (sfk_assignment_operator): Rename to sfk_copy_assignment.
247         * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
248         * search.c, semantics.c, tree.c: Adjust.
249
250         * pt.c (dependent_scope_ref_p): Remove.
251         (value_dependent_expression_p): Don't call it.
252         (type_dependent_expression_p): Here either.
253         * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
254         if the scope isn't dependent.
255
256         * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
257         a reference.
258
259         PR c++/44587
260         * pt.c (has_value_dependent_address): New.
261         (value_dependent_expression_p): Check it.
262         (convert_nontype_argument): Likewise.  Call decay_conversion before
263         folding if we want a pointer.
264         * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
265         scope is the current instantiation.
266
267 2010-06-28  Jakub Jelinek  <jakub@redhat.com>
268
269         PR c++/44682
270         * class.c (build_base_path): If want_pointer, call mark_rvalue_use
271         on expr.
272
273 2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>
274
275         * init.c: Do not include except.h.
276         * decl.c: Likewise.
277         * expr.c: Likewise.
278         * cp-lang.c: Likewise.
279         * pt.c: Likewise.
280         * semantics.c: Likewise.
281         * decl2.c: Likewise.
282         * except.c: Likewise.
283         (init_exception_processing): Do not set the removed
284         lang_protect_cleanup_actions here.
285         (cp_protect_cleanup_actions): Make non-static and remove prototype.
286         (doing_eh): New, moved from except.c but removed the do_warning flag.
287         (expand_start_catch_block): Update doing_eh call.
288         (expand_end_catch_block): Likewise.
289         (build_throw): Likewise.
290         * cp-tree.h: Prototype cp_protect_cleanup_actions.
291         * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
292         cp_protect_cleanup_actions.
293         * Make-lang.in: Update dependencies.
294
295 2010-06-26  Jason Merrill  <jason@redhat.com>
296
297         * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
298         constructor called with a single argument that takes a reference
299         to the constructor's class.
300         (BAD_CONVERSION_RANK): New.
301         (compare_ics): Use it to compare bad ICSes.
302
303 2010-06-25  Joseph Myers  <joseph@codesourcery.com>
304
305         * lang-specs.h: Remove +e handling.
306
307 2010-06-24  Andi Kleen  <ak@linux.intel.com>
308
309         * parser.c: (cp_parser_question_colon_clause):
310         Switch to use cp_lexer_peek_token.
311         Call warn_for_omitted_condop. Call pedwarn for omitted
312         middle operand.
313
314 2010-06-22  Jakub Jelinek  <jakub@redhat.com>
315
316         PR c++/44619
317         * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
318         datum and mark_rvalue_use on component.
319
320         PR c++/44627
321         * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
322         the CALL_EXPR has no arguments.
323
324 2010-06-21  Jason Merrill  <jason@redhat.com>
325
326         * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
327
328         * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
329         element type.
330
331 2010-06-17  Nathan Froyd  <froydnj@codesourcery.com>
332
333         * name-lookup.c (struct arg_lookup): Convert namespaces and
334         classes fields to VEC.
335         (arg_assoc_namespace): Adjust for new type of namespaces.
336         (arg_assoc_class): Adjust for new type of classes.
337         (lookup_arg_dependent): Use make_tree_vector and
338         release_tree_vector.
339         * typeck2.c (build_x_arrow): Use vec_member.
340
341 2010-06-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>
342
343         PR c++/44486
344         * error.c (dump_decl): Better wording for anonymous namespace.
345
346 2010-06-16  Nathan Froyd  <froydnj@codesourcery.com>
347
348         * class.c (build_vtbl_initializer): Adjust computation of new_position
349         and which entry to add padding for.
350
351 2010-06-16  Jason Merrill  <jason@redhat.com>
352
353         * except.c (check_noexcept_r): Return the problematic function.
354         (finish_noexcept_expr): Give -Wnoexcept warning.  Add complain parm.
355         * pt.c (tsubst_copy_and_build): Pass it.
356         * parser.c (cp_parser_unary_expression): Likewise.
357         * cp-tree.h: Adjust prototype.
358
359         * method.c (defaulted_late_check): Give the defaulted method
360         the same exception specification as the implicit declaration.
361
362 2010-06-15  Jason Merrill  <jason@redhat.com>
363
364         * class.c (add_implicitly_declared_members): Implicit assignment
365         operators can also be virtual overriders.
366         * method.c (lazily_declare_fn): Likewise.
367
368         * call.c (convert_like_real): Give "initializing argument of"
369         information for ambiguous conversion.  Give source position
370         of function.
371
372         * call.c (print_z_candidates): Do print viable deleted candidates.
373         (joust): Don't choose a deleted function just because its worst
374         conversion is better than another candidate's worst.
375
376         * call.c (convert_like_real): Don't complain about
377         list-value-initialization from an explicit constructor.
378
379         * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
380         DECL_SOURCE_LOCATION directly.
381
382         * class.c (type_has_user_provided_default_constructor): Use
383         sufficient_parms_p.
384
385         * call.c (is_subseq): Handle ck_aggr, ck_list.
386         (compare_ics): Treat an aggregate or ambiguous conversion to the
387         same type as involving the same function.
388
389 2010-06-13  Shujing Zhao  <pearly.zhao@oracle.com>
390
391         * typeck.c (convert_for_assignment): Fix comment. Change message
392         format from %d to %qP.
393         (convert_for_initialization): Fix comment. 
394
395 2010-06-11  Shujing Zhao  <pearly.zhao@oracle.com>
396
397         * cp-tree.h (expr_list_kind): New type.
398         (impl_conv_rhs): New type.
399         (build_x_compound_expr_from_list, convert_for_initialization): Adjust
400         prototype.
401         (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
402         diagnostics for easy translation. Change caller.
403         (convert_for_initialization): Use impl_conv_rhs and change caller.
404         (build_x_compound_expr_from_list): Use expr_list_kind and emit the
405         diagnostics for easy translation. Change caller.
406         * decl.c (bad_spec_place): New enum.
407         (bad_specifiers): Use it and emit the diagnostics for easy
408         translation. Change caller.
409         * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
410
411 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
412
413         * cp-tree.h (struct saved_scope): Change decl_ns_list field type
414         to a VEC.
415         * decl2.c (cp_write_global_declarations): Adjust for new type of
416         decl_namespace_list.
417         * name-lookup.c (current_decl_namespace): Likewise.
418         (push_decl_namespace): Likewise.
419         (pop_decl_namespace): Likewise.
420
421 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
422
423         * call.c (build_java_interface_fn_ref): Call build_function_type_list
424         instead of build_function_type.
425         * decl.c (cxx_init_decl_processing): Likewise.
426         (declare_global_var): Likewise.
427         (get_atexit_node): Likewise.
428         (expand_static_init): Likewise.
429         * decl2.c (start_objects): Likewise.
430         (start_static_storage_duration_function): Likewise.
431         * except.c (init_exception_processing): Likewise.
432         (build_exc_ptr): Likewise.
433         (build_throw): Likewise.
434         * rtti.c (throw_bad_cast): Likewise.
435         (throw_bad_typeid): Likewise.
436         (build_dynamic_cast_1): Likewise.
437
438 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
439
440         * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
441         (build_op_delete_call): Likewise.
442         (build_over_call): Likewise.
443         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
444         * pt.c (process_partial_specialization): Likewise.
445         (tsubst_template_args): Likewise.
446         * semantics.c (finish_asm_stmt): Likewise.
447
448 2010-06-08  Nathan Sidwell  <nathan@codesourcery.com>
449
450         * decl.c (record_key_method_defined): New, broken out of ...
451         (finish_function): ... here.  Call it.  
452         (start_decl): Treat aliases as definitions.
453
454 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
455
456         * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
457
458         * pt.c (maybe_process_partial_specialization): Likewise.
459         (register_specialization): Likewise.
460         (add_pending_template): Likewise.
461         (lookup_template_class): Likewise.
462         (push_tinst_level): Likewise.
463
464         * parser.c (cp_lexer_new_main): Likewise.
465         (cp_lexer_new_from_tokens): Likewise.
466         (cp_token_cache_new): Likewise.
467         (cp_parser_context_new): Likewise.
468         (cp_parser_new): Likewise.
469         (cp_parser_nested_name_specifier_opt): Likewise.
470         (cp_parser_template_id): Likewise.
471
472         * name-lookup.c (binding_entry_make): Likewise.
473         (binding_table_construct): Likewise.
474         (binding_table_new): Likewise.
475         (cxx_binding_make): Likewise.
476         (pushdecl_maybe_friend): Likewise.
477         (begin_scope): Likewise.
478         (push_to_top_level): Likewise.
479
480         * lex.c (init_reswords): Likewise.
481         (retrofit_lang_decl): Likewise.
482         (cxx_dup_lang_specific_decl): Likewise.
483         (copy_lang_type): Likewise.
484         (cxx_make_type): Likewise.
485
486         * decl.c (make_label_decl): Likewise.
487         (check_goto): Likewise.
488         (start_preparsed_function): Likewise.
489         (save_function_data): Likewise.
490
491         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
492
493         * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
494
495         * class.c (finish_struct_1): Likewise.
496
497         * cp-tree.h (struct lang_type): Add variable_size GTY option.
498         (struct lang_decl): Likewise.
499
500         * parser.c (cp_parser_new): Update comment to not reference
501         ggc_alloc.
502
503 2010-06-07  Jason Merrill  <jason@redhat.com>
504
505         PR c++/44366
506         * error.c (dump_parameters): Mask out TFF_SCOPE.
507         (dump_simple_decl): Don't print the scope of a PARM_DECL.
508         (dump_scope): Remove no-op mask.
509
510         PR c++/44401
511         * parser.c (cp_parser_lookup_name): Fix naming the constructor.
512
513         * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
514         * init.c (build_offset_ref): Use it.
515         * pt.c (maybe_process_partial_specialization): Use it.
516         (instantiate_class_template): Use it.
517         * search.c (lookup_base): Use it.
518
519 2010-06-07  Jakub Jelinek  <jakub@redhat.com>
520
521         PR c++/44444
522         * expr.c (mark_exp_read): Handle INDIRECT_REF.
523         * cvt.c (convert_to_void): Handle INDIRECT_REF like
524         handled_component_p.
525
526         PR c++/44443
527         * decl.c (initialize_local_var): If TREE_USED is set on the type,
528         set also DECL_READ_P on the decl.
529
530 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
531
532         PR c++/44188
533         * cp-tree.h (typedef_variant_p): Move this declaration to
534         gcc/tree.h.
535         * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
536         * decl.c (grokdeclarator): Do not rename debug info of an
537         anonymous tagged type named by a typedef.
538
539 2010-06-05  Fabien Chêne  <fabien@gcc.gnu.org>
540
541         PR c++/44086
542         * class.c (check_field_decls): Move the call to
543         check_bitfield_decl before trying to set the
544         CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
545
546 2010-06-05  Steven Bosscher  <steven@gcc.gnu.org>
547
548         * typeck.c: Update include path for moved files.
549         * decl.c: Likewise.
550         * rtti.c: Likewise.
551         * cp-gimplify.c: Likewise.
552         * cp-lang.c: Likewise.
553         * pt.c: Likewise.
554         * semantics.c: Likewise.
555         * cxx-pretty-print.h: Likewise.
556         * decl2.c: Likewise.
557         * parser.c: Likewise.
558         * cp-objcp-common.c: Likewise.
559         * cp-tree.h: Likewise.
560         * name-lookup.c: Likewise.
561         * lex.c: Likewise.
562         * name-lookup.h: Likewise.
563         * config-lang.in: Update paths in gtfiles for files in c-family/.
564         * Make-lang.in: Likewise.
565
566 2010-06-04  Magnus Fromreide  <magfr@lysator.liu.se>
567
568         * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
569         * typeck.c (build_ptrmemfunc): Likewise.
570
571 2010-06-04  Jason Merrill  <jason@redhat.com>
572
573         * typeck2.c (merge_exception_specifiers): Adjust merging of
574         throw() and noexcept(true).
575
576         * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
577         using an uninitialized variable.
578
579         * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
580         (pp_cxx_expression): Likewise.
581
582         Implement noexcept-specification (15.4)
583         * parser.c (cp_parser_exception_specification_opt): Parse it.
584         Give -Wdeprecated warning about throw() specs.
585         * pt.c (tsubst_exception_specification): Handle it.
586         * error.c (dump_exception_spec): Handle it.
587         (dump_expr): Handle NOEXCEPT_EXPR.
588         * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
589         * typeck.c (comp_except_specs): Handle compatibility rules.
590         Change exact parm to take an enum.
591         * typeck2.c (merge_exception_specifiers): Handle noexcept.
592         * except.c (nothrow_spec_p, type_noexcept_p): New fns.
593         (type_throw_all_p, build_noexcept_spec): New fns.
594         * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
595         (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
596         (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
597         (noexcept_true_spec, noexcept_false_spec): New macros.
598         * name-lookup.c (pushdecl_maybe_friend): Adjust.
599         * search.c (check_final_overrider): Adjust.
600         * decl.c (check_redeclaration_exception_specification): Adjust.
601         (use_eh_spec_block): Use type_throw_all_p.
602         (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
603         Give operator new a noexcept-specification in C++0x mode.
604         * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
605         (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
606
607         Implement noexcept operator (5.3.7)
608         * cp-tree.def (NOEXCEPT_EXPR): New.
609         * except.c (check_noexcept_r, finish_noexcept_expr): New.
610         * cp-tree.h: Declare finish_noexcept_expr.
611         * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
612         * pt.c (tsubst_copy_and_build): And tsubst it.
613         (type_dependent_expression_p): Handle it.
614         (value_dependent_expression_p): Handle it.
615
616         * call.c (build_conditional_expr): Never fold in unevaluated context.
617         * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
618         * semantics.c (simplify_aggr_init_expr): Likewise.
619         * typeck.c (merge_types): Call merge_exception_specifiers.
620         * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
621         DECL_ANTICIPATED for preferring new type.
622
623 2010-06-04  Joseph Myers  <joseph@codesourcery.com>
624
625         * g++spec.c (lang_specific_driver): Use GCC-specific formats in
626         diagnostics.
627
628 2010-06-04  Jakub Jelinek  <jakub@redhat.com>
629
630         PR c++/44412
631         * typeck.c (build_class_member_access_expr): Call mark_exp_read
632         on object for static data members.
633
634 2010-06-04  Jakub Jelinek  <jakub@redhat.com>
635             Jason Merrill  <jason@redhat.com>
636
637         PR c++/44362
638         * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
639         with the same type, call mark_lvalue_use on both.
640
641 2010-06-03  Nathan Froyd  <froydnj@codesourcery.com>
642
643         * class.c (struct vtbl_init_data_s): Remove last_init field.
644         (struct secondary_vptr_vtt_init_data_s): Change type of inits field
645         to a VEC.
646         (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
647         initializers.
648         (build_vtt): Likewise.
649         (initialize_vtable): Take a VEC instead of a tree.
650         (build_vtt_inits): Change return type to void.  Take a VEC **
651         instead of a tree *; accumulate results into said VEC.
652         (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
653         accumulated initializers.  Pass the vtable to accumulate_vtbl_inits.
654         (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
655         instead of a tree.
656         (dfs_accumulate_vtbl_inits): Likewise.  Change return type to void.
657         (build_vtbl_initializer): Add VEC parameter; accumulate initializers
658         into it.
659         (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
660         rather than tree_cons.
661         (build_vbase_offset_vtbl_entries): Likewise.
662         (add_vcall_offset): Likewise.
663         (build_rtti_vtbl_entries): Likewise.
664         * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
665         * decl.c (initialize_artificial_var): Use build_constructor instead
666         of build_constructor_from_list.
667
668 2010-06-03  H.J. Lu  <hongjiu.lu@intel.com>
669
670         PR c++/44294
671         * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
672         bit-field.
673
674 2010-06-02  Jonathan Wakely  <jwakely.gcc@gmail.com>
675
676         * parser.c (cp_parser_mem_initializer_list): Change error text.
677
678 2010-06-02  Jakub Jelinek  <jakub@redhat.com>
679
680         * cp-objcp-common.c (shadowed_var_for_decl): Change into
681         tree_decl_map hashtab from tree_map.
682         (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
683         (init_shadowed_var_for_decl): Adjust initialization.
684
685         PR c++/44361
686         * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
687         instead of calling mark_exp_read only when not an assignment.
688
689         PR debug/44367
690         * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
691         DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
692         Set DECL_VALUE_EXPR on var.
693
694 2010-06-02  Jason Merrill  <jason@redhat.com>
695
696         * error.c (dump_type): Improve typedef handling.
697
698         PR c++/9726
699         PR c++/23594
700         PR c++/44333
701         * name-lookup.c (same_entity_p): New.
702         (ambiguous_decl): Multiple declarations of the same entity
703         are not ambiguous.
704
705 2010-06-01  Jason Merrill  <jason@redhat.com>
706
707         DR 990
708         * call.c (add_list_candidates): Prefer the default constructor.
709         (build_aggr_conv): Treat missing initializers like { }.
710         * typeck2.c (process_init_constructor_record): Likewise.
711         * init.c (expand_default_init): Use digest_init for
712         direct aggregate initialization, too.
713
714         * call.c (add_list_candidates): Split out...
715         (build_user_type_conversion_1): ...from here.
716         (build_new_method_call): And here.
717         (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
718
719         PR c++/44358
720         * call.c (build_list_conv): Set list-initialization flags properly.
721
722 2010-06-01  Nathan Froyd  <froydnj@codesourcery.com>
723
724         * typeck2.c (build_x_arrow): Make types_memoized a VEC.
725
726 2010-06-01  Arnaud Charlet  <charlet@adacore.com>
727             Matthew Gingell  <gingell@adacore.com>
728
729         * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
730         * decl2.c: Include langhooks.h and c-ada-spec.h.
731         (cpp_check, collect_source_refs, collect_ada_namespace,
732         collect_all_refs): New functions.
733         (cp_write_global_declarations): Add handling of -fdump-ada-spec.
734         * lang-specs.h: Ditto.
735
736 2010-05-29  Nathan Froyd  <froydnj@codesourcery.com>
737
738         * cp-tree.h (cp_build_function_call_nary): Declare.
739         * typeck.c (cp_build_function_call_nary): Define.
740         * decl.c (register_dtor_fn): Use it instead of
741         cp_build_function_call.
742         (cxx_maybe_build_cleanup): Likewise.
743         * decl2.c (generate_ctor_or_dtor_function): Likewise.
744         * except.c (do_get_exception_ptr): Likewise.
745         (do_begin_catch): Likewise.
746         (do_allocate_exception): Likewise.
747         (do_free_exception): Likewise.
748         (build_throw): Likewise.  Use cp_build_function_call_vec instead
749         of cp_build_function_call.
750         (do_end_catch): Likewise.
751
752 2010-05-29  Nathan Froyd  <froydnj@codesourcery.com>
753
754         * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
755         (struct cp_declarator): Move id_loc field up.
756
757 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
758
759         * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove.  Require that
760         this file is included before c-common.h.  Define GCC_DIAG_STYLE
761         before including diagnostic-core.h and toplev.h.
762         (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
763         * pt.c: Include cp-tree.h before c-common.h.
764
765 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
766
767         * tree.c (c_register_addr_space): Add stub.
768
769 2010-05-28  Joseph Myers  <joseph@codesourcery.com>
770
771         * g++spec.c (lang_specific_driver): Use fatal_error instead of
772         fatal.
773
774 2010-05-28  Dodji Seketeli  <dodji@redhat.com>
775
776         Revert fix of PR c++/44188
777         * cp-tree.h (typedef_variant_p): Revert moving this declaration to
778         gcc/tree.h.
779         * tree.c (typedef_variant_p): Revert moving this definition to
780         gcc/tree.c.
781         * decl.c (grokdeclarator): Revert naming typedef handling.
782
783 2010-05-27  Joseph Myers  <joseph@codesourcery.com>
784
785         * call.c: Include diagnostic-core.h instead of diagnostic.h.
786         * cp-lang.c: Don't include diagnostic.h
787         * name-lookup.c: Include diagnostic-core.h instead of
788         diagnostic.h.
789         (cp_emit_debug_info_for_using): Use seen_error.
790         * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
791         * parser.c: Include diagnostic-core.h instead of diagnostic.h.
792         * pt.c (iterative_hash_template_arg): Use seen_error.
793         * repo.c: Include diagnostic-core.h instead of diagnostic.h.
794         * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
795         * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
796         cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
797         dependencies.
798
799 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
800
801         PR c++/44188
802         * cp-tree.h (typedef_variant_p): Move this declaration to
803         gcc/tree.h.
804         * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
805         * decl.c (grokdeclarator): Do not rename debug info of an
806         anonymous tagged type named by a typedef.
807
808 2010-05-27  Jason Merrill  <jason@redhat.com>
809
810         PR c++/43555
811         * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
812         anonymous VLA size.
813
814 2010-05-27  Kai Tietz  <kai.tietz@onevision.com>
815
816         PR bootstrap/44287
817         * rtti.c (emit_support_tinfos): Check for NULL_TREE.
818         * class.c (layout_class_type): Likewise.
819         * decl.c (finish_enum): Likewise.
820         * mangle.c (write_builitin_type): Likewise.
821
822 2010-05-26  Kai Tietz  <kai.tietz@onevision.com>
823
824         * cp-tree.h (cp_decl_specifier_seq): Add new bifield
825         explicit_int128_p.
826         * decl.c (grokdeclarator): Handle __int128.
827         * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
828         (cp_parser_simple_type_specifier): Likewise.
829         * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
830         * typeck.c (cp_common_type): Handle __int128.
831         * mangle.c (integer_type_codes): Add itk_int128 and
832         itk_unsigned_int128.
833
834 2010-05-26  Jason Merrill  <jason@redhat.com>
835
836         PR c++/43382
837         * pt.c (tsubst_pack_expansion): Don't get confused by recursive
838         unification.
839
840 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
841
842         * cp-lang.c: Do not include expr.h.
843
844 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
845
846         * decl.c: Do not include rtl.h
847         * semantics.c: Likewise.
848
849 2010-05-25  Steven Bosscher  <steven@gcc.gnu.org>
850
851         * cp-tree.h: Do not include splay-tree.h.
852         (struct prtmem_cst): Remove unused field and false comment.
853         * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
854         * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
855         * init.c: Do not include rtl.h and expr.h.
856         * class.c: Do not include rtl.h.  Include splay-tree.h.
857         (build_clone): Use plain NULL instead of NULL_RTX.
858         * decl.c: Do not include expr.h.  Explain why rtl.h has to be
859         included.  Include splay-tree.h.
860         * method.c: Do not include rtl.h and expr.h.
861         (use_thunk): Use plain NULL instead of NULL_RTX.
862         * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
863         * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
864         and target.h.  Include splay-tree.h.
865         * expr.c: Do not include rtl.h and expr.h.
866         * pt.c: Do not include obstack.h and rtl.h.
867         (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
868         (tsubst_decl): Likewise.
869         (instantiate_decl): Likewise.
870         * semantics.c: Do not include exprt.h and debug.h.  Explain why
871         rtl.h has to be included.
872         * decl2.c: Do not include rtl.h and expr.h.  Include splay-tree.h.
873         * call.c: Do not include rtl.h and expr.h.
874         * search.c: Do not include obstack.h and rtl.h.
875         * friend.c: Do not include rtl.h and expr.h.
876         * Make-lang.in: Update dependencies.
877
878 2010-05-25  Jakub Jelinek  <jakub@redhat.com>
879
880         PR c++/18249
881         * parser.c (non_integral_constant): Add NIC_NONE.
882         (required_token): Add RT_NONE.
883         (cp_parser_unary_expression): Initialize non_constant_p
884         to NIC_NONE.
885         (cp_parser_asm_definition): Initialize missing to RT_NONE.
886         (cp_parser_primary_expression, cp_parser_postfix_expression,
887         cp_parser_cast_expression, cp_parser_binary_expression,
888         cp_parser_functional_cast): Fix formatting.
889
890 2010-05-25  Shujing Zhao  <pearly.zhao@oracle.com>
891         
892         PR c++/18249
893         * parser.c: Remove inclusion of dyn-string.h.
894         (non_integral_constant): New enum.
895         (name_lookup_error): New enum.
896         (required_token): New enum.
897         (cp_parser_required_error): New function.
898         (cp_parser_require): Change the type of variable token_desc to
899         required_token and use cp_parser_required_error.
900         (cp_parser_require_keyword): Likewise.
901         (cp_parser_error): Use gmsgid as parameter.
902         (cp_parser_name_lookup_error): Change the type of variable desired to
903         name_lookup_error and put the diagnostic in the full sentences. Change
904         caller.
905         (cp_parser_non_integral_constant_expression): Change the type of the
906         variable thing to non_integral_constant and put the diagnostics in
907         full sentences. Change caller.
908
909 2010-05-24  Eric Botcazou  <ebotcazou@adacore.com>
910
911         PR middle-end/44100
912         * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
913
914 2010-05-24  Joseph Myers  <joseph@codesourcery.com>
915
916         * error.c (cp_diagnostic_starter): Update call to
917         diagnostic_build_prefix.
918         (cp_print_error_function,
919         print_instantiation_partial_context_line): Check show_column flag
920         in context.
921
922 2010-05-24  Jason Merrill  <jason@redhat.com>
923
924         PR c++/41510
925         * decl.c (check_initializer): Don't wrap an init-list in a
926         TREE_LIST.
927         * init.c (build_aggr_init): Don't assume copy-initialization if
928         init has CONSTRUCTOR_IS_DIRECT_INIT.
929         * call.c (build_new_method_call): Sanity check.
930
931 2010-05-24  Nathan Froyd  <froydnj@codesourcery.com>
932
933         * rtti.c (tinfo_base_init): Use build_constructor instead of
934         build_constructor_from_list.  Don't cons a tree node for
935         returning.
936         (generic_initializer): Use build_constructor_single instead of
937         build_constructor_from_list.
938         (ptr_initializer): Use build_constructor instead of
939         build_constructor_from_list
940         (ptm_initializer): Likewise.
941         (class_initializer): Likewise.  Take varargs instead of TRAIL.
942         (get_pseudo_ti_init): Adjust calls to class_initializer.  Use
943         build_constructor instead of build_constructor_from_list.
944
945 2010-05-22  Steven Bosscher  <steven@gcc.gnu.org>
946
947         * semantics.c: Include bitmap.h.
948         * Make-lang.in: Update dependencies.
949
950 2010-05-22  Jan Hubicka  <jh@suse.cz>
951
952         * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
953         comdat vtables.
954         (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
955
956 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
957
958         * cxx-pretty-print.c: Correct merge error.
959
960 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
961
962         * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
963         (cp_print_error_function): Use diagnostic_abstract_origin macro.
964         (cp_printer): Handle %K here using percent_K_format.
965         * cxx-pretty-print.c: Include tree-pretty-print.h.
966         * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
967         dependencies.
968
969 2010-05-21  Steven Bosscher  <steven@gcc.gnu.org>
970
971         * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
972         Clean up redundant includes.
973
974 2010-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
975
976         PR c++/30298
977         * decl.c (xref_basetypes): Return false in case of ill-formed
978         redefinition.
979
980 2010-05-19  Jason Merrill  <jason@redhat.com>
981
982         * call.c (reference_binding): Use cp_build_qualified_type_real
983         and cp_type_quals consistently.
984         (add_function_candidate): Likewise.
985         (build_conditional_expr): Likewise.
986         (convert_like_real): Likewise.
987         (type_passed_as): Likewise.
988         * class.c (add_method): Likewise.
989         (same_signature_p): Likewise.
990         (layout_class_type): Likewise.
991         * decl.c (cxx_init_decl_processing): Likewise.
992         (cp_fname_init): Likewise.
993         (grokdeclarator): Likewise.
994         * decl2.c (cp_reconstruct_complex_type): Likewise.
995         * init.c (build_new_1): Likewise.
996         * method.c (do_build_copy_constructor): Likewise.
997         (implicitly_declare_fn): Likewise.
998         * pt.c (tsubst_aggr_type): Likewise.
999         (tsubst): Likewise.
1000         * rtti.c (init_rtti_processing): Likewise.
1001         (build_headof): Likewise.
1002         (build_dynamic_cast_1): Likewise.
1003         (tinfo_base_init): Likewise.
1004         (emit_support_tinfos): Likewise.
1005         * semantics.c (capture_decltype): Likewise.
1006         * tree.c (cv_unqualified): Likewise.
1007         * typeck.c (composite_pointer_type): Likewise.
1008         (string_conv_p): Likewise.
1009
1010         * mangle.c (write_CV_qualifiers_for_type): Tweak.
1011
1012         * call.c (initialize_reference): Use CP_TYPE_CONST_P.
1013         * decl.c (start_decl): Likewise.
1014         * semantics.c (finish_compound_literal): Likewise.
1015         * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
1016         (cp_type_readonly): Remove.
1017         * cp-tree.h: Remove declaration.
1018
1019         * typeck.c (merge_types): Preserve memfn quals.
1020
1021         * decl.c (grokdeclarator): Don't check quals on fn type.
1022         * typeck.c (cp_apply_type_quals_to_decl): Likewise.
1023         * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
1024
1025         PR c++/44193
1026         * typeck.c (type_memfn_quals): New fn.
1027         (apply_memfn_quals): New fn.
1028         (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
1029         (cp_type_readonly): Use cp_type_quals.
1030         * cp-tree.h: Add declarations.
1031         * tree.c (cp_build_qualified_type_real): Don't set, but do
1032         preserve, quals on FUNCTION_TYPE.
1033         (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
1034         * decl.c (build_ptrmem_type): Likewise.
1035         (grokdeclarator): Likewise.
1036         (static_fn_type): Likewise.
1037         * decl2.c (change_return_type): Likewise.
1038         (cp_reconstruct_complex_type): Likewise.
1039         * pt.c (tsubst_function_type): Likewise.
1040         (unify): Likewise.
1041         (tsubst): Likewise.  Drop special FUNCTION_TYPE substitution code.
1042
1043 2010-05-18  Nathan Froyd  <froydnj@codesourcery.com>
1044
1045         * tree.c (build_min_non_dep_call_vec): Update comment.
1046
1047 2010-05-17  Jason Merrill  <jason@redhat.com>
1048
1049         * call.c (struct z_candidate): Add explicit_targs field.
1050         (add_template_candidate_real): Set it.
1051         (build_over_call): Use it to control init-list warning.
1052
1053         PR c++/44157
1054         * call.c (build_over_call): Limit init-list deduction warning to
1055         cases where the argument is actually an init-list.
1056
1057         PR c++/44158
1058         * call.c (build_over_call): Don't do bitwise copy for move ctor.
1059
1060 2010-05-17  Dodji Seketeli  <dodji@redhat.com>
1061             Jason Merrill  <jason@redhat.com>
1062
1063         PR c++/44108
1064         * decl.c (compute_array_index_type): Call mark_rvalue_use.
1065
1066 2010-05-15  Jason Merrill  <jason@redhat.com>
1067
1068         * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1069         * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1070         TYPE_NOEXCEPT_P.
1071         (finish_eh_spec_block): Adjust.
1072
1073 2010-05-15  Jakub Jelinek  <jakub@redhat.com>
1074
1075         PR c++/44148
1076         * pt.c (tsubst): Unshare template argument.
1077
1078 2010-05-15  Steven Bosscher  <steven@gcc.gnu.org>
1079
1080         * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1081         * Make-lang.in: Fix dependencies accordingly.
1082
1083 2010-05-14  Jason Merrill  <jason@redhat.com>
1084
1085         C++ DR 475
1086         * except.c (build_throw): Simplify, adjust for DR 475.
1087
1088         PR c++/44127
1089         * except.c (dtor_nothrow): Return nonzero for type with
1090         trivial destructor.
1091
1092         PR c++/44127
1093         * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1094         gimple_build_eh_must_not_throw.
1095
1096 2010-05-14  Martin Jambor  <mjambor@suse.cz>
1097
1098         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1099         and define.
1100
1101 2010-05-14  Jonathan Wakely  <jwakely.gcc@gmail.com>
1102
1103         * call.c (build_new_method_call): Change warning text.
1104         * typeck2.c (build_functional_cast): Change error text.
1105
1106 2010-05-14  Shujing Zhao  <pearly.zhao@oracle.com>
1107
1108         PR c++/30566
1109         * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1110         shadowing the outer parameter or variables by the declaration of
1111         nested function in nested structure or class. Warn the shadowing by
1112         the declaration of nested lambda expression.
1113
1114 2010-05-13  Jason Merrill  <jason@redhat.com>
1115
1116         * typeck.c (cp_build_array_ref): Factor out from...
1117         (build_array_ref): ...here.  Drop complain parm.
1118         (build_new_op): Adjust.
1119         * class.c (build_vtbl_ref_1): Adjust.
1120         * decl2.c (grok_array_decl): Adjust.
1121         * cp-tree.h: Adjust prototypes.
1122
1123 2010-05-13  Jan Hubicka  <jh@suse.cz>
1124
1125         * decl.c (cp_finish_decl): Do not worry about used attribute.
1126
1127 2010-05-12  Jason Merrill  <jason@redhat.com>
1128
1129         * typeck.c (build_array_ref): Take complain parm.
1130         * cp-tree.h: Add it to prototype.
1131         * call.c (build_new_op): Pass it.
1132         * class.c (build_vtbl_ref): Pass it.
1133         * decl2.c (grok_array_decl): Pass it.
1134
1135         PR bootstrap/44048
1136         PR target/44099
1137         * cp-tree.def (NULLPTR_TYPE): Remove.
1138         * cp-tree.h (NULLPTR_TYPE_P): New.
1139         (SCALAR_TYPE_P): Use it.
1140         (nullptr_type_node): New.
1141         (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1142         * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1143         nullptr_type_node.
1144         * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1145         * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1146         * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1147         * mangle.c (write_type): Likewise.
1148         * name-lookup.c (arg_assoc_type): Likewise.
1149         * typeck.c (build_reinterpret_cast_1): Likewise.
1150         * rtti.c (typeinfo_in_lib_p): Likewise.
1151         (emit_support_tinfos): Remove local nullptr_type_node.
1152
1153         * cp-tree.h (UNKNOWN_TYPE): Remove.
1154         * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1155         * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1156         * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1157         * class.c (instantiate_type): Check unknown_type_node rather than
1158         UNKNOWN_TYPE.
1159         * name-lookup.c (maybe_push_decl): Likewise.
1160         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1161         (get_typeid): Likewise.
1162         * semantics.c (finish_offsetof): Likewise.
1163
1164         PR c++/20669
1165         * call.c (add_template_candidate_real): If deduction fails, still
1166         add the template as a non-viable candidate.
1167         (equal_functions): Handle template candidates.
1168         (print_z_candidate): Likewise.
1169         (print_z_candidates): Likewise.
1170         (build_new_function_call): Likewise.
1171
1172         * cp-tree.h (LOOKUP_LIST_ONLY): New.
1173         * call.c (add_candidates): Enforce it.
1174         (build_new_method_call): Try non-list ctor if no viable list ctor.
1175         (build_user_type_conversion_1): Likewise.
1176
1177         * call.c (add_candidates): Distinguish between type(x) and
1178         x.operator type().
1179         (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1180         (build_new_method_call): Give better error for conversion op.
1181
1182         * call.c (add_candidates): Add first_arg and return_type parms.
1183         Add special constructor/conversion op handling.
1184         (convert_class_to_reference): Use it.
1185         (build_user_type_conversion_1): Likewise.
1186         (build_op_call): Likewise.
1187         (build_new_method_call): Likewise.
1188         (build_new_op): Adjust.
1189         (perform_overload_resolution): Adjust.
1190
1191 2010-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
1192
1193         PR c++/34272
1194         PR c++/43630
1195         PR c++/34491
1196         * pt.c (process_partial_specialization): Return error_mark_node
1197         in case of unused template parameters in partial specialization.
1198
1199 2010-05-11  Jakub Jelinek  <jakub@redhat.com>
1200
1201         PR c++/44062
1202         * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1203         * cvt.c (convert_to_void): ... but here.  If expr is a COMPOUND_EXPR,
1204         look at its second operand.
1205
1206 2010-05-10  Jason Merrill  <jason@redhat.com>
1207
1208         PR c++/44017
1209         * semantics.c (baselink_for_fns): Revert earlier change.
1210
1211         PR c++/44045
1212         * typeck.c (cp_build_modify_expr): Complain about assignment to
1213         array from init list.
1214
1215 2010-05-10  Fabien Chêne  <fabien.chene@gmail.com>
1216
1217         PR c++/43719
1218         * decl.c (check_initializer): strip array type before checking for
1219         uninitialized const or ref members.
1220
1221 2010-05-07  Fabien Chêne  <fabien.chene@gmail.com>
1222
1223         PR c++/43951
1224         * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1225         error count. Emit errors only if compain is true.
1226         (build_new_1): Do not return error_mark_node if
1227         diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1228         errors. Delay the check for user-provided constructor.
1229         (perform_member_init): Adjust.
1230         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1231         prototype.
1232
1233 2010-05-06  Magnus Fromreide  <magfr@lysator.liu.se>
1234             Jason Merrill  <jason@redhat.com>
1235
1236         Add support for C++0x nullptr.
1237         * cp-tree.def: Add NULLPTR_TYPE.
1238         * cp-tree.h: Add nullptr_node.
1239         (cp_tree_index): Add CPTI_NULLPTR.
1240         (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1241         * call.c (null_ptr_cst_p): Handle nullptr.
1242         (standard_conversion): Likewise.
1243         (convert_arg_to_ellipsis): Likewise.
1244         * mangle.c (write_type): Likewise.
1245         * name-lookup.c (arg_assoc_type): Likewise.
1246         * parser.c (cp_parser_primary_expression): Likewise.
1247         * typeck.c (cp_build_binary_op): Likewise.
1248         (build_reinterpret_cast_1): Likewise.
1249         * error.c (dump_type): Likewise.
1250         (dump_type_prefix, dump_type_suffix): Likewise.
1251         * decl.c (cxx_init_decl_processing): Likewise.
1252         * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1253         * cvt.c (ocp_convert): Likewise.
1254         * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
1255         nullptr_t tinfo in libsupc++.
1256
1257 2010-05-06  Jason Merrill  <jason@redhat.com>
1258
1259         * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
1260
1261 2010-04-22  Jakub Jelinek <jakub@redhat.com>
1262             Dodji Seketeli <dodji@redhat.com>
1263
1264         PR c/18624
1265         * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
1266         Declare ...
1267         * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
1268         * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
1269         (decay_conversion, perform_integral_promotions): Call rvalue_use.
1270         (cp_build_unary_op): Call lvalue_use.
1271         * decl.c (unused_but_set_errorcount): New variable.
1272         (poplevel): Issue -Wunused-but-set-variable diagnostics.
1273         (duplicate_decls): Merge DECL_READ_P flags.
1274         (start_cleanup_fn): Set DECL_READ_P flag.
1275         (finish_function): Issue -Wunused-but-set-parameter diagnostics.
1276         * tree.c (rvalue): Call rvalue_use.
1277         * pt.c (convert_nontype_argument): Likewise.
1278         * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
1279         finish_decltype_type): Likewise.
1280         * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
1281         (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
1282         or rvalue_use depending on the expr.
1283         * init.c (build_new, build_delete): Likewise.
1284         * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
1285
1286 2010-05-05  Jason Merrill  <jason@redhat.com>
1287
1288         PR c++/43787
1289         * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
1290         * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
1291
1292 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1293
1294         PR c++/43028
1295         * pt.c (unify): Check each elt for error_mark_node.
1296
1297 2010-05-04  Jason Merrill  <jason@redhat.com>
1298
1299         PR c++/38064
1300         * typeck.c (cp_build_binary_op): Allow enums for <> as well.
1301
1302 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1303
1304         PR c++/43705
1305         * call.c (build_new_method_call): Return error_mark_node if fns is
1306         NULL_TREE.
1307
1308 2010-05-03  Dodji Seketeli  <dodji@redhat.com>
1309
1310         PR c++/43953
1311         * pt.c (most_specialized_class): Pretend we are processing
1312         a template decl during the call to coerce_template_parms.
1313
1314 2010-05-03  Jason Merrill  <jason@redhat.com>
1315
1316         PR c++/42810
1317         PR c++/43680
1318         * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
1319         from the selected underlying type unless -fstrict-enums.  Set
1320         ENUM_UNDERLYING_TYPE to have the restricted range.
1321         * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
1322         * class.c (check_bitfield_decl): Likewise.
1323
1324 2010-05-01  H.J. Lu  <hongjiu.lu@intel.com>
1325
1326         PR c++/43951
1327         * init.c (build_new_1): Revert the accidental checkin in
1328         revision 158918.
1329
1330 2010-04-30  Jason Merrill  <jason@redhat.com>
1331
1332         PR c++/43868
1333         * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
1334         (pp_cxx_type_specifier_seq): ...here.
1335
1336 2010-04-30  Steven Bosscher  <steven@gcc.gnu.org>
1337
1338         * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
1339         * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
1340
1341 2010-04-30  Shujing Zhao  <pearly.zhao@oracle.com>
1342
1343         PR c++/43779
1344         * typeck.c (warn_args_num): New function.
1345         (convert_arguments): Use warn_args_num to print the diagnostic
1346         messages. 
1347
1348 2010-04-29  Fabien Chêne  <fabien.chene@gmail.com>
1349
1350         PR c++/43890
1351         * init.c (diagnose_uninitialized_cst_or_ref_member): check for
1352         user-provided constructor while recursing.
1353
1354 2010-04-28  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1355
1356         PR c++/9335
1357         * error.c (print_instantiation_partial_context_line): Handle
1358         recursive instantiation.
1359         (print_instantiation_partial_context): Likewise.
1360
1361 2010-04-27  Jason Merrill  <jason@redhat.com>
1362
1363         * init.c (perform_member_init): Check CLASS_TYPE_P.
1364
1365 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
1366
1367         PR c++/29043
1368         * init.c (perform_member_init): check for uninitialized const or
1369         reference members, including array types.
1370
1371 2010-04-24  Jason Merrill  <jason@redhat.com>
1372
1373         * tree.c (get_fns): Split out from get_first_fn.
1374         * cp-tree.h: Declare it.
1375         * search.c (shared_member_p): Use it.
1376         * semantics.c (finish_qualified_id_expr): Simplify.
1377         (finish_id_expression): Simplify.
1378
1379         * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
1380         whenever object is NULL_TREE.  Don't do 'this' capture here.
1381         (finish_qualified_id_expr): Pass NULL_TREE.
1382         (finish_id_expression): Likewise.
1383         (lambda_expr_this_capture): Likewise.
1384
1385         * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
1386         rather than checking current_class_ref directly.
1387         (finish_call_expr): Likewise.
1388
1389         PR c++/43856
1390         * name-lookup.c (qualify_lookup): Disqualify lambda op().
1391         * class.c (current_nonlambda_class_type): New fn.
1392         * semantics.c (nonlambda_method_basetype): New.
1393         * cp-tree.h: Declare them.
1394         * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1395
1396         * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1397
1398         PR c++/43875
1399         * semantics.c (lambda_return_type): Complain about
1400         braced-init-list.
1401
1402         PR c++/43790
1403         * tree.c (cv_unqualified): Handle error_mark_node.
1404
1405         PR c++/41468
1406         * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1407         if we don't want errors.
1408
1409         PR c++/41468
1410         * class.c (convert_to_base): Add complain parameter.  Pass
1411         ba_quiet to lookup_base if we don't want errors.
1412         (build_vfield_ref): Pass complain to convert_to_base.
1413         * call.c (convert_like_real): Likewise.
1414         (initialize_reference): Likewise.
1415         (perform_direct_initialization_if_possible): Pass complain to
1416         convert_like_real.
1417         * cp-tree.h: Adjust.
1418
1419 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
1420             Jason Merrill  <jason@redhat.com>
1421
1422         PR c++/42844
1423         * decl.c (check_for_uninitialized_const_var): Handle classes that need
1424         constructing, too.
1425         (check_initializer): Call it for classes that need constructing, too.
1426         * class.c (in_class_defaulted_default_constructor): New.
1427         * cp-tree.h: Declare it.
1428
1429 2010-04-20  Jason Merrill  <jason@redhat.com>
1430
1431         PR c++/9335
1432         * init.c (constant_value_1): Treat error_mark_node as a constant
1433         if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1434         * cvt.c (ocp_convert): Handle getting error_mark_node from
1435         integral_constant_value.
1436         * decl.c (compute_array_index_type): Likewise.
1437
1438 2010-04-20  Dodji Seketeli  <dodji@redhat.com>
1439
1440         PR c++/43800
1441         PR c++/43704
1442         * typeck.c (incompatible_dependent_types_p): If one of the
1443         compared types if not a typedef then honour their main variant
1444         equivalence.
1445
1446 2010-04-20  Jakub Jelinek  <jakub@redhat.com>
1447
1448         * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1449
1450 2010-04-19  Dodji Seketeli  <dodji@redhat.com>
1451
1452         PR c++/43704
1453         * typeck.c (structural_comptypes): Test dependent typedefs
1454         incompatibility before testing for their main variant based
1455         equivalence.
1456
1457 2010-04-19  Jakub Jelinek  <jakub@redhat.com>
1458
1459         * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
1460         ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
1461
1462 2010-04-18  Eric Botcazou  <ebotcazou@adacore.com>
1463
1464         * decl.c (cxx_init_decl_processing): Remove second argument in call to
1465         build_common_tree_nodes.
1466
1467 2010-04-14  Jason Merrill  <jason@redhat.com>
1468
1469         PR c++/36625
1470         * parser.c (cp_parser_parenthesized_expression_list): Change
1471         is_attribute_list parm to int to indicate whether or not to
1472         handle initial identifier specially.
1473         (cp_parser_attribute_list): Use attribute_takes_identifier_p.
1474
1475 2010-04-13  Jason Merrill  <jason@redhat.com>
1476
1477         * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
1478         CLASS_TYPE_P.
1479         * parser.c (cp_parser_lambda_expression): Complain about lambda in
1480         unevaluated context.
1481         * pt.c (iterative_hash_template_arg): Don't crash on lambda.
1482
1483 2010-04-12  Jason Merrill  <jason@redhat.com>
1484
1485         PR c++/43641
1486         * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
1487         return value directly.
1488
1489         * call.c (type_decays_to): Call cv_unqualified for non-class type.
1490
1491 2010-04-12  Fabien Chene  <fabien.chene@gmail.com>
1492
1493         PR c++/25811
1494         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
1495         * init.c (build_new_1): Check for uninitialized const members and
1496         uninitialized reference members, when using new without
1497         new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
1498         (diagnose_uninitialized_cst_or_ref_member): Define, call
1499         diagnose_uninitialized_cst_or_ref_member_1.
1500         (diagnose_uninitialized_cst_or_ref_member_1): New function.
1501
1502 2010-04-12  Richard Guenther  <rguenther@suse.de>
1503
1504         PR c++/43611
1505         * semantics.c (expand_or_defer_fn_1): Do not keep extern
1506         template inline functions.
1507
1508 2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1509
1510         PR c++/28584
1511         * typeck.c (cp_build_c_cast): Warn for casting integer to larger
1512         pointer type.
1513
1514 2010-04-07  Jason Merrill  <jason@redhat.com>
1515
1516         PR c++/43016
1517         * decl.c (start_preparsed_function): Do defer nested functions.
1518
1519         PR c++/11094, DR 408
1520         * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
1521         * decl2.c (finish_static_data_member_decl): Set it.
1522         * decl.c (duplicate_decls): Propagate it.
1523         * pt.c (tsubst_decl): Don't substitute the domain of an array
1524         VAR_DECL if it's set.
1525         (regenerate_decl_from_template): Substitute it here.
1526         (type_dependent_expression_p): Return true if it's set.
1527         * semantics.c (finish_decltype_type): Instantiate such a variable.
1528         * typeck.c (cxx_sizeof_expr): Likewise.
1529         (strip_array_domain): New.
1530
1531         PR c++/43145
1532         * name-lookup.c (current_decl_namespace): Non-static.
1533         (pop_nested_namespace): Sanity check.
1534         * cp-tree.h: Declare current_decl_namespace.
1535         * decl.c (grokvardecl): Use it instead of current_namespace.
1536         (grokfndecl): Likewise.
1537
1538         PR c++/38392
1539         * pt.c (tsubst_friend_function): Instatiate a friend that has already
1540         been used.
1541
1542         * pt.c (print_template_statistics): New.
1543         * cp-tree.h: Declare it.
1544         * tree.c (cxx_print_statistics): Call it.
1545
1546         PR c++/41970
1547         * decl.c (grokvardecl): Tweak warning message.
1548         (grokfndecl): Likewise.
1549
1550 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
1551
1552         PR c++/42697
1553         *pt.c (tsubst_decl): Get the arguments of a specialization from
1554         the specialization template, not from the most general template.
1555
1556 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
1557
1558         PR c++/40239
1559         * typeck2.c (process_init_constructor_record):
1560         value-initialize members that are are not explicitely
1561         initialized.
1562
1563 2010-04-07  Jie Zhang  <jie@codesourcery.com>
1564
1565         PR c++/42556
1566         * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
1567         when all of its elements are non-constant and have been split out.
1568
1569 2010-04-06  Taras Glek  <taras@mozilla.com>
1570             Jason Merrill  <jason@redhat.com>
1571
1572         * parser.c (cp_parser_class_specifier): Set class location to that
1573         of IDENTIFIER_NODE instead of '{' when possible.
1574         * semantics.c (begin_class_definition): Do not overide locations
1575         with less precise ones.
1576
1577 2010-04-06  Jason Merrill  <jason@redhat.com>
1578
1579         PR c++/43648
1580         * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
1581
1582         PR c++/43621
1583         * pt.c (maybe_update_decl_type): Check the return value from
1584         push_scope.
1585
1586 2010-04-01  Jason Merrill  <jason@redhat.com>
1587
1588         * decl.c (next_initializable_field): No longer static.
1589         * cp-tree.h: Declare it.
1590         * call.c (build_aggr_conv): Fail if there are more initializers
1591         than initializable fields.
1592
1593         * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
1594         instead of void_zero_node.
1595
1596 2010-03-31  Dodji Seketeli  <dodji@redhat.com>
1597
1598         PR c++/43558
1599         * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
1600         * pt.c (end_template_parm_list): Store sibling template parms of
1601         each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1602         (push_template_decl_real): Don't store the containing template decl
1603         into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
1604         * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
1605         of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1606         Simplify the logic.
1607
1608 2010-03-30  Jason Merrill  <jason@redhat.com>
1609
1610         PR c++/43076
1611         * pt.c (push_template_decl_real): Deal better with running out of
1612         scopes before running out of template parms.
1613
1614         PR c++/41185
1615         PR c++/41786
1616         * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
1617         function parameter context.  Don't print an error if parsing
1618         tentatively.
1619
1620         PR c++/43559
1621         * pt.c (more_specialized_fn): Don't control cv-qualifier check
1622         with same_type_p.
1623
1624 2010-03-26  Jason Merrill  <jason@redhat.com>
1625
1626         PR c++/43509
1627         * parser.c (cp_parser_qualifying_entity): Do accept enum names in
1628         c++0x mode, but not other type-names.
1629
1630 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
1631
1632         PR c++/43327
1633         * pt.c (add_to_template_args): Support NULL ARGS;
1634         (most_specialized_class): call coerce_template_parms on
1635         template arguments passed to get_class_bindings. Use
1636         add_to_template_args.
1637         (unify): Handle VAR_DECLs.
1638
1639 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
1640
1641         * cp-tree.h (get_template_parms_at_level): Change unsigned parm
1642         into int.
1643         * pt.c (get_template_parms_at_level): Adjust.
1644
1645 2010-03-25  Dodji Seketeli  <dodji@redhat.com>
1646
1647         PR c++/43206
1648         * cp-tree.h (get_template_parms_at_level): Declare ...
1649         * pt.c (get_template_parms_at_level): ... new function.
1650         * typeck.c (get_template_parms_of_dependent_type): If a template
1651         type parm's DECL_CONTEXT isn't yet set, get its siblings from
1652         current_template_parms. Use get_template_parms_at_level. Remove
1653         useless test.
1654         (incompatible_dependent_types_p): If we get empty parms from just one
1655         of the template type parms we are comparing then the template parms are
1656         incompatible.
1657
1658 2010-03-24  Jason Merrill  <jason@redhat.com>
1659
1660         PR c++/43502
1661         * parser.c (make_declarator): Initialize id_loc.
1662         (cp_parser_lambda_declarator_opt): And set it.
1663
1664 2010-03-23  Jason Merrill  <jason@redhat.com>
1665
1666         Make lambda conversion op and op() non-static.
1667         * semantics.c (maybe_add_lambda_conv_op): Make non-static.
1668         Also add the thunk function returned by the conversion op.
1669         Mark the conversion deleted if the op() is variadic.
1670         * decl2.c (mark_used): Give helpful message about deleted conversion.
1671         * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
1672         * semantics.c (finish_this_expr): Adjust.
1673         * mangle.c (write_closure_type_name): Adjust.
1674         * decl.c (grok_op_properties): Don't allow it.
1675         * call.c (build_user_type_conversion_1): No static conversion ops.
1676         (build_op_call): Or op().
1677
1678         * decl2.c (change_return_type): Fix 'this' quals.
1679
1680 2010-03-22  Jason Merrill  <jason@redhat.com>
1681
1682         PR c++/43333
1683         * tree.c (pod_type_p): Use old meaning in C++98 mode.
1684
1685         PR c++/43281
1686         * pt.c (contains_auto_r): New fn.
1687         (do_auto_deduction): Use it.
1688         (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
1689
1690 2010-03-20  Simon Martin  <simartin@users.sourceforge.net>
1691
1692         PR c++/43081:
1693         * decl2.c (grokfield): Handle invalid initializers for member
1694         functions.
1695
1696 2010-03-20  Dodji Seketeli  <dodji@redhat.com>
1697
1698         PR c++/43375
1699         * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
1700         is NULL.
1701         * decl2.c (vague_linkage_p): Likewise.
1702
1703 2010-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
1704
1705         PR c++/43418
1706         * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
1707         false, in the cp_parser_expression_statement call.
1708
1709 2010-03-05  Jason Merrill  <jason@redhat.com>
1710
1711         * mangle.c (mangle_decl): Give name collision error even without
1712         ASM_OUTPUT_DEF.
1713
1714 2010-03-04  Marco Poletti  <poletti.marco@gmail.com>
1715
1716         * pt.c (process_partial_specialization): Use error_n instead of
1717         error.
1718
1719 2010-03-03  Jason Merrill  <jason@redhat.com>
1720
1721         PR c++/12909
1722         * mangle.c (mangle_decl): Handle VAR_DECL, too.
1723
1724 2010-03-03  Jason Merrill  <jason@redhat.com>
1725
1726         PR c++/12909
1727         * mangle.c: Include cgraph.h.
1728         (mangle_decl): If the mangled name will change in a later
1729         ABI version, make the later mangled name an alias.
1730         * method.c (make_alias_for): Copy DECL_ARGUMENTS.
1731         * Make-lang.in (mangle.o): Depend on cgraph.h.
1732         * method.c (make_alias_for): Handle VAR_DECL, too.
1733         * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
1734         * tree.c (no_linkage_check): Adjust.
1735         * decl.c (maybe_commonize_var): Adjust.
1736         * cp-tree.h: Adjust.
1737
1738 2010-03-01  Marco Poletti  <poletti.marco@gmail.com>
1739
1740         * pt.c (redeclare_class_template): Use error_n and inform_n.
1741
1742 2010-02-27  Mark Mitchell  <mark@codesourcery.com>
1743
1744         PR c++/42748
1745         * cp-tree.h (push_tinst_level): Declare.
1746         (pop_tinst_level): Likewise.
1747         * pt.c (push_tinst_level): Give it external linkage.
1748         (pop_tinst_level): Likewise.
1749         * mangle.c (mangle_decl_string): Set the source location to that
1750         of the decl while mangling.
1751
1752 2010-02-27  Simon Martin  <simartin@users.sourceforge.net>
1753
1754         PR c++/42054
1755         * pt.c (redeclare_class_template): Return false if there are erroneous
1756         template parameters.
1757
1758 2010-02-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1759
1760         * pt.c (push_tinst_level): Replace -ftemplate-depth- with 
1761         -ftemplate-depth=.
1762
1763 2010-02-24  Jason Merrill  <jason@redhat.com>
1764
1765         PR c++/12909
1766         * mangle.c (write_type): Give -Wabi warning for old vector mangling.
1767
1768         * class.c (layout_class_type): Don't give -Wabi warning for a bug
1769         in a previous ABI version.
1770
1771 2010-02-23  Jason Merrill  <jason@redhat.com>
1772
1773         PR c++/43143
1774         * typeck2.c (digest_init_r): Accept value init of array.
1775
1776 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1777
1778         PR c++/43126
1779         * typeck.c (convert_arguments): Update error message.
1780
1781 2010-02-22  Mike Stump  <mikestump@comcast.net>
1782
1783         PR c++/43125
1784         * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
1785
1786 2010-02-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1787
1788         PR c++/23510
1789         * error.c (print_instantiation_partial_context_line): New.
1790         (print_instantiation_partial_context): Print at most 12 contexts,
1791         skip the rest with a message.
1792
1793 2010-02-21  Dodji Seketeli  <dodji@redhat.com>
1794
1795         PR c++/42824
1796         * pt.c (lookup_template_class): Better support of specialization
1797         of member of class template implicit instantiation.
1798
1799 2010-02-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1800
1801         PR c++/35669
1802         * call.c (conversion_null_warnings): Replace -Wconversion with
1803         -Wconversion-null.
1804         * cvt.c (build_expr_type_conversion): Likewise.
1805
1806 2010-02-18  Jason Merrill  <jason@redhat.com>
1807
1808         PR c++/42837
1809         * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
1810
1811         PR c++/43108
1812         * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
1813         C build_binary_op.
1814         * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
1815         * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
1816
1817         PR c++/43070
1818         * semantics.c (finish_goto_stmt): Don't call decay_conversion.
1819
1820         PR c++/26261
1821         PR c++/43101
1822         * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
1823         (maybe_update_decl_type): New fn.
1824         * parser.c (cp_parser_init_declarator): Use it.
1825
1826         PR c++/43109
1827         * semantics.c (begin_class_definition): Don't crash on unnamed ns.
1828
1829 2010-02-17  Jason Merrill  <jason@redhat.com>
1830
1831         PR c++/43075
1832         * call.c (build_over_call): Don't create zero-sized assignments.
1833         * cp-gimplify.c (cp_genericize_r): Don't remove them here.
1834         * cp-objcp-common.c (cp_expr_size): Remove.
1835         * cp-tree.h: Remove prototype.
1836
1837         PR c++/43069
1838         * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
1839         decl we looked up doesn't match.
1840
1841         PR c++/43093
1842         * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
1843         have an INIT_EXPR anymore.
1844
1845         PR c++/43079
1846         * pt.c (convert_nontype_argument): Change assert to test.
1847
1848 2010-02-16  Jason Merrill  <jason@redhat.com>
1849
1850         * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
1851
1852         PR c++/43031
1853         * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
1854         VIEW_CONVERT_EXPR for conversions between structural equality types
1855         that the back end can't tell are the same.
1856
1857         PR c++/43036
1858         * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
1859         cv-quals from element here.
1860         (cp_build_qualified_type_real): Not here.  Preserve typedef name.
1861
1862 2010-02-14  Jason Merrill  <jason@redhat.com>
1863
1864         PR c++/41997
1865         * semantics.c (finish_compound_literal): Use
1866         cp_apply_type_quals_to_decl when creating a static variable.
1867
1868 2010-02-12  Jason Merrill  <jason@redhat.com>
1869
1870         PR c++/43024
1871         * name-lookup.h (current_binding_level): Check for null
1872         cp_function_chain.
1873
1874 2010-02-12  Jason Merrill  <jason@redhat.com>
1875
1876         PR c++/43054
1877         * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
1878
1879 2010-02-12  Jakub Jelinek  <jakub@redhat.com>
1880
1881         PR c++/43033
1882         * name-lookup.c (pushdecl_maybe_friend): Check default args of t
1883         instead of x.
1884
1885 2010-02-10  Jason Merrill  <jason@redhat.com>
1886
1887         PR c++/41896
1888         * semantics.c (outer_lambda_capture_p): Revert.
1889         (add_capture): Only finish_member_declaration if
1890         we're in the lambda class.
1891         (register_capture_members): New.
1892         * cp-tree.h: Declare it.
1893         * parser.c (cp_parser_lambda_expression): Call it.
1894
1895 2010-02-10  Jason Merrill  <jason@redhat.com>
1896
1897         PR c++/41896
1898         * semantics.c (outer_lambda_capture_p): Use current_function_decl
1899         instead of current_class_type.
1900
1901 2010-02-10  Jason Merrill  <jason@redhat.com>
1902
1903         PR c++/42983, core issue 906
1904         * method.c (defaultable_fn_check): Check virtualness.
1905
1906 2010-02-10  Jason Merrill  <jason@redhat.com>
1907
1908         PR c++/43016
1909         * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
1910
1911 2010-02-10  Shujing Zhao  <pearly.zhao@oracle.com>
1912
1913         * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
1914         * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
1915         translation.
1916         * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
1917         (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
1918         (cp_parser_parameter_declaration)
1919         (cp_parser_exception_specification_opt)
1920         (cp_parser_exception_declaration): Likewise.
1921         * pt.c (check_default_tmpl_args): Likewise.
1922         * search.c (lookup_field_r): Likewise.
1923
1924 2010-02-09  Jason Merrill  <jason@redhat.com>
1925
1926         PR c++/42399
1927         * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
1928
1929 2010-02-09  Jason Merrill  <jason@redhat.com>
1930
1931         PR c++/42370
1932         * decl2.c (change_return_type): New fn.
1933         * semantics.c (apply_lambda_return_type): Use it.
1934         * cp-tree.h: Declare it.
1935
1936 2010-02-05  Richard Guenther  <rguenther@suse.de>
1937
1938         * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
1939         * cp-lang.c: Include gt-cp-cp-lang.h.
1940         * config-lang.in (gtfiles): Add cp/cp-lang.c.
1941
1942 2010-02-05  Dodji Seketeli  <dodji@redhat.com>
1943
1944         PR c++/42915
1945         * typeck.c (get_template_parms_of_dependent_type): Try getting
1946         the template parameters fromt the type itself first.
1947
1948 2010-02-03  Jason Merrill  <jason@redhat.com>
1949
1950         PR c++/4926
1951         PR c++/38600
1952         * mangle.c (write_unqualified_id): Split out from write_expression.
1953         (write_unqualified_name): Call it.
1954         (write_member_name): Likewise.
1955         (write_expression): Support TEMPLATE_ID_EXPR.
1956         Disambiguate operator names.
1957
1958         PR c++/12909
1959         * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
1960         -fabi-version=4.
1961
1962 2010-02-02  Jason Merrill  <jason@redhat.com>
1963
1964         PR c++/41090
1965         * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
1966         * optimize.c (clone_body): Remap their initializers when making base
1967         variants.
1968         (maybe_clone_body): Complain if multiple clones aren't safe.
1969
1970 2010-01-29  Dodji Seketeli  <dodji@redhat.com>
1971
1972         PR c++/42758
1973         PR c++/42634
1974         PR c++/42336
1975         PR c++/42797
1976         PR c++/42880
1977         * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1978         SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1979         GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
1980         * pt.c (coerce_template_parms, type_unification_real,
1981         expand_template_argument_pack, coerce_template_parameter_pack):
1982         Set the non default template args count.
1983         (current_template_args): Always set non defaulted
1984         template args count when compiled with --enable-checking
1985         (tsubst_template_args, type_unification_real): Propagate the non
1986         defaulted template args count.
1987         * error.c (get_non_default_template_args_count): Renamed
1988         count_non_default_template_args into this. Don't calculate the
1989         non default template argument count anymore. Use the new
1990         accessor macros above to get it.
1991         (dump_template_argument_list, dump_type, dump_decl,
1992         dump_template_parms): Adjust.
1993         * parser.c (cp_parser_template_argument_list): Always set defaulted
1994         template args count when compiled with --enable-checking.
1995
1996 2010-01-29  Shujing Zhao  <pearly.zhao@oracle.com>
1997
1998         * decl.c (redeclaration_error_message): Wrap the return messages into
1999         G_() for easy translation.
2000
2001 2010-01-28  Jason Merrill  <jason@redhat.com>
2002
2003         PR c++/42880
2004         * semantics.c (begin_class_definition): Don't use type_as_string.
2005
2006 2010-01-28  Dodji Seketeli  <dodji@redhat.com>
2007
2008         PR c++/42713
2009         PR c++/42820
2010         * typeck.c (get_template_parms_of_dependent_type): Factorized
2011         this out of incompatible_template_type_parms_p
2012         (incompatible_dependent_types_p): Renamed
2013         incompatible_template_type_parms_p into this. Make it detect
2014         two incompatible dependent typedefs too.
2015         (structural_comptypes): Use incompatible_dependent_types_p.
2016         * pt.c (get_template_info):
2017         Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
2018
2019 2010-01-20  Janis Johnson  <janis187@us.ibm.com>
2020             Jason Merrill  <jason@redhat.com>
2021
2022         * mangle.c (write_type): Mangle transparent record as member type.
2023         * semantics.c (begin_class_definition): Recognize decimal classes
2024         and set TYPE_TRANSPARENT_AGGR.
2025
2026 2010-01-20  Jason Merrill  <jason@redhat.com>
2027
2028         PR c++/42338
2029         * mangle.c (write_expression): Handle tree codes that have extra
2030         arguments in the middle-end.
2031
2032 2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
2033
2034         PR c++/42038
2035         * except.c (expand_start_catch_block): Deal correctly with
2036         do_begin_catch returning error_mark_node.
2037
2038 2010-01-20  Jason Merrill  <jason@redhat.com>
2039
2040         PR c++/41788
2041         * class.c (layout_class_type): Set packed_maybe_necessary for packed
2042         non-PODs.
2043
2044         PR c++/41920
2045         * semantics.c (build_lambda_object): Call mark_used on captured
2046         variables.
2047
2048         PR c++/40750
2049         * decl.c (grokdeclarator): Clear type_quals for a member function
2050         declared using a typedef.  Don't complain about adding cv-quals
2051         to a function typedef in C++0x mode.
2052
2053 2010-01-20  Jakub Jelinek  <jakub@redhat.com>
2054
2055         * decl.c (create_array_type_for_decl): Remove set but not used
2056         variable error_msg.  Remove break stmts after return stmts.
2057
2058 2010-01-19  Dodji Seketeli  <dodji@redhat.com>
2059
2060         * error.c (dump_template_parms, count_non_default_template_args):
2061         Revert fix of PR c++/42634.
2062
2063 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
2064
2065         PR c++/42634
2066         * error.c (dump_template_parms): Use innermost template
2067         arguments before calling count_non_default_template_args.
2068         (count_non_default_template_args): We are being called with
2069         template innermost arguments now. There is no need to ensure
2070         that again.
2071
2072 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
2073
2074         PR c++/42766
2075         * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2076
2077 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
2078
2079         PR c++/42697
2080         *pt.c (tsubst_decl):  Revert commit for PR c++/42697.
2081
2082 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
2083
2084         PR c++/42697
2085         *pt.c (tsubst_decl): Get the arguments of a specialization from
2086         the specialization template, not from the most general template.
2087
2088 2010-01-16  Jason Merrill  <jason@redhat.com>
2089
2090         PR c++/42761
2091         * semantics.c (finish_decltype_type): Within a template, treat
2092         unresolved CALL_EXPR as dependent.
2093
2094 2010-01-15  Dodji Seketeli  <dodji@redhat.com>
2095
2096         * error.c (dump_template_parms,count_non_default_template_args):
2097         Revert changes of PR c++/42634.
2098
2099 2010-01-14  Jakub Jelinek  <jakub@redhat.com>
2100
2101         PR middle-end/42674
2102         * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2103         functions with noreturn attribute.
2104
2105 2010-01-14  Jason Merrill  <jason@redhat.com>
2106
2107         PR c++/42701
2108         * call.c (build_new_method_call): Don't free the vec here.
2109
2110         PR c++/42655
2111         * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2112
2113 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
2114
2115         PR c++/42634
2116         * error.c (dump_template_parms): Use innermost template
2117         arguments before calling count_non_default_template_args.
2118         (count_non_default_template_args): We are being called with
2119         template innermost arguments now. There is no need to ensure
2120         that again.
2121
2122 2010-01-07  Dodji Seketeli  <dodji@redhat.com>
2123
2124         c++/40155
2125         * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2126         arguments that were previously deduced.
2127
2128 2010-01-05  Jason Merrill  <jason@redhat.com>
2129
2130         * pt.c (unify_pack_expansion): Handle deduction from init-list.
2131         * call.c (build_over_call): Don't complain about it.
2132
2133 2010-01-04  Jason Merrill  <jason@redhat.com>
2134
2135         PR c++/42555
2136         * pt.c (tsubst_decl): Don't apply type attributes in place.
2137
2138         PR c++/42567
2139         * semantics.c (describable_type): Remove decltype comment and
2140         semantics.
2141
2142
2143 \f
2144 Copyright (C) 2010 Free Software Foundation, Inc.
2145
2146 Copying and distribution of this file, with or without modification,
2147 are permitted in any medium without royalty provided the copyright
2148 notice and this notice are preserved.
2149