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