OSDN Git Service

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