1 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
3 * decl.c (cp_finish_decl): Call add_local_decl.
4 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
6 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
8 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
11 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
14 * parser.c (cp_parser_primary_expression): Error if local template is
17 2010-07-02 Le-Chun Wu <lcwu@google.com>
20 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
21 (variable or type) shadows another type.
23 2010-07-02 Jakub Jelinek <jakub@redhat.com>
26 * typeck.c (convert_for_assignment): When converting a convertible
27 vector type or objc++ types, call mark_rvalue_use.
28 * typeck2.c (build_m_component_ref): Use return values from
29 mark_rvalue_use or mark_lvalue_use.
30 * class.c (build_base_path): Likewise.
31 * call.c (build_conditional_expr): Likewise.
33 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
36 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
39 2010-07-01 Richard Guenther <rguenther@suse.de>
41 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
42 predicate we are looking for, allow non-gimplified
45 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
48 * typeck.c (cp_build_unary_op): Early return error_mark_node when
50 * call.c (convert_class_to_reference): Return error_mark_node when
53 2010-06-30 Michael Matz <matz@suse.de>
55 * repo.c (finish_repo): Fix typo.
57 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
59 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
61 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
63 * repo.c (pending_repo): Change type to a VEC.
64 (finish_repo): Adjust for new type of pending_repo.
65 (repo_emit_p): Likewise.
67 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
69 * tree.c: Include gimple.h. Do not include tree-flow.h
70 * decl.c: Do not include tree-flow.h
71 * Make-lang.in: Adjust dependencies.
73 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
75 * decl.c (incomplete_var): Declare. Declare VECs containing them.
76 (incomplete_vars): Adjust comment. Change type to a VEC.
77 (maybe_register_incomplete_var): Adjust for new type.
78 (complete_vars): Adjust iteration over incomplete_vars.
80 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
82 * decl.c (struct named_label_entry): Change type of bad_decls field
84 (poplevel_named_label_1): Adjust for new type of bad_decls.
85 (check_goto): Likewise.
87 2010-06-29 Jason Merrill <jason@redhat.com>
89 Enable implicitly declared move constructor/operator= (N3053).
90 * class.c (add_implicitly_declared_members): A class with no
91 explicitly declared copy or move constructor gets both declared
92 implicitly, and similarly for operator=.
93 (check_bases): A type with no copy ctor does not inhibit
94 a const copy ctor in a derived class. It does mean the derived
96 (check_field_decl): Likewise.
97 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
98 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
99 (trivially_copyable_p): Likewise.
100 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
101 * class.c (finish_struct_bits): Likewise.
102 * tree.c (build_target_expr_with_type): Likewise.
103 * typeck2.c (store_init_value): Likewise.
105 Enable implicitly deleted functions (N2346)
106 * class.c (check_bases_and_members): Adjust lambda flags.
107 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
109 * decl2.c (mark_used): Adjust error for use of deleted function.
111 Machinery to support implicit delete/move.
112 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
113 has_complex_move_ctor, has_complex_move_assign bitfields.
114 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
115 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
116 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
117 (enum special_function_kind): Add sfk_move_assignment.
118 (LOOKUP_SPECULATIVE): New.
119 * call.c (build_over_call): Return early if it's set.
120 (build_over_call): Use trivial_fn_p.
121 * class.c (check_bases): If the base has no default constructor,
122 the derived one is non-trivial. Handle move ctor/op=.
123 (check_field_decl): Likewise.
124 (check_bases_and_members): Handle move ctor/op=.
125 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
126 (type_has_move_constructor, type_has_move_assign): New.
127 * decl.c (grok_special_member_properties): Handle move ctor/op=.
128 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
130 (do_build_copy_constructor): Use it.
131 (do_build_assign_ref): Likewise. Handle move assignment.
132 (build_stub_type, build_stub_object, locate_fn_flags): New.
133 (locate_ctor): Use locate_fn_flags.
134 (locate_copy, locate_dtor): Remove.
135 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
136 (process_subob_fn, synthesized_method_walk): New.
137 (maybe_explain_implicit_delete): New.
138 (implicitly_declare_fn): Use synthesized_method_walk,
139 type_has_trivial_fn, and type_set_nontrivial_flag.
140 (defaulted_late_check): Set DECL_DELETED_FN.
141 (defaultable_fn_check): Handle sfk_move_assignment.
142 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
143 implicitly deleted move ctor/op=.
144 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
145 (lookup_fnfields_slot): New.
146 * semantics.c (omp_clause_info_fndecl): Remove.
147 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
148 get_copy_assign, trivial_fn_p.
149 (trait_expr_value): Adjust call to locate_ctor.
150 * tree.c (special_function_p): Handle sfk_move_assignment.
152 * class.c (type_has_virtual_destructor): New.
153 * cp-tree.h: Declare it.
154 * semantics.c (trait_expr_value): Use it.
156 * call.c (build_over_call): Only give warnings with tf_warning.
158 * name-lookup.c (pop_scope): Handle NULL_TREE.
160 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
161 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
162 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
163 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
164 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
165 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
166 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
167 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
168 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
169 (sfk_assignment_operator): Rename to sfk_copy_assignment.
170 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
171 * search.c, semantics.c, tree.c: Adjust.
173 * pt.c (dependent_scope_ref_p): Remove.
174 (value_dependent_expression_p): Don't call it.
175 (type_dependent_expression_p): Here either.
176 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
177 if the scope isn't dependent.
179 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
183 * pt.c (has_value_dependent_address): New.
184 (value_dependent_expression_p): Check it.
185 (convert_nontype_argument): Likewise. Call decay_conversion before
186 folding if we want a pointer.
187 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
188 scope is the current instantiation.
190 2010-06-28 Jakub Jelinek <jakub@redhat.com>
193 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
196 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
198 * init.c: Do not include except.h.
201 * cp-lang.c: Likewise.
203 * semantics.c: Likewise.
205 * except.c: Likewise.
206 (init_exception_processing): Do not set the removed
207 lang_protect_cleanup_actions here.
208 (cp_protect_cleanup_actions): Make non-static and remove prototype.
209 (doing_eh): New, moved from except.c but removed the do_warning flag.
210 (expand_start_catch_block): Update doing_eh call.
211 (expand_end_catch_block): Likewise.
212 (build_throw): Likewise.
213 * cp-tree.h: Prototype cp_protect_cleanup_actions.
214 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
215 cp_protect_cleanup_actions.
216 * Make-lang.in: Update dependencies.
218 2010-06-26 Jason Merrill <jason@redhat.com>
220 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
221 constructor called with a single argument that takes a reference
222 to the constructor's class.
223 (BAD_CONVERSION_RANK): New.
224 (compare_ics): Use it to compare bad ICSes.
226 2010-06-25 Joseph Myers <joseph@codesourcery.com>
228 * lang-specs.h: Remove +e handling.
230 2010-06-24 Andi Kleen <ak@linux.intel.com>
232 * parser.c: (cp_parser_question_colon_clause):
233 Switch to use cp_lexer_peek_token.
234 Call warn_for_omitted_condop. Call pedwarn for omitted
237 2010-06-22 Jakub Jelinek <jakub@redhat.com>
240 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
241 datum and mark_rvalue_use on component.
244 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
245 the CALL_EXPR has no arguments.
247 2010-06-21 Jason Merrill <jason@redhat.com>
249 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
251 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
254 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
256 * name-lookup.c (struct arg_lookup): Convert namespaces and
257 classes fields to VEC.
258 (arg_assoc_namespace): Adjust for new type of namespaces.
259 (arg_assoc_class): Adjust for new type of classes.
260 (lookup_arg_dependent): Use make_tree_vector and
262 * typeck2.c (build_x_arrow): Use vec_member.
264 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
267 * error.c (dump_decl): Better wording for anonymous namespace.
269 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
271 * class.c (build_vtbl_initializer): Adjust computation of new_position
272 and which entry to add padding for.
274 2010-06-16 Jason Merrill <jason@redhat.com>
276 * except.c (check_noexcept_r): Return the problematic function.
277 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
278 * pt.c (tsubst_copy_and_build): Pass it.
279 * parser.c (cp_parser_unary_expression): Likewise.
280 * cp-tree.h: Adjust prototype.
282 * method.c (defaulted_late_check): Give the defaulted method
283 the same exception specification as the implicit declaration.
285 2010-06-15 Jason Merrill <jason@redhat.com>
287 * class.c (add_implicitly_declared_members): Implicit assignment
288 operators can also be virtual overriders.
289 * method.c (lazily_declare_fn): Likewise.
291 * call.c (convert_like_real): Give "initializing argument of"
292 information for ambiguous conversion. Give source position
295 * call.c (print_z_candidates): Do print viable deleted candidates.
296 (joust): Don't choose a deleted function just because its worst
297 conversion is better than another candidate's worst.
299 * call.c (convert_like_real): Don't complain about
300 list-value-initialization from an explicit constructor.
302 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
303 DECL_SOURCE_LOCATION directly.
305 * class.c (type_has_user_provided_default_constructor): Use
308 * call.c (is_subseq): Handle ck_aggr, ck_list.
309 (compare_ics): Treat an aggregate or ambiguous conversion to the
310 same type as involving the same function.
312 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
314 * typeck.c (convert_for_assignment): Fix comment. Change message
315 format from %d to %qP.
316 (convert_for_initialization): Fix comment.
318 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
320 * cp-tree.h (expr_list_kind): New type.
321 (impl_conv_rhs): New type.
322 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
324 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
325 diagnostics for easy translation. Change caller.
326 (convert_for_initialization): Use impl_conv_rhs and change caller.
327 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
328 diagnostics for easy translation. Change caller.
329 * decl.c (bad_spec_place): New enum.
330 (bad_specifiers): Use it and emit the diagnostics for easy
331 translation. Change caller.
332 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
334 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
336 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
338 * decl2.c (cp_write_global_declarations): Adjust for new type of
340 * name-lookup.c (current_decl_namespace): Likewise.
341 (push_decl_namespace): Likewise.
342 (pop_decl_namespace): Likewise.
344 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
346 * call.c (build_java_interface_fn_ref): Call build_function_type_list
347 instead of build_function_type.
348 * decl.c (cxx_init_decl_processing): Likewise.
349 (declare_global_var): Likewise.
350 (get_atexit_node): Likewise.
351 (expand_static_init): Likewise.
352 * decl2.c (start_objects): Likewise.
353 (start_static_storage_duration_function): Likewise.
354 * except.c (init_exception_processing): Likewise.
355 (build_exc_ptr): Likewise.
356 (build_throw): Likewise.
357 * rtti.c (throw_bad_cast): Likewise.
358 (throw_bad_typeid): Likewise.
359 (build_dynamic_cast_1): Likewise.
361 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
363 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
364 (build_op_delete_call): Likewise.
365 (build_over_call): Likewise.
366 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
367 * pt.c (process_partial_specialization): Likewise.
368 (tsubst_template_args): Likewise.
369 * semantics.c (finish_asm_stmt): Likewise.
371 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
373 * decl.c (record_key_method_defined): New, broken out of ...
374 (finish_function): ... here. Call it.
375 (start_decl): Treat aliases as definitions.
377 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
379 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
381 * pt.c (maybe_process_partial_specialization): Likewise.
382 (register_specialization): Likewise.
383 (add_pending_template): Likewise.
384 (lookup_template_class): Likewise.
385 (push_tinst_level): Likewise.
387 * parser.c (cp_lexer_new_main): Likewise.
388 (cp_lexer_new_from_tokens): Likewise.
389 (cp_token_cache_new): Likewise.
390 (cp_parser_context_new): Likewise.
391 (cp_parser_new): Likewise.
392 (cp_parser_nested_name_specifier_opt): Likewise.
393 (cp_parser_template_id): Likewise.
395 * name-lookup.c (binding_entry_make): Likewise.
396 (binding_table_construct): Likewise.
397 (binding_table_new): Likewise.
398 (cxx_binding_make): Likewise.
399 (pushdecl_maybe_friend): Likewise.
400 (begin_scope): Likewise.
401 (push_to_top_level): Likewise.
403 * lex.c (init_reswords): Likewise.
404 (retrofit_lang_decl): Likewise.
405 (cxx_dup_lang_specific_decl): Likewise.
406 (copy_lang_type): Likewise.
407 (cxx_make_type): Likewise.
409 * decl.c (make_label_decl): Likewise.
410 (check_goto): Likewise.
411 (start_preparsed_function): Likewise.
412 (save_function_data): Likewise.
414 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
416 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
418 * class.c (finish_struct_1): Likewise.
420 * cp-tree.h (struct lang_type): Add variable_size GTY option.
421 (struct lang_decl): Likewise.
423 * parser.c (cp_parser_new): Update comment to not reference
426 2010-06-07 Jason Merrill <jason@redhat.com>
429 * error.c (dump_parameters): Mask out TFF_SCOPE.
430 (dump_simple_decl): Don't print the scope of a PARM_DECL.
431 (dump_scope): Remove no-op mask.
434 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
436 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
437 * init.c (build_offset_ref): Use it.
438 * pt.c (maybe_process_partial_specialization): Use it.
439 (instantiate_class_template): Use it.
440 * search.c (lookup_base): Use it.
442 2010-06-07 Jakub Jelinek <jakub@redhat.com>
445 * expr.c (mark_exp_read): Handle INDIRECT_REF.
446 * cvt.c (convert_to_void): Handle INDIRECT_REF like
450 * decl.c (initialize_local_var): If TREE_USED is set on the type,
451 set also DECL_READ_P on the decl.
453 2010-05-25 Dodji Seketeli <dodji@redhat.com>
456 * cp-tree.h (typedef_variant_p): Move this declaration to
458 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
459 * decl.c (grokdeclarator): Do not rename debug info of an
460 anonymous tagged type named by a typedef.
462 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
465 * class.c (check_field_decls): Move the call to
466 check_bitfield_decl before trying to set the
467 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
469 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
471 * typeck.c: Update include path for moved files.
474 * cp-gimplify.c: Likewise.
475 * cp-lang.c: Likewise.
477 * semantics.c: Likewise.
478 * cxx-pretty-print.h: Likewise.
480 * parser.c: Likewise.
481 * cp-objcp-common.c: Likewise.
482 * cp-tree.h: Likewise.
483 * name-lookup.c: Likewise.
485 * name-lookup.h: Likewise.
486 * config-lang.in: Update paths in gtfiles for files in c-family/.
487 * Make-lang.in: Likewise.
489 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
491 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
492 * typeck.c (build_ptrmemfunc): Likewise.
494 2010-06-04 Jason Merrill <jason@redhat.com>
496 * typeck2.c (merge_exception_specifiers): Adjust merging of
497 throw() and noexcept(true).
499 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
500 using an uninitialized variable.
502 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
503 (pp_cxx_expression): Likewise.
505 Implement noexcept-specification (15.4)
506 * parser.c (cp_parser_exception_specification_opt): Parse it.
507 Give -Wdeprecated warning about throw() specs.
508 * pt.c (tsubst_exception_specification): Handle it.
509 * error.c (dump_exception_spec): Handle it.
510 (dump_expr): Handle NOEXCEPT_EXPR.
511 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
512 * typeck.c (comp_except_specs): Handle compatibility rules.
513 Change exact parm to take an enum.
514 * typeck2.c (merge_exception_specifiers): Handle noexcept.
515 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
516 (type_throw_all_p, build_noexcept_spec): New fns.
517 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
518 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
519 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
520 (noexcept_true_spec, noexcept_false_spec): New macros.
521 * name-lookup.c (pushdecl_maybe_friend): Adjust.
522 * search.c (check_final_overrider): Adjust.
523 * decl.c (check_redeclaration_exception_specification): Adjust.
524 (use_eh_spec_block): Use type_throw_all_p.
525 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
526 Give operator new a noexcept-specification in C++0x mode.
527 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
528 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
530 Implement noexcept operator (5.3.7)
531 * cp-tree.def (NOEXCEPT_EXPR): New.
532 * except.c (check_noexcept_r, finish_noexcept_expr): New.
533 * cp-tree.h: Declare finish_noexcept_expr.
534 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
535 * pt.c (tsubst_copy_and_build): And tsubst it.
536 (type_dependent_expression_p): Handle it.
537 (value_dependent_expression_p): Handle it.
539 * call.c (build_conditional_expr): Never fold in unevaluated context.
540 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
541 * semantics.c (simplify_aggr_init_expr): Likewise.
542 * typeck.c (merge_types): Call merge_exception_specifiers.
543 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
544 DECL_ANTICIPATED for preferring new type.
546 2010-06-04 Joseph Myers <joseph@codesourcery.com>
548 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
551 2010-06-04 Jakub Jelinek <jakub@redhat.com>
554 * typeck.c (build_class_member_access_expr): Call mark_exp_read
555 on object for static data members.
557 2010-06-04 Jakub Jelinek <jakub@redhat.com>
558 Jason Merrill <jason@redhat.com>
561 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
562 with the same type, call mark_lvalue_use on both.
564 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
566 * class.c (struct vtbl_init_data_s): Remove last_init field.
567 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
569 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
571 (build_vtt): Likewise.
572 (initialize_vtable): Take a VEC instead of a tree.
573 (build_vtt_inits): Change return type to void. Take a VEC **
574 instead of a tree *; accumulate results into said VEC.
575 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
576 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
577 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
579 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
580 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
582 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
583 rather than tree_cons.
584 (build_vbase_offset_vtbl_entries): Likewise.
585 (add_vcall_offset): Likewise.
586 (build_rtti_vtbl_entries): Likewise.
587 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
588 * decl.c (initialize_artificial_var): Use build_constructor instead
589 of build_constructor_from_list.
591 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
594 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
597 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
599 * parser.c (cp_parser_mem_initializer_list): Change error text.
601 2010-06-02 Jakub Jelinek <jakub@redhat.com>
603 * cp-objcp-common.c (shadowed_var_for_decl): Change into
604 tree_decl_map hashtab from tree_map.
605 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
606 (init_shadowed_var_for_decl): Adjust initialization.
609 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
610 instead of calling mark_exp_read only when not an assignment.
613 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
614 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
615 Set DECL_VALUE_EXPR on var.
617 2010-06-02 Jason Merrill <jason@redhat.com>
619 * error.c (dump_type): Improve typedef handling.
624 * name-lookup.c (same_entity_p): New.
625 (ambiguous_decl): Multiple declarations of the same entity
628 2010-06-01 Jason Merrill <jason@redhat.com>
631 * call.c (add_list_candidates): Prefer the default constructor.
632 (build_aggr_conv): Treat missing initializers like { }.
633 * typeck2.c (process_init_constructor_record): Likewise.
634 * init.c (expand_default_init): Use digest_init for
635 direct aggregate initialization, too.
637 * call.c (add_list_candidates): Split out...
638 (build_user_type_conversion_1): ...from here.
639 (build_new_method_call): And here.
640 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
643 * call.c (build_list_conv): Set list-initialization flags properly.
645 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
647 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
649 2010-06-01 Arnaud Charlet <charlet@adacore.com>
650 Matthew Gingell <gingell@adacore.com>
652 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
653 * decl2.c: Include langhooks.h and c-ada-spec.h.
654 (cpp_check, collect_source_refs, collect_ada_namespace,
655 collect_all_refs): New functions.
656 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
657 * lang-specs.h: Ditto.
659 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
661 * cp-tree.h (cp_build_function_call_nary): Declare.
662 * typeck.c (cp_build_function_call_nary): Define.
663 * decl.c (register_dtor_fn): Use it instead of
664 cp_build_function_call.
665 (cxx_maybe_build_cleanup): Likewise.
666 * decl2.c (generate_ctor_or_dtor_function): Likewise.
667 * except.c (do_get_exception_ptr): Likewise.
668 (do_begin_catch): Likewise.
669 (do_allocate_exception): Likewise.
670 (do_free_exception): Likewise.
671 (build_throw): Likewise. Use cp_build_function_call_vec instead
672 of cp_build_function_call.
673 (do_end_catch): Likewise.
675 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
677 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
678 (struct cp_declarator): Move id_loc field up.
680 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
682 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
683 this file is included before c-common.h. Define GCC_DIAG_STYLE
684 before including diagnostic-core.h and toplev.h.
685 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
686 * pt.c: Include cp-tree.h before c-common.h.
688 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
690 * tree.c (c_register_addr_space): Add stub.
692 2010-05-28 Joseph Myers <joseph@codesourcery.com>
694 * g++spec.c (lang_specific_driver): Use fatal_error instead of
697 2010-05-28 Dodji Seketeli <dodji@redhat.com>
699 Revert fix of PR c++/44188
700 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
702 * tree.c (typedef_variant_p): Revert moving this definition to
704 * decl.c (grokdeclarator): Revert naming typedef handling.
706 2010-05-27 Joseph Myers <joseph@codesourcery.com>
708 * call.c: Include diagnostic-core.h instead of diagnostic.h.
709 * cp-lang.c: Don't include diagnostic.h
710 * name-lookup.c: Include diagnostic-core.h instead of
712 (cp_emit_debug_info_for_using): Use seen_error.
713 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
714 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
715 * pt.c (iterative_hash_template_arg): Use seen_error.
716 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
717 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
718 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
719 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
722 2010-05-25 Dodji Seketeli <dodji@redhat.com>
725 * cp-tree.h (typedef_variant_p): Move this declaration to
727 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
728 * decl.c (grokdeclarator): Do not rename debug info of an
729 anonymous tagged type named by a typedef.
731 2010-05-27 Jason Merrill <jason@redhat.com>
734 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
737 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
740 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
741 * class.c (layout_class_type): Likewise.
742 * decl.c (finish_enum): Likewise.
743 * mangle.c (write_builitin_type): Likewise.
745 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
747 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
749 * decl.c (grokdeclarator): Handle __int128.
750 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
751 (cp_parser_simple_type_specifier): Likewise.
752 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
753 * typeck.c (cp_common_type): Handle __int128.
754 * mangle.c (integer_type_codes): Add itk_int128 and
757 2010-05-26 Jason Merrill <jason@redhat.com>
760 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
763 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
765 * cp-lang.c: Do not include expr.h.
767 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
769 * decl.c: Do not include rtl.h
770 * semantics.c: Likewise.
772 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
774 * cp-tree.h: Do not include splay-tree.h.
775 (struct prtmem_cst): Remove unused field and false comment.
776 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
777 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
778 * init.c: Do not include rtl.h and expr.h.
779 * class.c: Do not include rtl.h. Include splay-tree.h.
780 (build_clone): Use plain NULL instead of NULL_RTX.
781 * decl.c: Do not include expr.h. Explain why rtl.h has to be
782 included. Include splay-tree.h.
783 * method.c: Do not include rtl.h and expr.h.
784 (use_thunk): Use plain NULL instead of NULL_RTX.
785 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
786 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
787 and target.h. Include splay-tree.h.
788 * expr.c: Do not include rtl.h and expr.h.
789 * pt.c: Do not include obstack.h and rtl.h.
790 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
791 (tsubst_decl): Likewise.
792 (instantiate_decl): Likewise.
793 * semantics.c: Do not include exprt.h and debug.h. Explain why
794 rtl.h has to be included.
795 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
796 * call.c: Do not include rtl.h and expr.h.
797 * search.c: Do not include obstack.h and rtl.h.
798 * friend.c: Do not include rtl.h and expr.h.
799 * Make-lang.in: Update dependencies.
801 2010-05-25 Jakub Jelinek <jakub@redhat.com>
804 * parser.c (non_integral_constant): Add NIC_NONE.
805 (required_token): Add RT_NONE.
806 (cp_parser_unary_expression): Initialize non_constant_p
808 (cp_parser_asm_definition): Initialize missing to RT_NONE.
809 (cp_parser_primary_expression, cp_parser_postfix_expression,
810 cp_parser_cast_expression, cp_parser_binary_expression,
811 cp_parser_functional_cast): Fix formatting.
813 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
816 * parser.c: Remove inclusion of dyn-string.h.
817 (non_integral_constant): New enum.
818 (name_lookup_error): New enum.
819 (required_token): New enum.
820 (cp_parser_required_error): New function.
821 (cp_parser_require): Change the type of variable token_desc to
822 required_token and use cp_parser_required_error.
823 (cp_parser_require_keyword): Likewise.
824 (cp_parser_error): Use gmsgid as parameter.
825 (cp_parser_name_lookup_error): Change the type of variable desired to
826 name_lookup_error and put the diagnostic in the full sentences. Change
828 (cp_parser_non_integral_constant_expression): Change the type of the
829 variable thing to non_integral_constant and put the diagnostics in
830 full sentences. Change caller.
832 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
835 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
837 2010-05-24 Joseph Myers <joseph@codesourcery.com>
839 * error.c (cp_diagnostic_starter): Update call to
840 diagnostic_build_prefix.
841 (cp_print_error_function,
842 print_instantiation_partial_context_line): Check show_column flag
845 2010-05-24 Jason Merrill <jason@redhat.com>
848 * decl.c (check_initializer): Don't wrap an init-list in a
850 * init.c (build_aggr_init): Don't assume copy-initialization if
851 init has CONSTRUCTOR_IS_DIRECT_INIT.
852 * call.c (build_new_method_call): Sanity check.
854 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
856 * rtti.c (tinfo_base_init): Use build_constructor instead of
857 build_constructor_from_list. Don't cons a tree node for
859 (generic_initializer): Use build_constructor_single instead of
860 build_constructor_from_list.
861 (ptr_initializer): Use build_constructor instead of
862 build_constructor_from_list
863 (ptm_initializer): Likewise.
864 (class_initializer): Likewise. Take varargs instead of TRAIL.
865 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
866 build_constructor instead of build_constructor_from_list.
868 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
870 * semantics.c: Include bitmap.h.
871 * Make-lang.in: Update dependencies.
873 2010-05-22 Jan Hubicka <jh@suse.cz>
875 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
877 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
879 2010-05-21 Joseph Myers <joseph@codesourcery.com>
881 * cxx-pretty-print.c: Correct merge error.
883 2010-05-21 Joseph Myers <joseph@codesourcery.com>
885 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
886 (cp_print_error_function): Use diagnostic_abstract_origin macro.
887 (cp_printer): Handle %K here using percent_K_format.
888 * cxx-pretty-print.c: Include tree-pretty-print.h.
889 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
892 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
894 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
895 Clean up redundant includes.
897 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
900 * decl.c (xref_basetypes): Return false in case of ill-formed
903 2010-05-19 Jason Merrill <jason@redhat.com>
905 * call.c (reference_binding): Use cp_build_qualified_type_real
906 and cp_type_quals consistently.
907 (add_function_candidate): Likewise.
908 (build_conditional_expr): Likewise.
909 (convert_like_real): Likewise.
910 (type_passed_as): Likewise.
911 * class.c (add_method): Likewise.
912 (same_signature_p): Likewise.
913 (layout_class_type): Likewise.
914 * decl.c (cxx_init_decl_processing): Likewise.
915 (cp_fname_init): Likewise.
916 (grokdeclarator): Likewise.
917 * decl2.c (cp_reconstruct_complex_type): Likewise.
918 * init.c (build_new_1): Likewise.
919 * method.c (do_build_copy_constructor): Likewise.
920 (implicitly_declare_fn): Likewise.
921 * pt.c (tsubst_aggr_type): Likewise.
923 * rtti.c (init_rtti_processing): Likewise.
924 (build_headof): Likewise.
925 (build_dynamic_cast_1): Likewise.
926 (tinfo_base_init): Likewise.
927 (emit_support_tinfos): Likewise.
928 * semantics.c (capture_decltype): Likewise.
929 * tree.c (cv_unqualified): Likewise.
930 * typeck.c (composite_pointer_type): Likewise.
931 (string_conv_p): Likewise.
933 * mangle.c (write_CV_qualifiers_for_type): Tweak.
935 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
936 * decl.c (start_decl): Likewise.
937 * semantics.c (finish_compound_literal): Likewise.
938 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
939 (cp_type_readonly): Remove.
940 * cp-tree.h: Remove declaration.
942 * typeck.c (merge_types): Preserve memfn quals.
944 * decl.c (grokdeclarator): Don't check quals on fn type.
945 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
946 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
949 * typeck.c (type_memfn_quals): New fn.
950 (apply_memfn_quals): New fn.
951 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
952 (cp_type_readonly): Use cp_type_quals.
953 * cp-tree.h: Add declarations.
954 * tree.c (cp_build_qualified_type_real): Don't set, but do
955 preserve, quals on FUNCTION_TYPE.
956 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
957 * decl.c (build_ptrmem_type): Likewise.
958 (grokdeclarator): Likewise.
959 (static_fn_type): Likewise.
960 * decl2.c (change_return_type): Likewise.
961 (cp_reconstruct_complex_type): Likewise.
962 * pt.c (tsubst_function_type): Likewise.
964 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
966 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
968 * tree.c (build_min_non_dep_call_vec): Update comment.
970 2010-05-17 Jason Merrill <jason@redhat.com>
972 * call.c (struct z_candidate): Add explicit_targs field.
973 (add_template_candidate_real): Set it.
974 (build_over_call): Use it to control init-list warning.
977 * call.c (build_over_call): Limit init-list deduction warning to
978 cases where the argument is actually an init-list.
981 * call.c (build_over_call): Don't do bitwise copy for move ctor.
983 2010-05-17 Dodji Seketeli <dodji@redhat.com>
984 Jason Merrill <jason@redhat.com>
987 * decl.c (compute_array_index_type): Call mark_rvalue_use.
989 2010-05-15 Jason Merrill <jason@redhat.com>
991 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
992 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
994 (finish_eh_spec_block): Adjust.
996 2010-05-15 Jakub Jelinek <jakub@redhat.com>
999 * pt.c (tsubst): Unshare template argument.
1001 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1003 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1004 * Make-lang.in: Fix dependencies accordingly.
1006 2010-05-14 Jason Merrill <jason@redhat.com>
1009 * except.c (build_throw): Simplify, adjust for DR 475.
1012 * except.c (dtor_nothrow): Return nonzero for type with
1016 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1017 gimple_build_eh_must_not_throw.
1019 2010-05-14 Martin Jambor <mjambor@suse.cz>
1021 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1024 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1026 * call.c (build_new_method_call): Change warning text.
1027 * typeck2.c (build_functional_cast): Change error text.
1029 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1032 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1033 shadowing the outer parameter or variables by the declaration of
1034 nested function in nested structure or class. Warn the shadowing by
1035 the declaration of nested lambda expression.
1037 2010-05-13 Jason Merrill <jason@redhat.com>
1039 * typeck.c (cp_build_array_ref): Factor out from...
1040 (build_array_ref): ...here. Drop complain parm.
1041 (build_new_op): Adjust.
1042 * class.c (build_vtbl_ref_1): Adjust.
1043 * decl2.c (grok_array_decl): Adjust.
1044 * cp-tree.h: Adjust prototypes.
1046 2010-05-13 Jan Hubicka <jh@suse.cz>
1048 * decl.c (cp_finish_decl): Do not worry about used attribute.
1050 2010-05-12 Jason Merrill <jason@redhat.com>
1052 * typeck.c (build_array_ref): Take complain parm.
1053 * cp-tree.h: Add it to prototype.
1054 * call.c (build_new_op): Pass it.
1055 * class.c (build_vtbl_ref): Pass it.
1056 * decl2.c (grok_array_decl): Pass it.
1060 * cp-tree.def (NULLPTR_TYPE): Remove.
1061 * cp-tree.h (NULLPTR_TYPE_P): New.
1062 (SCALAR_TYPE_P): Use it.
1063 (nullptr_type_node): New.
1064 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1065 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1067 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1068 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1069 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1070 * mangle.c (write_type): Likewise.
1071 * name-lookup.c (arg_assoc_type): Likewise.
1072 * typeck.c (build_reinterpret_cast_1): Likewise.
1073 * rtti.c (typeinfo_in_lib_p): Likewise.
1074 (emit_support_tinfos): Remove local nullptr_type_node.
1076 * cp-tree.h (UNKNOWN_TYPE): Remove.
1077 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1078 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1079 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1080 * class.c (instantiate_type): Check unknown_type_node rather than
1082 * name-lookup.c (maybe_push_decl): Likewise.
1083 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1084 (get_typeid): Likewise.
1085 * semantics.c (finish_offsetof): Likewise.
1088 * call.c (add_template_candidate_real): If deduction fails, still
1089 add the template as a non-viable candidate.
1090 (equal_functions): Handle template candidates.
1091 (print_z_candidate): Likewise.
1092 (print_z_candidates): Likewise.
1093 (build_new_function_call): Likewise.
1095 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1096 * call.c (add_candidates): Enforce it.
1097 (build_new_method_call): Try non-list ctor if no viable list ctor.
1098 (build_user_type_conversion_1): Likewise.
1100 * call.c (add_candidates): Distinguish between type(x) and
1102 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1103 (build_new_method_call): Give better error for conversion op.
1105 * call.c (add_candidates): Add first_arg and return_type parms.
1106 Add special constructor/conversion op handling.
1107 (convert_class_to_reference): Use it.
1108 (build_user_type_conversion_1): Likewise.
1109 (build_op_call): Likewise.
1110 (build_new_method_call): Likewise.
1111 (build_new_op): Adjust.
1112 (perform_overload_resolution): Adjust.
1114 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1119 * pt.c (process_partial_specialization): Return error_mark_node
1120 in case of unused template parameters in partial specialization.
1122 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1125 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1126 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1127 look at its second operand.
1129 2010-05-10 Jason Merrill <jason@redhat.com>
1132 * semantics.c (baselink_for_fns): Revert earlier change.
1135 * typeck.c (cp_build_modify_expr): Complain about assignment to
1136 array from init list.
1138 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1141 * decl.c (check_initializer): strip array type before checking for
1142 uninitialized const or ref members.
1144 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1147 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1148 error count. Emit errors only if compain is true.
1149 (build_new_1): Do not return error_mark_node if
1150 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1151 errors. Delay the check for user-provided constructor.
1152 (perform_member_init): Adjust.
1153 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1156 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1157 Jason Merrill <jason@redhat.com>
1159 Add support for C++0x nullptr.
1160 * cp-tree.def: Add NULLPTR_TYPE.
1161 * cp-tree.h: Add nullptr_node.
1162 (cp_tree_index): Add CPTI_NULLPTR.
1163 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1164 * call.c (null_ptr_cst_p): Handle nullptr.
1165 (standard_conversion): Likewise.
1166 (convert_arg_to_ellipsis): Likewise.
1167 * mangle.c (write_type): Likewise.
1168 * name-lookup.c (arg_assoc_type): Likewise.
1169 * parser.c (cp_parser_primary_expression): Likewise.
1170 * typeck.c (cp_build_binary_op): Likewise.
1171 (build_reinterpret_cast_1): Likewise.
1172 * error.c (dump_type): Likewise.
1173 (dump_type_prefix, dump_type_suffix): Likewise.
1174 * decl.c (cxx_init_decl_processing): Likewise.
1175 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1176 * cvt.c (ocp_convert): Likewise.
1177 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
1178 nullptr_t tinfo in libsupc++.
1180 2010-05-06 Jason Merrill <jason@redhat.com>
1182 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
1184 2010-04-22 Jakub Jelinek <jakub@redhat.com>
1185 Dodji Seketeli <dodji@redhat.com>
1188 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
1190 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
1191 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
1192 (decay_conversion, perform_integral_promotions): Call rvalue_use.
1193 (cp_build_unary_op): Call lvalue_use.
1194 * decl.c (unused_but_set_errorcount): New variable.
1195 (poplevel): Issue -Wunused-but-set-variable diagnostics.
1196 (duplicate_decls): Merge DECL_READ_P flags.
1197 (start_cleanup_fn): Set DECL_READ_P flag.
1198 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
1199 * tree.c (rvalue): Call rvalue_use.
1200 * pt.c (convert_nontype_argument): Likewise.
1201 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
1202 finish_decltype_type): Likewise.
1203 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
1204 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
1205 or rvalue_use depending on the expr.
1206 * init.c (build_new, build_delete): Likewise.
1207 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
1209 2010-05-05 Jason Merrill <jason@redhat.com>
1212 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
1213 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
1215 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1218 * pt.c (unify): Check each elt for error_mark_node.
1220 2010-05-04 Jason Merrill <jason@redhat.com>
1223 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
1225 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1228 * call.c (build_new_method_call): Return error_mark_node if fns is
1231 2010-05-03 Dodji Seketeli <dodji@redhat.com>
1234 * pt.c (most_specialized_class): Pretend we are processing
1235 a template decl during the call to coerce_template_parms.
1237 2010-05-03 Jason Merrill <jason@redhat.com>
1241 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
1242 from the selected underlying type unless -fstrict-enums. Set
1243 ENUM_UNDERLYING_TYPE to have the restricted range.
1244 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
1245 * class.c (check_bitfield_decl): Likewise.
1247 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
1250 * init.c (build_new_1): Revert the accidental checkin in
1253 2010-04-30 Jason Merrill <jason@redhat.com>
1256 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
1257 (pp_cxx_type_specifier_seq): ...here.
1259 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
1261 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
1262 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
1264 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
1267 * typeck.c (warn_args_num): New function.
1268 (convert_arguments): Use warn_args_num to print the diagnostic
1271 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
1274 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
1275 user-provided constructor while recursing.
1277 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
1280 * error.c (print_instantiation_partial_context_line): Handle
1281 recursive instantiation.
1282 (print_instantiation_partial_context): Likewise.
1284 2010-04-27 Jason Merrill <jason@redhat.com>
1286 * init.c (perform_member_init): Check CLASS_TYPE_P.
1288 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1291 * init.c (perform_member_init): check for uninitialized const or
1292 reference members, including array types.
1294 2010-04-24 Jason Merrill <jason@redhat.com>
1296 * tree.c (get_fns): Split out from get_first_fn.
1297 * cp-tree.h: Declare it.
1298 * search.c (shared_member_p): Use it.
1299 * semantics.c (finish_qualified_id_expr): Simplify.
1300 (finish_id_expression): Simplify.
1302 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
1303 whenever object is NULL_TREE. Don't do 'this' capture here.
1304 (finish_qualified_id_expr): Pass NULL_TREE.
1305 (finish_id_expression): Likewise.
1306 (lambda_expr_this_capture): Likewise.
1308 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
1309 rather than checking current_class_ref directly.
1310 (finish_call_expr): Likewise.
1313 * name-lookup.c (qualify_lookup): Disqualify lambda op().
1314 * class.c (current_nonlambda_class_type): New fn.
1315 * semantics.c (nonlambda_method_basetype): New.
1316 * cp-tree.h: Declare them.
1317 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1319 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1322 * semantics.c (lambda_return_type): Complain about
1326 * tree.c (cv_unqualified): Handle error_mark_node.
1329 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1330 if we don't want errors.
1333 * class.c (convert_to_base): Add complain parameter. Pass
1334 ba_quiet to lookup_base if we don't want errors.
1335 (build_vfield_ref): Pass complain to convert_to_base.
1336 * call.c (convert_like_real): Likewise.
1337 (initialize_reference): Likewise.
1338 (perform_direct_initialization_if_possible): Pass complain to
1340 * cp-tree.h: Adjust.
1342 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1343 Jason Merrill <jason@redhat.com>
1346 * decl.c (check_for_uninitialized_const_var): Handle classes that need
1348 (check_initializer): Call it for classes that need constructing, too.
1349 * class.c (in_class_defaulted_default_constructor): New.
1350 * cp-tree.h: Declare it.
1352 2010-04-20 Jason Merrill <jason@redhat.com>
1355 * init.c (constant_value_1): Treat error_mark_node as a constant
1356 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1357 * cvt.c (ocp_convert): Handle getting error_mark_node from
1358 integral_constant_value.
1359 * decl.c (compute_array_index_type): Likewise.
1361 2010-04-20 Dodji Seketeli <dodji@redhat.com>
1365 * typeck.c (incompatible_dependent_types_p): If one of the
1366 compared types if not a typedef then honour their main variant
1369 2010-04-20 Jakub Jelinek <jakub@redhat.com>
1371 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1373 2010-04-19 Dodji Seketeli <dodji@redhat.com>
1376 * typeck.c (structural_comptypes): Test dependent typedefs
1377 incompatibility before testing for their main variant based
1380 2010-04-19 Jakub Jelinek <jakub@redhat.com>
1382 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
1383 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
1385 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
1387 * decl.c (cxx_init_decl_processing): Remove second argument in call to
1388 build_common_tree_nodes.
1390 2010-04-14 Jason Merrill <jason@redhat.com>
1393 * parser.c (cp_parser_parenthesized_expression_list): Change
1394 is_attribute_list parm to int to indicate whether or not to
1395 handle initial identifier specially.
1396 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
1398 2010-04-13 Jason Merrill <jason@redhat.com>
1400 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
1402 * parser.c (cp_parser_lambda_expression): Complain about lambda in
1403 unevaluated context.
1404 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
1406 2010-04-12 Jason Merrill <jason@redhat.com>
1409 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
1410 return value directly.
1412 * call.c (type_decays_to): Call cv_unqualified for non-class type.
1414 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
1417 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
1418 * init.c (build_new_1): Check for uninitialized const members and
1419 uninitialized reference members, when using new without
1420 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
1421 (diagnose_uninitialized_cst_or_ref_member): Define, call
1422 diagnose_uninitialized_cst_or_ref_member_1.
1423 (diagnose_uninitialized_cst_or_ref_member_1): New function.
1425 2010-04-12 Richard Guenther <rguenther@suse.de>
1428 * semantics.c (expand_or_defer_fn_1): Do not keep extern
1429 template inline functions.
1431 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1434 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
1437 2010-04-07 Jason Merrill <jason@redhat.com>
1440 * decl.c (start_preparsed_function): Do defer nested functions.
1442 PR c++/11094, DR 408
1443 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
1444 * decl2.c (finish_static_data_member_decl): Set it.
1445 * decl.c (duplicate_decls): Propagate it.
1446 * pt.c (tsubst_decl): Don't substitute the domain of an array
1447 VAR_DECL if it's set.
1448 (regenerate_decl_from_template): Substitute it here.
1449 (type_dependent_expression_p): Return true if it's set.
1450 * semantics.c (finish_decltype_type): Instantiate such a variable.
1451 * typeck.c (cxx_sizeof_expr): Likewise.
1452 (strip_array_domain): New.
1455 * name-lookup.c (current_decl_namespace): Non-static.
1456 (pop_nested_namespace): Sanity check.
1457 * cp-tree.h: Declare current_decl_namespace.
1458 * decl.c (grokvardecl): Use it instead of current_namespace.
1459 (grokfndecl): Likewise.
1462 * pt.c (tsubst_friend_function): Instatiate a friend that has already
1465 * pt.c (print_template_statistics): New.
1466 * cp-tree.h: Declare it.
1467 * tree.c (cxx_print_statistics): Call it.
1470 * decl.c (grokvardecl): Tweak warning message.
1471 (grokfndecl): Likewise.
1473 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1476 *pt.c (tsubst_decl): Get the arguments of a specialization from
1477 the specialization template, not from the most general template.
1479 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1482 * typeck2.c (process_init_constructor_record):
1483 value-initialize members that are are not explicitely
1486 2010-04-07 Jie Zhang <jie@codesourcery.com>
1489 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
1490 when all of its elements are non-constant and have been split out.
1492 2010-04-06 Taras Glek <taras@mozilla.com>
1493 Jason Merrill <jason@redhat.com>
1495 * parser.c (cp_parser_class_specifier): Set class location to that
1496 of IDENTIFIER_NODE instead of '{' when possible.
1497 * semantics.c (begin_class_definition): Do not overide locations
1498 with less precise ones.
1500 2010-04-06 Jason Merrill <jason@redhat.com>
1503 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
1506 * pt.c (maybe_update_decl_type): Check the return value from
1509 2010-04-01 Jason Merrill <jason@redhat.com>
1511 * decl.c (next_initializable_field): No longer static.
1512 * cp-tree.h: Declare it.
1513 * call.c (build_aggr_conv): Fail if there are more initializers
1514 than initializable fields.
1516 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
1517 instead of void_zero_node.
1519 2010-03-31 Dodji Seketeli <dodji@redhat.com>
1522 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
1523 * pt.c (end_template_parm_list): Store sibling template parms of
1524 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1525 (push_template_decl_real): Don't store the containing template decl
1526 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
1527 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
1528 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1531 2010-03-30 Jason Merrill <jason@redhat.com>
1534 * pt.c (push_template_decl_real): Deal better with running out of
1535 scopes before running out of template parms.
1539 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
1540 function parameter context. Don't print an error if parsing
1544 * pt.c (more_specialized_fn): Don't control cv-qualifier check
1547 2010-03-26 Jason Merrill <jason@redhat.com>
1550 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
1551 c++0x mode, but not other type-names.
1553 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1556 * pt.c (add_to_template_args): Support NULL ARGS;
1557 (most_specialized_class): call coerce_template_parms on
1558 template arguments passed to get_class_bindings. Use
1559 add_to_template_args.
1560 (unify): Handle VAR_DECLs.
1562 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1564 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
1566 * pt.c (get_template_parms_at_level): Adjust.
1568 2010-03-25 Dodji Seketeli <dodji@redhat.com>
1571 * cp-tree.h (get_template_parms_at_level): Declare ...
1572 * pt.c (get_template_parms_at_level): ... new function.
1573 * typeck.c (get_template_parms_of_dependent_type): If a template
1574 type parm's DECL_CONTEXT isn't yet set, get its siblings from
1575 current_template_parms. Use get_template_parms_at_level. Remove
1577 (incompatible_dependent_types_p): If we get empty parms from just one
1578 of the template type parms we are comparing then the template parms are
1581 2010-03-24 Jason Merrill <jason@redhat.com>
1584 * parser.c (make_declarator): Initialize id_loc.
1585 (cp_parser_lambda_declarator_opt): And set it.
1587 2010-03-23 Jason Merrill <jason@redhat.com>
1589 Make lambda conversion op and op() non-static.
1590 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
1591 Also add the thunk function returned by the conversion op.
1592 Mark the conversion deleted if the op() is variadic.
1593 * decl2.c (mark_used): Give helpful message about deleted conversion.
1594 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
1595 * semantics.c (finish_this_expr): Adjust.
1596 * mangle.c (write_closure_type_name): Adjust.
1597 * decl.c (grok_op_properties): Don't allow it.
1598 * call.c (build_user_type_conversion_1): No static conversion ops.
1599 (build_op_call): Or op().
1601 * decl2.c (change_return_type): Fix 'this' quals.
1603 2010-03-22 Jason Merrill <jason@redhat.com>
1606 * tree.c (pod_type_p): Use old meaning in C++98 mode.
1609 * pt.c (contains_auto_r): New fn.
1610 (do_auto_deduction): Use it.
1611 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
1613 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
1616 * decl2.c (grokfield): Handle invalid initializers for member
1619 2010-03-20 Dodji Seketeli <dodji@redhat.com>
1622 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
1624 * decl2.c (vague_linkage_p): Likewise.
1626 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1629 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
1630 false, in the cp_parser_expression_statement call.
1632 2010-03-05 Jason Merrill <jason@redhat.com>
1634 * mangle.c (mangle_decl): Give name collision error even without
1637 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
1639 * pt.c (process_partial_specialization): Use error_n instead of
1642 2010-03-03 Jason Merrill <jason@redhat.com>
1645 * mangle.c (mangle_decl): Handle VAR_DECL, too.
1647 2010-03-03 Jason Merrill <jason@redhat.com>
1650 * mangle.c: Include cgraph.h.
1651 (mangle_decl): If the mangled name will change in a later
1652 ABI version, make the later mangled name an alias.
1653 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
1654 * Make-lang.in (mangle.o): Depend on cgraph.h.
1655 * method.c (make_alias_for): Handle VAR_DECL, too.
1656 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
1657 * tree.c (no_linkage_check): Adjust.
1658 * decl.c (maybe_commonize_var): Adjust.
1659 * cp-tree.h: Adjust.
1661 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
1663 * pt.c (redeclare_class_template): Use error_n and inform_n.
1665 2010-02-27 Mark Mitchell <mark@codesourcery.com>
1668 * cp-tree.h (push_tinst_level): Declare.
1669 (pop_tinst_level): Likewise.
1670 * pt.c (push_tinst_level): Give it external linkage.
1671 (pop_tinst_level): Likewise.
1672 * mangle.c (mangle_decl_string): Set the source location to that
1673 of the decl while mangling.
1675 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
1678 * pt.c (redeclare_class_template): Return false if there are erroneous
1679 template parameters.
1681 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
1683 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
1686 2010-02-24 Jason Merrill <jason@redhat.com>
1689 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
1691 * class.c (layout_class_type): Don't give -Wabi warning for a bug
1692 in a previous ABI version.
1694 2010-02-23 Jason Merrill <jason@redhat.com>
1697 * typeck2.c (digest_init_r): Accept value init of array.
1699 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1702 * typeck.c (convert_arguments): Update error message.
1704 2010-02-22 Mike Stump <mikestump@comcast.net>
1707 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
1709 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1712 * error.c (print_instantiation_partial_context_line): New.
1713 (print_instantiation_partial_context): Print at most 12 contexts,
1714 skip the rest with a message.
1716 2010-02-21 Dodji Seketeli <dodji@redhat.com>
1719 * pt.c (lookup_template_class): Better support of specialization
1720 of member of class template implicit instantiation.
1722 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
1725 * call.c (conversion_null_warnings): Replace -Wconversion with
1727 * cvt.c (build_expr_type_conversion): Likewise.
1729 2010-02-18 Jason Merrill <jason@redhat.com>
1732 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
1735 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
1737 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
1738 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
1741 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
1745 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
1746 (maybe_update_decl_type): New fn.
1747 * parser.c (cp_parser_init_declarator): Use it.
1750 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
1752 2010-02-17 Jason Merrill <jason@redhat.com>
1755 * call.c (build_over_call): Don't create zero-sized assignments.
1756 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
1757 * cp-objcp-common.c (cp_expr_size): Remove.
1758 * cp-tree.h: Remove prototype.
1761 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
1762 decl we looked up doesn't match.
1765 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
1766 have an INIT_EXPR anymore.
1769 * pt.c (convert_nontype_argument): Change assert to test.
1771 2010-02-16 Jason Merrill <jason@redhat.com>
1773 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
1776 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
1777 VIEW_CONVERT_EXPR for conversions between structural equality types
1778 that the back end can't tell are the same.
1781 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
1782 cv-quals from element here.
1783 (cp_build_qualified_type_real): Not here. Preserve typedef name.
1785 2010-02-14 Jason Merrill <jason@redhat.com>
1788 * semantics.c (finish_compound_literal): Use
1789 cp_apply_type_quals_to_decl when creating a static variable.
1791 2010-02-12 Jason Merrill <jason@redhat.com>
1794 * name-lookup.h (current_binding_level): Check for null
1797 2010-02-12 Jason Merrill <jason@redhat.com>
1800 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
1802 2010-02-12 Jakub Jelinek <jakub@redhat.com>
1805 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
1808 2010-02-10 Jason Merrill <jason@redhat.com>
1811 * semantics.c (outer_lambda_capture_p): Revert.
1812 (add_capture): Only finish_member_declaration if
1813 we're in the lambda class.
1814 (register_capture_members): New.
1815 * cp-tree.h: Declare it.
1816 * parser.c (cp_parser_lambda_expression): Call it.
1818 2010-02-10 Jason Merrill <jason@redhat.com>
1821 * semantics.c (outer_lambda_capture_p): Use current_function_decl
1822 instead of current_class_type.
1824 2010-02-10 Jason Merrill <jason@redhat.com>
1826 PR c++/42983, core issue 906
1827 * method.c (defaultable_fn_check): Check virtualness.
1829 2010-02-10 Jason Merrill <jason@redhat.com>
1832 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
1834 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
1836 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
1837 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
1839 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
1840 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
1841 (cp_parser_parameter_declaration)
1842 (cp_parser_exception_specification_opt)
1843 (cp_parser_exception_declaration): Likewise.
1844 * pt.c (check_default_tmpl_args): Likewise.
1845 * search.c (lookup_field_r): Likewise.
1847 2010-02-09 Jason Merrill <jason@redhat.com>
1850 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
1852 2010-02-09 Jason Merrill <jason@redhat.com>
1855 * decl2.c (change_return_type): New fn.
1856 * semantics.c (apply_lambda_return_type): Use it.
1857 * cp-tree.h: Declare it.
1859 2010-02-05 Richard Guenther <rguenther@suse.de>
1861 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
1862 * cp-lang.c: Include gt-cp-cp-lang.h.
1863 * config-lang.in (gtfiles): Add cp/cp-lang.c.
1865 2010-02-05 Dodji Seketeli <dodji@redhat.com>
1868 * typeck.c (get_template_parms_of_dependent_type): Try getting
1869 the template parameters fromt the type itself first.
1871 2010-02-03 Jason Merrill <jason@redhat.com>
1875 * mangle.c (write_unqualified_id): Split out from write_expression.
1876 (write_unqualified_name): Call it.
1877 (write_member_name): Likewise.
1878 (write_expression): Support TEMPLATE_ID_EXPR.
1879 Disambiguate operator names.
1882 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
1885 2010-02-02 Jason Merrill <jason@redhat.com>
1888 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
1889 * optimize.c (clone_body): Remap their initializers when making base
1891 (maybe_clone_body): Complain if multiple clones aren't safe.
1893 2010-01-29 Dodji Seketeli <dodji@redhat.com>
1900 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1901 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1902 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
1903 * pt.c (coerce_template_parms, type_unification_real,
1904 expand_template_argument_pack, coerce_template_parameter_pack):
1905 Set the non default template args count.
1906 (current_template_args): Always set non defaulted
1907 template args count when compiled with --enable-checking
1908 (tsubst_template_args, type_unification_real): Propagate the non
1909 defaulted template args count.
1910 * error.c (get_non_default_template_args_count): Renamed
1911 count_non_default_template_args into this. Don't calculate the
1912 non default template argument count anymore. Use the new
1913 accessor macros above to get it.
1914 (dump_template_argument_list, dump_type, dump_decl,
1915 dump_template_parms): Adjust.
1916 * parser.c (cp_parser_template_argument_list): Always set defaulted
1917 template args count when compiled with --enable-checking.
1919 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
1921 * decl.c (redeclaration_error_message): Wrap the return messages into
1922 G_() for easy translation.
1924 2010-01-28 Jason Merrill <jason@redhat.com>
1927 * semantics.c (begin_class_definition): Don't use type_as_string.
1929 2010-01-28 Dodji Seketeli <dodji@redhat.com>
1933 * typeck.c (get_template_parms_of_dependent_type): Factorized
1934 this out of incompatible_template_type_parms_p
1935 (incompatible_dependent_types_p): Renamed
1936 incompatible_template_type_parms_p into this. Make it detect
1937 two incompatible dependent typedefs too.
1938 (structural_comptypes): Use incompatible_dependent_types_p.
1939 * pt.c (get_template_info):
1940 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
1942 2010-01-20 Janis Johnson <janis187@us.ibm.com>
1943 Jason Merrill <jason@redhat.com>
1945 * mangle.c (write_type): Mangle transparent record as member type.
1946 * semantics.c (begin_class_definition): Recognize decimal classes
1947 and set TYPE_TRANSPARENT_AGGR.
1949 2010-01-20 Jason Merrill <jason@redhat.com>
1952 * mangle.c (write_expression): Handle tree codes that have extra
1953 arguments in the middle-end.
1955 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1958 * except.c (expand_start_catch_block): Deal correctly with
1959 do_begin_catch returning error_mark_node.
1961 2010-01-20 Jason Merrill <jason@redhat.com>
1964 * class.c (layout_class_type): Set packed_maybe_necessary for packed
1968 * semantics.c (build_lambda_object): Call mark_used on captured
1972 * decl.c (grokdeclarator): Clear type_quals for a member function
1973 declared using a typedef. Don't complain about adding cv-quals
1974 to a function typedef in C++0x mode.
1976 2010-01-20 Jakub Jelinek <jakub@redhat.com>
1978 * decl.c (create_array_type_for_decl): Remove set but not used
1979 variable error_msg. Remove break stmts after return stmts.
1981 2010-01-19 Dodji Seketeli <dodji@redhat.com>
1983 * error.c (dump_template_parms, count_non_default_template_args):
1984 Revert fix of PR c++/42634.
1986 2010-01-18 Dodji Seketeli <dodji@redhat.com>
1989 * error.c (dump_template_parms): Use innermost template
1990 arguments before calling count_non_default_template_args.
1991 (count_non_default_template_args): We are being called with
1992 template innermost arguments now. There is no need to ensure
1995 2010-01-18 Dodji Seketeli <dodji@redhat.com>
1998 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2000 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2003 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2005 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2008 *pt.c (tsubst_decl): Get the arguments of a specialization from
2009 the specialization template, not from the most general template.
2011 2010-01-16 Jason Merrill <jason@redhat.com>
2014 * semantics.c (finish_decltype_type): Within a template, treat
2015 unresolved CALL_EXPR as dependent.
2017 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2019 * error.c (dump_template_parms,count_non_default_template_args):
2020 Revert changes of PR c++/42634.
2022 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2025 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2026 functions with noreturn attribute.
2028 2010-01-14 Jason Merrill <jason@redhat.com>
2031 * call.c (build_new_method_call): Don't free the vec here.
2034 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2036 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2039 * error.c (dump_template_parms): Use innermost template
2040 arguments before calling count_non_default_template_args.
2041 (count_non_default_template_args): We are being called with
2042 template innermost arguments now. There is no need to ensure
2045 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2048 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2049 arguments that were previously deduced.
2051 2010-01-05 Jason Merrill <jason@redhat.com>
2053 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2054 * call.c (build_over_call): Don't complain about it.
2056 2010-01-04 Jason Merrill <jason@redhat.com>
2059 * pt.c (tsubst_decl): Don't apply type attributes in place.
2062 * semantics.c (describable_type): Remove decltype comment and
2067 Copyright (C) 2010 Free Software Foundation, Inc.
2069 Copying and distribution of this file, with or without modification,
2070 are permitted in any medium without royalty provided the copyright
2071 notice and this notice are preserved.