1 2010-08-06 Jason Merrill <jason@redhat.com>
3 * typeck.c (decay_conversion): Any expression with type nullptr_t
6 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
9 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
11 2010-07-27 Jason Merrill <jason@redhat.com>
13 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
14 from build_value_init.
15 * init.c (build_value_init_noctor): Give error for unknown array
18 2010-07-27 Joseph Myers <joseph@codesourcery.com>
20 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
22 2010-07-27 Joseph Myers <joseph@codesourcery.com>
24 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
25 c_common_initialize_diagnostics.
26 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
27 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
29 2010-07-21 Jason Merrill <jason@redhat.com>
31 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
33 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
36 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
39 * pt.c (instantiate_class_template): Propagate the template's
40 location to its instance.
42 2010-07-20 Jason Merrill <jason@redhat.com>
45 * pt.c (tsubst_copy_and_build): Rework last change.
48 * pt.c (tsubst_copy_and_build): Handle partial substitution of
51 2010-07-19 Jason Merrill <jason@redhat.com>
54 * semantics.c (finish_decltype_type): Correct decltype
55 of parenthesized rvalue reference variable.
58 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
59 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
61 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
64 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
66 * cp-tree.h: Adjust declaration.
67 * init.c (perform_member_init): Adjust caller.
68 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
69 * typeck2.c (store_init_value): Likewise.
70 (build_functional_cast): Pass complain argument to
71 build_x_compound_expr_from_list.
73 2010-07-16 Jason Merrill <jason@redhat.com>
76 * pt.c (process_partial_specialization): Diagnose partial
77 specialization after instantiation.
78 (most_specialized_class): Add complain parm.
80 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
82 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
84 * init.c (build_new_1): Use cp_build_function_call_nary instead of
85 cp_build_function_call.
87 2010-07-15 Jason Merrill <jason@redhat.com>
90 * call.c (add_function_candidate): If we're working on an implicit
91 declaration, don't consider candidates that won't match.
92 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
93 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
96 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
97 (TYPE_HAS_USER_OPEQ): New.
98 * decl.c (grok_special_member_properties): Set it.
99 * class.c (add_implicitly_declared_members): Don't lazily declare
100 constructors/operator= if a base or member has a user-declared one.
101 (check_bases_and_members, check_bases): Adjust.
102 (check_field_decls, check_field_decl): Adjust.
104 2010-07-15 Anatoly Sokolov <aesok@post.ru>
106 * decl.c (integer_three_node): Remove.
107 (cxx_init_decl_processing): Do not initialize the integer_three_node.
108 * cp-tree.h (integer_three_node): Remove.
110 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
112 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
115 * cp-gimplify.c: Likewise.
119 * mangle.c: Likewise.
120 * name-lookup.c: Likewise.
121 * optimize.c: Likewise.
122 * parser.c: Likewise.
125 * search.c: Likewise.
126 * semantics.c: Likewise.
127 * typeck.c: Likewise.
128 * typeck2.c: Likewise.
130 2010-07-14 Jason Merrill <jason@redhat.com>
132 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
133 (build_field_list): Cache field type.
135 Implement C++0x unrestricted unions (N2544)
136 * class.c (check_field_decl): Loosen union handling in C++0x.
137 * method.c (walk_field_subobs): Split out from...
138 (synthesized_method_walk): ...here. Set msg before loops.
139 (process_subob_fn): Check for triviality in union members.
140 * init.c (sort_mem_initializers): Splice out uninitialized
141 anonymous unions and union members.
142 (push_base_cleanups): Don't automatically destroy anonymous unions
145 2010-07-13 Jason Merrill <jason@redhat.com>
148 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
149 (TYPE_HAS_USER_OPEQ): New.
150 * decl.c (grok_special_member_properties): Set it.
151 * class.c (add_implicitly_declared_members): Don't lazily declare
152 constructors/operator= if a base or member has a user-declared one.
153 (check_bases_and_members, check_bases): Adjust.
154 (check_field_decls, check_field_decl): Adjust.
155 * method.c (synthesized_method_walk): Initialize check_vdtor.
158 * mangle.c (write_type): Canonicalize.
159 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
160 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
162 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
165 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
167 * typeck.c (get_delta_difference): Update prototype, add a
168 tsubst_flags_t parameter; update get_delta_difference_1 calls and
169 add checks for error_mark_node.
170 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
171 parameter; update lookup_base call.
172 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
173 parameter; update get_delta_difference call and add check for
175 (convert_ptrmem): Update prototype, add a tsubst_flags_t
176 parameter; update get_delta_difference call and add check for
177 error_mark_node; update build_ptrmemfunc call.
178 (build_static_cast_1): Adjust convert_ptrmem call.
179 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
180 (cp_build_unary_op): Adjust build_ptrmemfunc call.
181 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
182 and build_ptrmemfunc calls.
183 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
185 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
188 * call.c (build_temp): Add tsubst_flags_t complain parameter;
189 adjust build_special_member_call call, pass complain.
190 (convert_like_real): Adjust build_temp call, pass complain.
192 2010-07-09 Jason Merrill <jason@redhat.com>
195 * cp-tree.h (BV_LOST_PRIMARY): New macro.
196 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
198 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
200 2010-07-08 Jason Merrill <jason@redhat.com>
203 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
204 virtual bases for covariant thunks.
206 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
208 * cp-tree.h: Do not include toplev.h.
210 2010-07-06 Jason Merrill <jason@redhat.com>
213 * call.c (is_std_init_list): Look through typedefs.
216 * init.c (build_offset_ref): If scope isn't dependent,
217 don't exit early. Look at TYPE_MAIN_VARIANT.
218 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
220 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
222 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
224 * cp-tree.h (impl_conv_void): New type.
225 (convert_to_void): Adjust prototype.
226 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
227 diagnostic for easy translation. Change caller.
228 * typeck.c: Update call to convert_to_void.
229 * semantics.c: Likewise.
232 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
234 * decl.c (cp_finish_decl): Call add_local_decl.
235 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
237 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
239 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
242 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
245 * parser.c (cp_parser_primary_expression): Error if local template is
248 2010-07-02 Le-Chun Wu <lcwu@google.com>
251 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
252 (variable or type) shadows another type.
254 2010-07-02 Jakub Jelinek <jakub@redhat.com>
257 * typeck.c (convert_for_assignment): When converting a convertible
258 vector type or objc++ types, call mark_rvalue_use.
259 * typeck2.c (build_m_component_ref): Use return values from
260 mark_rvalue_use or mark_lvalue_use.
261 * class.c (build_base_path): Likewise.
262 * call.c (build_conditional_expr): Likewise.
264 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
267 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
270 2010-07-01 Richard Guenther <rguenther@suse.de>
272 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
273 predicate we are looking for, allow non-gimplified
276 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
279 * typeck.c (cp_build_unary_op): Early return error_mark_node when
280 arg is NULL_TREE too.
281 * call.c (convert_class_to_reference): Return error_mark_node when
284 2010-06-30 Michael Matz <matz@suse.de>
286 * repo.c (finish_repo): Fix typo.
288 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
290 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
292 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
294 * repo.c (pending_repo): Change type to a VEC.
295 (finish_repo): Adjust for new type of pending_repo.
296 (repo_emit_p): Likewise.
298 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
300 * tree.c: Include gimple.h. Do not include tree-flow.h
301 * decl.c: Do not include tree-flow.h
302 * Make-lang.in: Adjust dependencies.
304 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
306 * decl.c (incomplete_var): Declare. Declare VECs containing them.
307 (incomplete_vars): Adjust comment. Change type to a VEC.
308 (maybe_register_incomplete_var): Adjust for new type.
309 (complete_vars): Adjust iteration over incomplete_vars.
311 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
313 * decl.c (struct named_label_entry): Change type of bad_decls field
315 (poplevel_named_label_1): Adjust for new type of bad_decls.
316 (check_goto): Likewise.
318 2010-06-29 Jason Merrill <jason@redhat.com>
320 Enable implicitly declared move constructor/operator= (N3053).
321 * class.c (add_implicitly_declared_members): A class with no
322 explicitly declared copy or move constructor gets both declared
323 implicitly, and similarly for operator=.
324 (check_bases): A type with no copy ctor does not inhibit
325 a const copy ctor in a derived class. It does mean the derived
327 (check_field_decl): Likewise.
328 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
329 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
330 (trivially_copyable_p): Likewise.
331 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
332 * class.c (finish_struct_bits): Likewise.
333 * tree.c (build_target_expr_with_type): Likewise.
334 * typeck2.c (store_init_value): Likewise.
336 Enable implicitly deleted functions (N2346)
337 * class.c (check_bases_and_members): Adjust lambda flags.
338 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
340 * decl2.c (mark_used): Adjust error for use of deleted function.
342 Machinery to support implicit delete/move.
343 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
344 has_complex_move_ctor, has_complex_move_assign bitfields.
345 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
346 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
347 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
348 (enum special_function_kind): Add sfk_move_assignment.
349 (LOOKUP_SPECULATIVE): New.
350 * call.c (build_over_call): Return early if it's set.
351 (build_over_call): Use trivial_fn_p.
352 * class.c (check_bases): If the base has no default constructor,
353 the derived one is non-trivial. Handle move ctor/op=.
354 (check_field_decl): Likewise.
355 (check_bases_and_members): Handle move ctor/op=.
356 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
357 (type_has_move_constructor, type_has_move_assign): New.
358 * decl.c (grok_special_member_properties): Handle move ctor/op=.
359 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
361 (do_build_copy_constructor): Use it.
362 (do_build_assign_ref): Likewise. Handle move assignment.
363 (build_stub_type, build_stub_object, locate_fn_flags): New.
364 (locate_ctor): Use locate_fn_flags.
365 (locate_copy, locate_dtor): Remove.
366 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
367 (process_subob_fn, synthesized_method_walk): New.
368 (maybe_explain_implicit_delete): New.
369 (implicitly_declare_fn): Use synthesized_method_walk,
370 type_has_trivial_fn, and type_set_nontrivial_flag.
371 (defaulted_late_check): Set DECL_DELETED_FN.
372 (defaultable_fn_check): Handle sfk_move_assignment.
373 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
374 implicitly deleted move ctor/op=.
375 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
376 (lookup_fnfields_slot): New.
377 * semantics.c (omp_clause_info_fndecl): Remove.
378 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
379 get_copy_assign, trivial_fn_p.
380 (trait_expr_value): Adjust call to locate_ctor.
381 * tree.c (special_function_p): Handle sfk_move_assignment.
383 * class.c (type_has_virtual_destructor): New.
384 * cp-tree.h: Declare it.
385 * semantics.c (trait_expr_value): Use it.
387 * call.c (build_over_call): Only give warnings with tf_warning.
389 * name-lookup.c (pop_scope): Handle NULL_TREE.
391 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
392 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
393 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
394 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
395 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
396 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
397 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
398 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
399 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
400 (sfk_assignment_operator): Rename to sfk_copy_assignment.
401 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
402 * search.c, semantics.c, tree.c: Adjust.
404 * pt.c (dependent_scope_ref_p): Remove.
405 (value_dependent_expression_p): Don't call it.
406 (type_dependent_expression_p): Here either.
407 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
408 if the scope isn't dependent.
410 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
414 * pt.c (has_value_dependent_address): New.
415 (value_dependent_expression_p): Check it.
416 (convert_nontype_argument): Likewise. Call decay_conversion before
417 folding if we want a pointer.
418 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
419 scope is the current instantiation.
421 2010-06-28 Jakub Jelinek <jakub@redhat.com>
424 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
427 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
429 * init.c: Do not include except.h.
432 * cp-lang.c: Likewise.
434 * semantics.c: Likewise.
436 * except.c: Likewise.
437 (init_exception_processing): Do not set the removed
438 lang_protect_cleanup_actions here.
439 (cp_protect_cleanup_actions): Make non-static and remove prototype.
440 (doing_eh): New, moved from except.c but removed the do_warning flag.
441 (expand_start_catch_block): Update doing_eh call.
442 (expand_end_catch_block): Likewise.
443 (build_throw): Likewise.
444 * cp-tree.h: Prototype cp_protect_cleanup_actions.
445 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
446 cp_protect_cleanup_actions.
447 * Make-lang.in: Update dependencies.
449 2010-06-26 Jason Merrill <jason@redhat.com>
451 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
452 constructor called with a single argument that takes a reference
453 to the constructor's class.
454 (BAD_CONVERSION_RANK): New.
455 (compare_ics): Use it to compare bad ICSes.
457 2010-06-25 Joseph Myers <joseph@codesourcery.com>
459 * lang-specs.h: Remove +e handling.
461 2010-06-24 Andi Kleen <ak@linux.intel.com>
463 * parser.c: (cp_parser_question_colon_clause):
464 Switch to use cp_lexer_peek_token.
465 Call warn_for_omitted_condop. Call pedwarn for omitted
468 2010-06-22 Jakub Jelinek <jakub@redhat.com>
471 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
472 datum and mark_rvalue_use on component.
475 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
476 the CALL_EXPR has no arguments.
478 2010-06-21 Jason Merrill <jason@redhat.com>
480 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
482 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
485 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
487 * name-lookup.c (struct arg_lookup): Convert namespaces and
488 classes fields to VEC.
489 (arg_assoc_namespace): Adjust for new type of namespaces.
490 (arg_assoc_class): Adjust for new type of classes.
491 (lookup_arg_dependent): Use make_tree_vector and
493 * typeck2.c (build_x_arrow): Use vec_member.
495 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
498 * error.c (dump_decl): Better wording for anonymous namespace.
500 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
502 * class.c (build_vtbl_initializer): Adjust computation of new_position
503 and which entry to add padding for.
505 2010-06-16 Jason Merrill <jason@redhat.com>
507 * except.c (check_noexcept_r): Return the problematic function.
508 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
509 * pt.c (tsubst_copy_and_build): Pass it.
510 * parser.c (cp_parser_unary_expression): Likewise.
511 * cp-tree.h: Adjust prototype.
513 * method.c (defaulted_late_check): Give the defaulted method
514 the same exception specification as the implicit declaration.
516 2010-06-15 Jason Merrill <jason@redhat.com>
518 * class.c (add_implicitly_declared_members): Implicit assignment
519 operators can also be virtual overriders.
520 * method.c (lazily_declare_fn): Likewise.
522 * call.c (convert_like_real): Give "initializing argument of"
523 information for ambiguous conversion. Give source position
526 * call.c (print_z_candidates): Do print viable deleted candidates.
527 (joust): Don't choose a deleted function just because its worst
528 conversion is better than another candidate's worst.
530 * call.c (convert_like_real): Don't complain about
531 list-value-initialization from an explicit constructor.
533 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
534 DECL_SOURCE_LOCATION directly.
536 * class.c (type_has_user_provided_default_constructor): Use
539 * call.c (is_subseq): Handle ck_aggr, ck_list.
540 (compare_ics): Treat an aggregate or ambiguous conversion to the
541 same type as involving the same function.
543 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
545 * typeck.c (convert_for_assignment): Fix comment. Change message
546 format from %d to %qP.
547 (convert_for_initialization): Fix comment.
549 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
551 * cp-tree.h (expr_list_kind): New type.
552 (impl_conv_rhs): New type.
553 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
555 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
556 diagnostics for easy translation. Change caller.
557 (convert_for_initialization): Use impl_conv_rhs and change caller.
558 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
559 diagnostics for easy translation. Change caller.
560 * decl.c (bad_spec_place): New enum.
561 (bad_specifiers): Use it and emit the diagnostics for easy
562 translation. Change caller.
563 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
565 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
567 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
569 * decl2.c (cp_write_global_declarations): Adjust for new type of
571 * name-lookup.c (current_decl_namespace): Likewise.
572 (push_decl_namespace): Likewise.
573 (pop_decl_namespace): Likewise.
575 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
577 * call.c (build_java_interface_fn_ref): Call build_function_type_list
578 instead of build_function_type.
579 * decl.c (cxx_init_decl_processing): Likewise.
580 (declare_global_var): Likewise.
581 (get_atexit_node): Likewise.
582 (expand_static_init): Likewise.
583 * decl2.c (start_objects): Likewise.
584 (start_static_storage_duration_function): Likewise.
585 * except.c (init_exception_processing): Likewise.
586 (build_exc_ptr): Likewise.
587 (build_throw): Likewise.
588 * rtti.c (throw_bad_cast): Likewise.
589 (throw_bad_typeid): Likewise.
590 (build_dynamic_cast_1): Likewise.
592 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
594 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
595 (build_op_delete_call): Likewise.
596 (build_over_call): Likewise.
597 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
598 * pt.c (process_partial_specialization): Likewise.
599 (tsubst_template_args): Likewise.
600 * semantics.c (finish_asm_stmt): Likewise.
602 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
604 * decl.c (record_key_method_defined): New, broken out of ...
605 (finish_function): ... here. Call it.
606 (start_decl): Treat aliases as definitions.
608 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
610 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
612 * pt.c (maybe_process_partial_specialization): Likewise.
613 (register_specialization): Likewise.
614 (add_pending_template): Likewise.
615 (lookup_template_class): Likewise.
616 (push_tinst_level): Likewise.
618 * parser.c (cp_lexer_new_main): Likewise.
619 (cp_lexer_new_from_tokens): Likewise.
620 (cp_token_cache_new): Likewise.
621 (cp_parser_context_new): Likewise.
622 (cp_parser_new): Likewise.
623 (cp_parser_nested_name_specifier_opt): Likewise.
624 (cp_parser_template_id): Likewise.
626 * name-lookup.c (binding_entry_make): Likewise.
627 (binding_table_construct): Likewise.
628 (binding_table_new): Likewise.
629 (cxx_binding_make): Likewise.
630 (pushdecl_maybe_friend): Likewise.
631 (begin_scope): Likewise.
632 (push_to_top_level): Likewise.
634 * lex.c (init_reswords): Likewise.
635 (retrofit_lang_decl): Likewise.
636 (cxx_dup_lang_specific_decl): Likewise.
637 (copy_lang_type): Likewise.
638 (cxx_make_type): Likewise.
640 * decl.c (make_label_decl): Likewise.
641 (check_goto): Likewise.
642 (start_preparsed_function): Likewise.
643 (save_function_data): Likewise.
645 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
647 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
649 * class.c (finish_struct_1): Likewise.
651 * cp-tree.h (struct lang_type): Add variable_size GTY option.
652 (struct lang_decl): Likewise.
654 * parser.c (cp_parser_new): Update comment to not reference
657 2010-06-07 Jason Merrill <jason@redhat.com>
660 * error.c (dump_parameters): Mask out TFF_SCOPE.
661 (dump_simple_decl): Don't print the scope of a PARM_DECL.
662 (dump_scope): Remove no-op mask.
665 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
667 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
668 * init.c (build_offset_ref): Use it.
669 * pt.c (maybe_process_partial_specialization): Use it.
670 (instantiate_class_template): Use it.
671 * search.c (lookup_base): Use it.
673 2010-06-07 Jakub Jelinek <jakub@redhat.com>
676 * expr.c (mark_exp_read): Handle INDIRECT_REF.
677 * cvt.c (convert_to_void): Handle INDIRECT_REF like
681 * decl.c (initialize_local_var): If TREE_USED is set on the type,
682 set also DECL_READ_P on the decl.
684 2010-05-25 Dodji Seketeli <dodji@redhat.com>
687 * cp-tree.h (typedef_variant_p): Move this declaration to
689 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
690 * decl.c (grokdeclarator): Do not rename debug info of an
691 anonymous tagged type named by a typedef.
693 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
696 * class.c (check_field_decls): Move the call to
697 check_bitfield_decl before trying to set the
698 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
700 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
702 * typeck.c: Update include path for moved files.
705 * cp-gimplify.c: Likewise.
706 * cp-lang.c: Likewise.
708 * semantics.c: Likewise.
709 * cxx-pretty-print.h: Likewise.
711 * parser.c: Likewise.
712 * cp-objcp-common.c: Likewise.
713 * cp-tree.h: Likewise.
714 * name-lookup.c: Likewise.
716 * name-lookup.h: Likewise.
717 * config-lang.in: Update paths in gtfiles for files in c-family/.
718 * Make-lang.in: Likewise.
720 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
722 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
723 * typeck.c (build_ptrmemfunc): Likewise.
725 2010-06-04 Jason Merrill <jason@redhat.com>
727 * typeck2.c (merge_exception_specifiers): Adjust merging of
728 throw() and noexcept(true).
730 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
731 using an uninitialized variable.
733 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
734 (pp_cxx_expression): Likewise.
736 Implement noexcept-specification (15.4)
737 * parser.c (cp_parser_exception_specification_opt): Parse it.
738 Give -Wdeprecated warning about throw() specs.
739 * pt.c (tsubst_exception_specification): Handle it.
740 * error.c (dump_exception_spec): Handle it.
741 (dump_expr): Handle NOEXCEPT_EXPR.
742 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
743 * typeck.c (comp_except_specs): Handle compatibility rules.
744 Change exact parm to take an enum.
745 * typeck2.c (merge_exception_specifiers): Handle noexcept.
746 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
747 (type_throw_all_p, build_noexcept_spec): New fns.
748 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
749 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
750 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
751 (noexcept_true_spec, noexcept_false_spec): New macros.
752 * name-lookup.c (pushdecl_maybe_friend): Adjust.
753 * search.c (check_final_overrider): Adjust.
754 * decl.c (check_redeclaration_exception_specification): Adjust.
755 (use_eh_spec_block): Use type_throw_all_p.
756 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
757 Give operator new a noexcept-specification in C++0x mode.
758 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
759 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
761 Implement noexcept operator (5.3.7)
762 * cp-tree.def (NOEXCEPT_EXPR): New.
763 * except.c (check_noexcept_r, finish_noexcept_expr): New.
764 * cp-tree.h: Declare finish_noexcept_expr.
765 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
766 * pt.c (tsubst_copy_and_build): And tsubst it.
767 (type_dependent_expression_p): Handle it.
768 (value_dependent_expression_p): Handle it.
770 * call.c (build_conditional_expr): Never fold in unevaluated context.
771 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
772 * semantics.c (simplify_aggr_init_expr): Likewise.
773 * typeck.c (merge_types): Call merge_exception_specifiers.
774 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
775 DECL_ANTICIPATED for preferring new type.
777 2010-06-04 Joseph Myers <joseph@codesourcery.com>
779 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
782 2010-06-04 Jakub Jelinek <jakub@redhat.com>
785 * typeck.c (build_class_member_access_expr): Call mark_exp_read
786 on object for static data members.
788 2010-06-04 Jakub Jelinek <jakub@redhat.com>
789 Jason Merrill <jason@redhat.com>
792 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
793 with the same type, call mark_lvalue_use on both.
795 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
797 * class.c (struct vtbl_init_data_s): Remove last_init field.
798 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
800 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
802 (build_vtt): Likewise.
803 (initialize_vtable): Take a VEC instead of a tree.
804 (build_vtt_inits): Change return type to void. Take a VEC **
805 instead of a tree *; accumulate results into said VEC.
806 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
807 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
808 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
810 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
811 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
813 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
814 rather than tree_cons.
815 (build_vbase_offset_vtbl_entries): Likewise.
816 (add_vcall_offset): Likewise.
817 (build_rtti_vtbl_entries): Likewise.
818 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
819 * decl.c (initialize_artificial_var): Use build_constructor instead
820 of build_constructor_from_list.
822 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
825 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
828 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
830 * parser.c (cp_parser_mem_initializer_list): Change error text.
832 2010-06-02 Jakub Jelinek <jakub@redhat.com>
834 * cp-objcp-common.c (shadowed_var_for_decl): Change into
835 tree_decl_map hashtab from tree_map.
836 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
837 (init_shadowed_var_for_decl): Adjust initialization.
840 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
841 instead of calling mark_exp_read only when not an assignment.
844 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
845 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
846 Set DECL_VALUE_EXPR on var.
848 2010-06-02 Jason Merrill <jason@redhat.com>
850 * error.c (dump_type): Improve typedef handling.
855 * name-lookup.c (same_entity_p): New.
856 (ambiguous_decl): Multiple declarations of the same entity
859 2010-06-01 Jason Merrill <jason@redhat.com>
862 * call.c (add_list_candidates): Prefer the default constructor.
863 (build_aggr_conv): Treat missing initializers like { }.
864 * typeck2.c (process_init_constructor_record): Likewise.
865 * init.c (expand_default_init): Use digest_init for
866 direct aggregate initialization, too.
868 * call.c (add_list_candidates): Split out...
869 (build_user_type_conversion_1): ...from here.
870 (build_new_method_call): And here.
871 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
874 * call.c (build_list_conv): Set list-initialization flags properly.
876 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
878 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
880 2010-06-01 Arnaud Charlet <charlet@adacore.com>
881 Matthew Gingell <gingell@adacore.com>
883 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
884 * decl2.c: Include langhooks.h and c-ada-spec.h.
885 (cpp_check, collect_source_refs, collect_ada_namespace,
886 collect_all_refs): New functions.
887 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
888 * lang-specs.h: Ditto.
890 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
892 * cp-tree.h (cp_build_function_call_nary): Declare.
893 * typeck.c (cp_build_function_call_nary): Define.
894 * decl.c (register_dtor_fn): Use it instead of
895 cp_build_function_call.
896 (cxx_maybe_build_cleanup): Likewise.
897 * decl2.c (generate_ctor_or_dtor_function): Likewise.
898 * except.c (do_get_exception_ptr): Likewise.
899 (do_begin_catch): Likewise.
900 (do_allocate_exception): Likewise.
901 (do_free_exception): Likewise.
902 (build_throw): Likewise. Use cp_build_function_call_vec instead
903 of cp_build_function_call.
904 (do_end_catch): Likewise.
906 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
908 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
909 (struct cp_declarator): Move id_loc field up.
911 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
913 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
914 this file is included before c-common.h. Define GCC_DIAG_STYLE
915 before including diagnostic-core.h and toplev.h.
916 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
917 * pt.c: Include cp-tree.h before c-common.h.
919 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
921 * tree.c (c_register_addr_space): Add stub.
923 2010-05-28 Joseph Myers <joseph@codesourcery.com>
925 * g++spec.c (lang_specific_driver): Use fatal_error instead of
928 2010-05-28 Dodji Seketeli <dodji@redhat.com>
930 Revert fix of PR c++/44188
931 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
933 * tree.c (typedef_variant_p): Revert moving this definition to
935 * decl.c (grokdeclarator): Revert naming typedef handling.
937 2010-05-27 Joseph Myers <joseph@codesourcery.com>
939 * call.c: Include diagnostic-core.h instead of diagnostic.h.
940 * cp-lang.c: Don't include diagnostic.h
941 * name-lookup.c: Include diagnostic-core.h instead of
943 (cp_emit_debug_info_for_using): Use seen_error.
944 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
945 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
946 * pt.c (iterative_hash_template_arg): Use seen_error.
947 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
948 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
949 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
950 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
953 2010-05-25 Dodji Seketeli <dodji@redhat.com>
956 * cp-tree.h (typedef_variant_p): Move this declaration to
958 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
959 * decl.c (grokdeclarator): Do not rename debug info of an
960 anonymous tagged type named by a typedef.
962 2010-05-27 Jason Merrill <jason@redhat.com>
965 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
968 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
971 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
972 * class.c (layout_class_type): Likewise.
973 * decl.c (finish_enum): Likewise.
974 * mangle.c (write_builitin_type): Likewise.
976 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
978 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
980 * decl.c (grokdeclarator): Handle __int128.
981 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
982 (cp_parser_simple_type_specifier): Likewise.
983 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
984 * typeck.c (cp_common_type): Handle __int128.
985 * mangle.c (integer_type_codes): Add itk_int128 and
988 2010-05-26 Jason Merrill <jason@redhat.com>
991 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
994 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
996 * cp-lang.c: Do not include expr.h.
998 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
1000 * decl.c: Do not include rtl.h
1001 * semantics.c: Likewise.
1003 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
1005 * cp-tree.h: Do not include splay-tree.h.
1006 (struct prtmem_cst): Remove unused field and false comment.
1007 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
1008 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
1009 * init.c: Do not include rtl.h and expr.h.
1010 * class.c: Do not include rtl.h. Include splay-tree.h.
1011 (build_clone): Use plain NULL instead of NULL_RTX.
1012 * decl.c: Do not include expr.h. Explain why rtl.h has to be
1013 included. Include splay-tree.h.
1014 * method.c: Do not include rtl.h and expr.h.
1015 (use_thunk): Use plain NULL instead of NULL_RTX.
1016 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
1017 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
1018 and target.h. Include splay-tree.h.
1019 * expr.c: Do not include rtl.h and expr.h.
1020 * pt.c: Do not include obstack.h and rtl.h.
1021 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
1022 (tsubst_decl): Likewise.
1023 (instantiate_decl): Likewise.
1024 * semantics.c: Do not include exprt.h and debug.h. Explain why
1025 rtl.h has to be included.
1026 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
1027 * call.c: Do not include rtl.h and expr.h.
1028 * search.c: Do not include obstack.h and rtl.h.
1029 * friend.c: Do not include rtl.h and expr.h.
1030 * Make-lang.in: Update dependencies.
1032 2010-05-25 Jakub Jelinek <jakub@redhat.com>
1035 * parser.c (non_integral_constant): Add NIC_NONE.
1036 (required_token): Add RT_NONE.
1037 (cp_parser_unary_expression): Initialize non_constant_p
1039 (cp_parser_asm_definition): Initialize missing to RT_NONE.
1040 (cp_parser_primary_expression, cp_parser_postfix_expression,
1041 cp_parser_cast_expression, cp_parser_binary_expression,
1042 cp_parser_functional_cast): Fix formatting.
1044 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
1047 * parser.c: Remove inclusion of dyn-string.h.
1048 (non_integral_constant): New enum.
1049 (name_lookup_error): New enum.
1050 (required_token): New enum.
1051 (cp_parser_required_error): New function.
1052 (cp_parser_require): Change the type of variable token_desc to
1053 required_token and use cp_parser_required_error.
1054 (cp_parser_require_keyword): Likewise.
1055 (cp_parser_error): Use gmsgid as parameter.
1056 (cp_parser_name_lookup_error): Change the type of variable desired to
1057 name_lookup_error and put the diagnostic in the full sentences. Change
1059 (cp_parser_non_integral_constant_expression): Change the type of the
1060 variable thing to non_integral_constant and put the diagnostics in
1061 full sentences. Change caller.
1063 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
1066 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
1068 2010-05-24 Joseph Myers <joseph@codesourcery.com>
1070 * error.c (cp_diagnostic_starter): Update call to
1071 diagnostic_build_prefix.
1072 (cp_print_error_function,
1073 print_instantiation_partial_context_line): Check show_column flag
1076 2010-05-24 Jason Merrill <jason@redhat.com>
1079 * decl.c (check_initializer): Don't wrap an init-list in a
1081 * init.c (build_aggr_init): Don't assume copy-initialization if
1082 init has CONSTRUCTOR_IS_DIRECT_INIT.
1083 * call.c (build_new_method_call): Sanity check.
1085 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
1087 * rtti.c (tinfo_base_init): Use build_constructor instead of
1088 build_constructor_from_list. Don't cons a tree node for
1090 (generic_initializer): Use build_constructor_single instead of
1091 build_constructor_from_list.
1092 (ptr_initializer): Use build_constructor instead of
1093 build_constructor_from_list
1094 (ptm_initializer): Likewise.
1095 (class_initializer): Likewise. Take varargs instead of TRAIL.
1096 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
1097 build_constructor instead of build_constructor_from_list.
1099 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
1101 * semantics.c: Include bitmap.h.
1102 * Make-lang.in: Update dependencies.
1104 2010-05-22 Jan Hubicka <jh@suse.cz>
1106 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
1108 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
1110 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1112 * cxx-pretty-print.c: Correct merge error.
1114 2010-05-21 Joseph Myers <joseph@codesourcery.com>
1116 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
1117 (cp_print_error_function): Use diagnostic_abstract_origin macro.
1118 (cp_printer): Handle %K here using percent_K_format.
1119 * cxx-pretty-print.c: Include tree-pretty-print.h.
1120 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
1123 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
1125 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
1126 Clean up redundant includes.
1128 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1131 * decl.c (xref_basetypes): Return false in case of ill-formed
1134 2010-05-19 Jason Merrill <jason@redhat.com>
1136 * call.c (reference_binding): Use cp_build_qualified_type_real
1137 and cp_type_quals consistently.
1138 (add_function_candidate): Likewise.
1139 (build_conditional_expr): Likewise.
1140 (convert_like_real): Likewise.
1141 (type_passed_as): Likewise.
1142 * class.c (add_method): Likewise.
1143 (same_signature_p): Likewise.
1144 (layout_class_type): Likewise.
1145 * decl.c (cxx_init_decl_processing): Likewise.
1146 (cp_fname_init): Likewise.
1147 (grokdeclarator): Likewise.
1148 * decl2.c (cp_reconstruct_complex_type): Likewise.
1149 * init.c (build_new_1): Likewise.
1150 * method.c (do_build_copy_constructor): Likewise.
1151 (implicitly_declare_fn): Likewise.
1152 * pt.c (tsubst_aggr_type): Likewise.
1154 * rtti.c (init_rtti_processing): Likewise.
1155 (build_headof): Likewise.
1156 (build_dynamic_cast_1): Likewise.
1157 (tinfo_base_init): Likewise.
1158 (emit_support_tinfos): Likewise.
1159 * semantics.c (capture_decltype): Likewise.
1160 * tree.c (cv_unqualified): Likewise.
1161 * typeck.c (composite_pointer_type): Likewise.
1162 (string_conv_p): Likewise.
1164 * mangle.c (write_CV_qualifiers_for_type): Tweak.
1166 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
1167 * decl.c (start_decl): Likewise.
1168 * semantics.c (finish_compound_literal): Likewise.
1169 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
1170 (cp_type_readonly): Remove.
1171 * cp-tree.h: Remove declaration.
1173 * typeck.c (merge_types): Preserve memfn quals.
1175 * decl.c (grokdeclarator): Don't check quals on fn type.
1176 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
1177 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
1180 * typeck.c (type_memfn_quals): New fn.
1181 (apply_memfn_quals): New fn.
1182 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
1183 (cp_type_readonly): Use cp_type_quals.
1184 * cp-tree.h: Add declarations.
1185 * tree.c (cp_build_qualified_type_real): Don't set, but do
1186 preserve, quals on FUNCTION_TYPE.
1187 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
1188 * decl.c (build_ptrmem_type): Likewise.
1189 (grokdeclarator): Likewise.
1190 (static_fn_type): Likewise.
1191 * decl2.c (change_return_type): Likewise.
1192 (cp_reconstruct_complex_type): Likewise.
1193 * pt.c (tsubst_function_type): Likewise.
1195 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
1197 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
1199 * tree.c (build_min_non_dep_call_vec): Update comment.
1201 2010-05-17 Jason Merrill <jason@redhat.com>
1203 * call.c (struct z_candidate): Add explicit_targs field.
1204 (add_template_candidate_real): Set it.
1205 (build_over_call): Use it to control init-list warning.
1208 * call.c (build_over_call): Limit init-list deduction warning to
1209 cases where the argument is actually an init-list.
1212 * call.c (build_over_call): Don't do bitwise copy for move ctor.
1214 2010-05-17 Dodji Seketeli <dodji@redhat.com>
1215 Jason Merrill <jason@redhat.com>
1218 * decl.c (compute_array_index_type): Call mark_rvalue_use.
1220 2010-05-15 Jason Merrill <jason@redhat.com>
1222 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1223 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1225 (finish_eh_spec_block): Adjust.
1227 2010-05-15 Jakub Jelinek <jakub@redhat.com>
1230 * pt.c (tsubst): Unshare template argument.
1232 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1234 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1235 * Make-lang.in: Fix dependencies accordingly.
1237 2010-05-14 Jason Merrill <jason@redhat.com>
1240 * except.c (build_throw): Simplify, adjust for DR 475.
1243 * except.c (dtor_nothrow): Return nonzero for type with
1247 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1248 gimple_build_eh_must_not_throw.
1250 2010-05-14 Martin Jambor <mjambor@suse.cz>
1252 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1255 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1257 * call.c (build_new_method_call): Change warning text.
1258 * typeck2.c (build_functional_cast): Change error text.
1260 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1263 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1264 shadowing the outer parameter or variables by the declaration of
1265 nested function in nested structure or class. Warn the shadowing by
1266 the declaration of nested lambda expression.
1268 2010-05-13 Jason Merrill <jason@redhat.com>
1270 * typeck.c (cp_build_array_ref): Factor out from...
1271 (build_array_ref): ...here. Drop complain parm.
1272 (build_new_op): Adjust.
1273 * class.c (build_vtbl_ref_1): Adjust.
1274 * decl2.c (grok_array_decl): Adjust.
1275 * cp-tree.h: Adjust prototypes.
1277 2010-05-13 Jan Hubicka <jh@suse.cz>
1279 * decl.c (cp_finish_decl): Do not worry about used attribute.
1281 2010-05-12 Jason Merrill <jason@redhat.com>
1283 * typeck.c (build_array_ref): Take complain parm.
1284 * cp-tree.h: Add it to prototype.
1285 * call.c (build_new_op): Pass it.
1286 * class.c (build_vtbl_ref): Pass it.
1287 * decl2.c (grok_array_decl): Pass it.
1291 * cp-tree.def (NULLPTR_TYPE): Remove.
1292 * cp-tree.h (NULLPTR_TYPE_P): New.
1293 (SCALAR_TYPE_P): Use it.
1294 (nullptr_type_node): New.
1295 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1296 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1298 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1299 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1300 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1301 * mangle.c (write_type): Likewise.
1302 * name-lookup.c (arg_assoc_type): Likewise.
1303 * typeck.c (build_reinterpret_cast_1): Likewise.
1304 * rtti.c (typeinfo_in_lib_p): Likewise.
1305 (emit_support_tinfos): Remove local nullptr_type_node.
1307 * cp-tree.h (UNKNOWN_TYPE): Remove.
1308 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1309 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1310 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1311 * class.c (instantiate_type): Check unknown_type_node rather than
1313 * name-lookup.c (maybe_push_decl): Likewise.
1314 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1315 (get_typeid): Likewise.
1316 * semantics.c (finish_offsetof): Likewise.
1319 * call.c (add_template_candidate_real): If deduction fails, still
1320 add the template as a non-viable candidate.
1321 (equal_functions): Handle template candidates.
1322 (print_z_candidate): Likewise.
1323 (print_z_candidates): Likewise.
1324 (build_new_function_call): Likewise.
1326 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1327 * call.c (add_candidates): Enforce it.
1328 (build_new_method_call): Try non-list ctor if no viable list ctor.
1329 (build_user_type_conversion_1): Likewise.
1331 * call.c (add_candidates): Distinguish between type(x) and
1333 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1334 (build_new_method_call): Give better error for conversion op.
1336 * call.c (add_candidates): Add first_arg and return_type parms.
1337 Add special constructor/conversion op handling.
1338 (convert_class_to_reference): Use it.
1339 (build_user_type_conversion_1): Likewise.
1340 (build_op_call): Likewise.
1341 (build_new_method_call): Likewise.
1342 (build_new_op): Adjust.
1343 (perform_overload_resolution): Adjust.
1345 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1350 * pt.c (process_partial_specialization): Return error_mark_node
1351 in case of unused template parameters in partial specialization.
1353 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1356 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1357 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1358 look at its second operand.
1360 2010-05-10 Jason Merrill <jason@redhat.com>
1363 * semantics.c (baselink_for_fns): Revert earlier change.
1366 * typeck.c (cp_build_modify_expr): Complain about assignment to
1367 array from init list.
1369 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1372 * decl.c (check_initializer): strip array type before checking for
1373 uninitialized const or ref members.
1375 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1378 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1379 error count. Emit errors only if compain is true.
1380 (build_new_1): Do not return error_mark_node if
1381 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1382 errors. Delay the check for user-provided constructor.
1383 (perform_member_init): Adjust.
1384 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1387 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1388 Jason Merrill <jason@redhat.com>
1390 Add support for C++0x nullptr.
1391 * cp-tree.def: Add NULLPTR_TYPE.
1392 * cp-tree.h: Add nullptr_node.
1393 (cp_tree_index): Add CPTI_NULLPTR.
1394 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1395 * call.c (null_ptr_cst_p): Handle nullptr.
1396 (standard_conversion): Likewise.
1397 (convert_arg_to_ellipsis): Likewise.
1398 * mangle.c (write_type): Likewise.
1399 * name-lookup.c (arg_assoc_type): Likewise.
1400 * parser.c (cp_parser_primary_expression): Likewise.
1401 * typeck.c (cp_build_binary_op): Likewise.
1402 (build_reinterpret_cast_1): Likewise.
1403 * error.c (dump_type): Likewise.
1404 (dump_type_prefix, dump_type_suffix): Likewise.
1405 * decl.c (cxx_init_decl_processing): Likewise.
1406 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1407 * cvt.c (ocp_convert): Likewise.
1408 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
1409 nullptr_t tinfo in libsupc++.
1411 2010-05-06 Jason Merrill <jason@redhat.com>
1413 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
1415 2010-04-22 Jakub Jelinek <jakub@redhat.com>
1416 Dodji Seketeli <dodji@redhat.com>
1419 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
1421 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
1422 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
1423 (decay_conversion, perform_integral_promotions): Call rvalue_use.
1424 (cp_build_unary_op): Call lvalue_use.
1425 * decl.c (unused_but_set_errorcount): New variable.
1426 (poplevel): Issue -Wunused-but-set-variable diagnostics.
1427 (duplicate_decls): Merge DECL_READ_P flags.
1428 (start_cleanup_fn): Set DECL_READ_P flag.
1429 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
1430 * tree.c (rvalue): Call rvalue_use.
1431 * pt.c (convert_nontype_argument): Likewise.
1432 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
1433 finish_decltype_type): Likewise.
1434 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
1435 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
1436 or rvalue_use depending on the expr.
1437 * init.c (build_new, build_delete): Likewise.
1438 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
1440 2010-05-05 Jason Merrill <jason@redhat.com>
1443 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
1444 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
1446 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1449 * pt.c (unify): Check each elt for error_mark_node.
1451 2010-05-04 Jason Merrill <jason@redhat.com>
1454 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
1456 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1459 * call.c (build_new_method_call): Return error_mark_node if fns is
1462 2010-05-03 Dodji Seketeli <dodji@redhat.com>
1465 * pt.c (most_specialized_class): Pretend we are processing
1466 a template decl during the call to coerce_template_parms.
1468 2010-05-03 Jason Merrill <jason@redhat.com>
1472 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
1473 from the selected underlying type unless -fstrict-enums. Set
1474 ENUM_UNDERLYING_TYPE to have the restricted range.
1475 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
1476 * class.c (check_bitfield_decl): Likewise.
1478 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
1481 * init.c (build_new_1): Revert the accidental checkin in
1484 2010-04-30 Jason Merrill <jason@redhat.com>
1487 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
1488 (pp_cxx_type_specifier_seq): ...here.
1490 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
1492 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
1493 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
1495 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
1498 * typeck.c (warn_args_num): New function.
1499 (convert_arguments): Use warn_args_num to print the diagnostic
1502 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
1505 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
1506 user-provided constructor while recursing.
1508 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
1511 * error.c (print_instantiation_partial_context_line): Handle
1512 recursive instantiation.
1513 (print_instantiation_partial_context): Likewise.
1515 2010-04-27 Jason Merrill <jason@redhat.com>
1517 * init.c (perform_member_init): Check CLASS_TYPE_P.
1519 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1522 * init.c (perform_member_init): check for uninitialized const or
1523 reference members, including array types.
1525 2010-04-24 Jason Merrill <jason@redhat.com>
1527 * tree.c (get_fns): Split out from get_first_fn.
1528 * cp-tree.h: Declare it.
1529 * search.c (shared_member_p): Use it.
1530 * semantics.c (finish_qualified_id_expr): Simplify.
1531 (finish_id_expression): Simplify.
1533 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
1534 whenever object is NULL_TREE. Don't do 'this' capture here.
1535 (finish_qualified_id_expr): Pass NULL_TREE.
1536 (finish_id_expression): Likewise.
1537 (lambda_expr_this_capture): Likewise.
1539 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
1540 rather than checking current_class_ref directly.
1541 (finish_call_expr): Likewise.
1544 * name-lookup.c (qualify_lookup): Disqualify lambda op().
1545 * class.c (current_nonlambda_class_type): New fn.
1546 * semantics.c (nonlambda_method_basetype): New.
1547 * cp-tree.h: Declare them.
1548 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1550 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1553 * semantics.c (lambda_return_type): Complain about
1557 * tree.c (cv_unqualified): Handle error_mark_node.
1560 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1561 if we don't want errors.
1564 * class.c (convert_to_base): Add complain parameter. Pass
1565 ba_quiet to lookup_base if we don't want errors.
1566 (build_vfield_ref): Pass complain to convert_to_base.
1567 * call.c (convert_like_real): Likewise.
1568 (initialize_reference): Likewise.
1569 (perform_direct_initialization_if_possible): Pass complain to
1571 * cp-tree.h: Adjust.
1573 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1574 Jason Merrill <jason@redhat.com>
1577 * decl.c (check_for_uninitialized_const_var): Handle classes that need
1579 (check_initializer): Call it for classes that need constructing, too.
1580 * class.c (in_class_defaulted_default_constructor): New.
1581 * cp-tree.h: Declare it.
1583 2010-04-20 Jason Merrill <jason@redhat.com>
1586 * init.c (constant_value_1): Treat error_mark_node as a constant
1587 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1588 * cvt.c (ocp_convert): Handle getting error_mark_node from
1589 integral_constant_value.
1590 * decl.c (compute_array_index_type): Likewise.
1592 2010-04-20 Dodji Seketeli <dodji@redhat.com>
1596 * typeck.c (incompatible_dependent_types_p): If one of the
1597 compared types if not a typedef then honour their main variant
1600 2010-04-20 Jakub Jelinek <jakub@redhat.com>
1602 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1604 2010-04-19 Dodji Seketeli <dodji@redhat.com>
1607 * typeck.c (structural_comptypes): Test dependent typedefs
1608 incompatibility before testing for their main variant based
1611 2010-04-19 Jakub Jelinek <jakub@redhat.com>
1613 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
1614 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
1616 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
1618 * decl.c (cxx_init_decl_processing): Remove second argument in call to
1619 build_common_tree_nodes.
1621 2010-04-14 Jason Merrill <jason@redhat.com>
1624 * parser.c (cp_parser_parenthesized_expression_list): Change
1625 is_attribute_list parm to int to indicate whether or not to
1626 handle initial identifier specially.
1627 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
1629 2010-04-13 Jason Merrill <jason@redhat.com>
1631 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
1633 * parser.c (cp_parser_lambda_expression): Complain about lambda in
1634 unevaluated context.
1635 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
1637 2010-04-12 Jason Merrill <jason@redhat.com>
1640 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
1641 return value directly.
1643 * call.c (type_decays_to): Call cv_unqualified for non-class type.
1645 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
1648 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
1649 * init.c (build_new_1): Check for uninitialized const members and
1650 uninitialized reference members, when using new without
1651 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
1652 (diagnose_uninitialized_cst_or_ref_member): Define, call
1653 diagnose_uninitialized_cst_or_ref_member_1.
1654 (diagnose_uninitialized_cst_or_ref_member_1): New function.
1656 2010-04-12 Richard Guenther <rguenther@suse.de>
1659 * semantics.c (expand_or_defer_fn_1): Do not keep extern
1660 template inline functions.
1662 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1665 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
1668 2010-04-07 Jason Merrill <jason@redhat.com>
1671 * decl.c (start_preparsed_function): Do defer nested functions.
1673 PR c++/11094, DR 408
1674 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
1675 * decl2.c (finish_static_data_member_decl): Set it.
1676 * decl.c (duplicate_decls): Propagate it.
1677 * pt.c (tsubst_decl): Don't substitute the domain of an array
1678 VAR_DECL if it's set.
1679 (regenerate_decl_from_template): Substitute it here.
1680 (type_dependent_expression_p): Return true if it's set.
1681 * semantics.c (finish_decltype_type): Instantiate such a variable.
1682 * typeck.c (cxx_sizeof_expr): Likewise.
1683 (strip_array_domain): New.
1686 * name-lookup.c (current_decl_namespace): Non-static.
1687 (pop_nested_namespace): Sanity check.
1688 * cp-tree.h: Declare current_decl_namespace.
1689 * decl.c (grokvardecl): Use it instead of current_namespace.
1690 (grokfndecl): Likewise.
1693 * pt.c (tsubst_friend_function): Instatiate a friend that has already
1696 * pt.c (print_template_statistics): New.
1697 * cp-tree.h: Declare it.
1698 * tree.c (cxx_print_statistics): Call it.
1701 * decl.c (grokvardecl): Tweak warning message.
1702 (grokfndecl): Likewise.
1704 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1707 *pt.c (tsubst_decl): Get the arguments of a specialization from
1708 the specialization template, not from the most general template.
1710 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1713 * typeck2.c (process_init_constructor_record):
1714 value-initialize members that are are not explicitely
1717 2010-04-07 Jie Zhang <jie@codesourcery.com>
1720 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
1721 when all of its elements are non-constant and have been split out.
1723 2010-04-06 Taras Glek <taras@mozilla.com>
1724 Jason Merrill <jason@redhat.com>
1726 * parser.c (cp_parser_class_specifier): Set class location to that
1727 of IDENTIFIER_NODE instead of '{' when possible.
1728 * semantics.c (begin_class_definition): Do not overide locations
1729 with less precise ones.
1731 2010-04-06 Jason Merrill <jason@redhat.com>
1734 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
1737 * pt.c (maybe_update_decl_type): Check the return value from
1740 2010-04-01 Jason Merrill <jason@redhat.com>
1742 * decl.c (next_initializable_field): No longer static.
1743 * cp-tree.h: Declare it.
1744 * call.c (build_aggr_conv): Fail if there are more initializers
1745 than initializable fields.
1747 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
1748 instead of void_zero_node.
1750 2010-03-31 Dodji Seketeli <dodji@redhat.com>
1753 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
1754 * pt.c (end_template_parm_list): Store sibling template parms of
1755 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1756 (push_template_decl_real): Don't store the containing template decl
1757 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
1758 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
1759 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1762 2010-03-30 Jason Merrill <jason@redhat.com>
1765 * pt.c (push_template_decl_real): Deal better with running out of
1766 scopes before running out of template parms.
1770 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
1771 function parameter context. Don't print an error if parsing
1775 * pt.c (more_specialized_fn): Don't control cv-qualifier check
1778 2010-03-26 Jason Merrill <jason@redhat.com>
1781 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
1782 c++0x mode, but not other type-names.
1784 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1787 * pt.c (add_to_template_args): Support NULL ARGS;
1788 (most_specialized_class): call coerce_template_parms on
1789 template arguments passed to get_class_bindings. Use
1790 add_to_template_args.
1791 (unify): Handle VAR_DECLs.
1793 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1795 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
1797 * pt.c (get_template_parms_at_level): Adjust.
1799 2010-03-25 Dodji Seketeli <dodji@redhat.com>
1802 * cp-tree.h (get_template_parms_at_level): Declare ...
1803 * pt.c (get_template_parms_at_level): ... new function.
1804 * typeck.c (get_template_parms_of_dependent_type): If a template
1805 type parm's DECL_CONTEXT isn't yet set, get its siblings from
1806 current_template_parms. Use get_template_parms_at_level. Remove
1808 (incompatible_dependent_types_p): If we get empty parms from just one
1809 of the template type parms we are comparing then the template parms are
1812 2010-03-24 Jason Merrill <jason@redhat.com>
1815 * parser.c (make_declarator): Initialize id_loc.
1816 (cp_parser_lambda_declarator_opt): And set it.
1818 2010-03-23 Jason Merrill <jason@redhat.com>
1820 Make lambda conversion op and op() non-static.
1821 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
1822 Also add the thunk function returned by the conversion op.
1823 Mark the conversion deleted if the op() is variadic.
1824 * decl2.c (mark_used): Give helpful message about deleted conversion.
1825 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
1826 * semantics.c (finish_this_expr): Adjust.
1827 * mangle.c (write_closure_type_name): Adjust.
1828 * decl.c (grok_op_properties): Don't allow it.
1829 * call.c (build_user_type_conversion_1): No static conversion ops.
1830 (build_op_call): Or op().
1832 * decl2.c (change_return_type): Fix 'this' quals.
1834 2010-03-22 Jason Merrill <jason@redhat.com>
1837 * tree.c (pod_type_p): Use old meaning in C++98 mode.
1840 * pt.c (contains_auto_r): New fn.
1841 (do_auto_deduction): Use it.
1842 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
1844 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
1847 * decl2.c (grokfield): Handle invalid initializers for member
1850 2010-03-20 Dodji Seketeli <dodji@redhat.com>
1853 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
1855 * decl2.c (vague_linkage_p): Likewise.
1857 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1860 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
1861 false, in the cp_parser_expression_statement call.
1863 2010-03-05 Jason Merrill <jason@redhat.com>
1865 * mangle.c (mangle_decl): Give name collision error even without
1868 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
1870 * pt.c (process_partial_specialization): Use error_n instead of
1873 2010-03-03 Jason Merrill <jason@redhat.com>
1876 * mangle.c (mangle_decl): Handle VAR_DECL, too.
1878 2010-03-03 Jason Merrill <jason@redhat.com>
1881 * mangle.c: Include cgraph.h.
1882 (mangle_decl): If the mangled name will change in a later
1883 ABI version, make the later mangled name an alias.
1884 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
1885 * Make-lang.in (mangle.o): Depend on cgraph.h.
1886 * method.c (make_alias_for): Handle VAR_DECL, too.
1887 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
1888 * tree.c (no_linkage_check): Adjust.
1889 * decl.c (maybe_commonize_var): Adjust.
1890 * cp-tree.h: Adjust.
1892 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
1894 * pt.c (redeclare_class_template): Use error_n and inform_n.
1896 2010-02-27 Mark Mitchell <mark@codesourcery.com>
1899 * cp-tree.h (push_tinst_level): Declare.
1900 (pop_tinst_level): Likewise.
1901 * pt.c (push_tinst_level): Give it external linkage.
1902 (pop_tinst_level): Likewise.
1903 * mangle.c (mangle_decl_string): Set the source location to that
1904 of the decl while mangling.
1906 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
1909 * pt.c (redeclare_class_template): Return false if there are erroneous
1910 template parameters.
1912 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
1914 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
1917 2010-02-24 Jason Merrill <jason@redhat.com>
1920 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
1922 * class.c (layout_class_type): Don't give -Wabi warning for a bug
1923 in a previous ABI version.
1925 2010-02-23 Jason Merrill <jason@redhat.com>
1928 * typeck2.c (digest_init_r): Accept value init of array.
1930 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1933 * typeck.c (convert_arguments): Update error message.
1935 2010-02-22 Mike Stump <mikestump@comcast.net>
1938 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
1940 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1943 * error.c (print_instantiation_partial_context_line): New.
1944 (print_instantiation_partial_context): Print at most 12 contexts,
1945 skip the rest with a message.
1947 2010-02-21 Dodji Seketeli <dodji@redhat.com>
1950 * pt.c (lookup_template_class): Better support of specialization
1951 of member of class template implicit instantiation.
1953 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
1956 * call.c (conversion_null_warnings): Replace -Wconversion with
1958 * cvt.c (build_expr_type_conversion): Likewise.
1960 2010-02-18 Jason Merrill <jason@redhat.com>
1963 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
1966 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
1968 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
1969 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
1972 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
1976 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
1977 (maybe_update_decl_type): New fn.
1978 * parser.c (cp_parser_init_declarator): Use it.
1981 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
1983 2010-02-17 Jason Merrill <jason@redhat.com>
1986 * call.c (build_over_call): Don't create zero-sized assignments.
1987 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
1988 * cp-objcp-common.c (cp_expr_size): Remove.
1989 * cp-tree.h: Remove prototype.
1992 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
1993 decl we looked up doesn't match.
1996 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
1997 have an INIT_EXPR anymore.
2000 * pt.c (convert_nontype_argument): Change assert to test.
2002 2010-02-16 Jason Merrill <jason@redhat.com>
2004 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
2007 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
2008 VIEW_CONVERT_EXPR for conversions between structural equality types
2009 that the back end can't tell are the same.
2012 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
2013 cv-quals from element here.
2014 (cp_build_qualified_type_real): Not here. Preserve typedef name.
2016 2010-02-14 Jason Merrill <jason@redhat.com>
2019 * semantics.c (finish_compound_literal): Use
2020 cp_apply_type_quals_to_decl when creating a static variable.
2022 2010-02-12 Jason Merrill <jason@redhat.com>
2025 * name-lookup.h (current_binding_level): Check for null
2028 2010-02-12 Jason Merrill <jason@redhat.com>
2031 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
2033 2010-02-12 Jakub Jelinek <jakub@redhat.com>
2036 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
2039 2010-02-10 Jason Merrill <jason@redhat.com>
2042 * semantics.c (outer_lambda_capture_p): Revert.
2043 (add_capture): Only finish_member_declaration if
2044 we're in the lambda class.
2045 (register_capture_members): New.
2046 * cp-tree.h: Declare it.
2047 * parser.c (cp_parser_lambda_expression): Call it.
2049 2010-02-10 Jason Merrill <jason@redhat.com>
2052 * semantics.c (outer_lambda_capture_p): Use current_function_decl
2053 instead of current_class_type.
2055 2010-02-10 Jason Merrill <jason@redhat.com>
2057 PR c++/42983, core issue 906
2058 * method.c (defaultable_fn_check): Check virtualness.
2060 2010-02-10 Jason Merrill <jason@redhat.com>
2063 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2065 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
2067 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
2068 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
2070 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
2071 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
2072 (cp_parser_parameter_declaration)
2073 (cp_parser_exception_specification_opt)
2074 (cp_parser_exception_declaration): Likewise.
2075 * pt.c (check_default_tmpl_args): Likewise.
2076 * search.c (lookup_field_r): Likewise.
2078 2010-02-09 Jason Merrill <jason@redhat.com>
2081 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
2083 2010-02-09 Jason Merrill <jason@redhat.com>
2086 * decl2.c (change_return_type): New fn.
2087 * semantics.c (apply_lambda_return_type): Use it.
2088 * cp-tree.h: Declare it.
2090 2010-02-05 Richard Guenther <rguenther@suse.de>
2092 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
2093 * cp-lang.c: Include gt-cp-cp-lang.h.
2094 * config-lang.in (gtfiles): Add cp/cp-lang.c.
2096 2010-02-05 Dodji Seketeli <dodji@redhat.com>
2099 * typeck.c (get_template_parms_of_dependent_type): Try getting
2100 the template parameters fromt the type itself first.
2102 2010-02-03 Jason Merrill <jason@redhat.com>
2106 * mangle.c (write_unqualified_id): Split out from write_expression.
2107 (write_unqualified_name): Call it.
2108 (write_member_name): Likewise.
2109 (write_expression): Support TEMPLATE_ID_EXPR.
2110 Disambiguate operator names.
2113 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
2116 2010-02-02 Jason Merrill <jason@redhat.com>
2119 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
2120 * optimize.c (clone_body): Remap their initializers when making base
2122 (maybe_clone_body): Complain if multiple clones aren't safe.
2124 2010-01-29 Dodji Seketeli <dodji@redhat.com>
2131 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2132 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2133 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
2134 * pt.c (coerce_template_parms, type_unification_real,
2135 expand_template_argument_pack, coerce_template_parameter_pack):
2136 Set the non default template args count.
2137 (current_template_args): Always set non defaulted
2138 template args count when compiled with --enable-checking
2139 (tsubst_template_args, type_unification_real): Propagate the non
2140 defaulted template args count.
2141 * error.c (get_non_default_template_args_count): Renamed
2142 count_non_default_template_args into this. Don't calculate the
2143 non default template argument count anymore. Use the new
2144 accessor macros above to get it.
2145 (dump_template_argument_list, dump_type, dump_decl,
2146 dump_template_parms): Adjust.
2147 * parser.c (cp_parser_template_argument_list): Always set defaulted
2148 template args count when compiled with --enable-checking.
2150 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
2152 * decl.c (redeclaration_error_message): Wrap the return messages into
2153 G_() for easy translation.
2155 2010-01-28 Jason Merrill <jason@redhat.com>
2158 * semantics.c (begin_class_definition): Don't use type_as_string.
2160 2010-01-28 Dodji Seketeli <dodji@redhat.com>
2164 * typeck.c (get_template_parms_of_dependent_type): Factorized
2165 this out of incompatible_template_type_parms_p
2166 (incompatible_dependent_types_p): Renamed
2167 incompatible_template_type_parms_p into this. Make it detect
2168 two incompatible dependent typedefs too.
2169 (structural_comptypes): Use incompatible_dependent_types_p.
2170 * pt.c (get_template_info):
2171 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
2173 2010-01-20 Janis Johnson <janis187@us.ibm.com>
2174 Jason Merrill <jason@redhat.com>
2176 * mangle.c (write_type): Mangle transparent record as member type.
2177 * semantics.c (begin_class_definition): Recognize decimal classes
2178 and set TYPE_TRANSPARENT_AGGR.
2180 2010-01-20 Jason Merrill <jason@redhat.com>
2183 * mangle.c (write_expression): Handle tree codes that have extra
2184 arguments in the middle-end.
2186 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2189 * except.c (expand_start_catch_block): Deal correctly with
2190 do_begin_catch returning error_mark_node.
2192 2010-01-20 Jason Merrill <jason@redhat.com>
2195 * class.c (layout_class_type): Set packed_maybe_necessary for packed
2199 * semantics.c (build_lambda_object): Call mark_used on captured
2203 * decl.c (grokdeclarator): Clear type_quals for a member function
2204 declared using a typedef. Don't complain about adding cv-quals
2205 to a function typedef in C++0x mode.
2207 2010-01-20 Jakub Jelinek <jakub@redhat.com>
2209 * decl.c (create_array_type_for_decl): Remove set but not used
2210 variable error_msg. Remove break stmts after return stmts.
2212 2010-01-19 Dodji Seketeli <dodji@redhat.com>
2214 * error.c (dump_template_parms, count_non_default_template_args):
2215 Revert fix of PR c++/42634.
2217 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2220 * error.c (dump_template_parms): Use innermost template
2221 arguments before calling count_non_default_template_args.
2222 (count_non_default_template_args): We are being called with
2223 template innermost arguments now. There is no need to ensure
2226 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2229 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2231 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2234 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2236 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2239 *pt.c (tsubst_decl): Get the arguments of a specialization from
2240 the specialization template, not from the most general template.
2242 2010-01-16 Jason Merrill <jason@redhat.com>
2245 * semantics.c (finish_decltype_type): Within a template, treat
2246 unresolved CALL_EXPR as dependent.
2248 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2250 * error.c (dump_template_parms,count_non_default_template_args):
2251 Revert changes of PR c++/42634.
2253 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2256 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2257 functions with noreturn attribute.
2259 2010-01-14 Jason Merrill <jason@redhat.com>
2262 * call.c (build_new_method_call): Don't free the vec here.
2265 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2267 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2270 * error.c (dump_template_parms): Use innermost template
2271 arguments before calling count_non_default_template_args.
2272 (count_non_default_template_args): We are being called with
2273 template innermost arguments now. There is no need to ensure
2276 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2279 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2280 arguments that were previously deduced.
2282 2010-01-05 Jason Merrill <jason@redhat.com>
2284 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2285 * call.c (build_over_call): Don't complain about it.
2287 2010-01-04 Jason Merrill <jason@redhat.com>
2290 * pt.c (tsubst_decl): Don't apply type attributes in place.
2293 * semantics.c (describable_type): Remove decltype comment and
2298 Copyright (C) 2010 Free Software Foundation, Inc.
2300 Copying and distribution of this file, with or without modification,
2301 are permitted in any medium without royalty provided the copyright
2302 notice and this notice are preserved.