OSDN Git Service

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