1 2011-01-01 Kai Tietz <kai.tietz@onevision.com>
4 * tree.c (cxx_type_hash_eq):
5 Allow METHOD_TYPE, too.
7 2010-12-28 Jason Merrill <jason@redhat.com>
10 * semantics.c (finish_id_expression): Don't note non-names
11 as being used in the class.
13 2010-12-23 Jason Merrill <jason@redhat.com>
15 * parser.c (cp_parser_unary_expression): Remove redundant C++0x
18 2010-12-27 Jakub Jelinek <jakub@redhat.com>
21 * semantics.c (build_data_member_initialization): For CLEANUP_STMT
22 recurse into CLEANUP_BODY.
24 2010-12-25 Kai Tietz <kai.tietz@onevision.com>
27 * decl.c (decls_match): Check for FUNCTION_DECL
28 also for identity of compatible attributes.
30 2010-12-22 Nathan Froyd <froydnj@codesourcery.com>
32 * decl.c (decls_match, duplicate_decls): Use prototype_p.
33 * pt.c (push_template_decl_real): Likewise.
35 2010-12-22 Jason Merrill <jason@redhat.com>
38 * tree.c (stabilize_expr): Really stabilize scalar glvalues.
40 2010-12-22 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
42 * parser.c (cp_parser_unary_expression): Call pedwarn for alignof
45 2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
47 * parser.c (cp_parser_objc_try_catch_finally_statement): Call
48 objc_maybe_warn_exceptions.
49 (cp_parser_objc_synchronized_statement): Same change.
51 2010-12-18 Joseph Myers <joseph@codesourcery.com>
53 * pt.c (most_specialized_class): Use ngettext to determine
54 "candidates are:" / "candidate is" message.
56 2010-12-17 Jason Merrill <jason@redhat.com>
59 * pt.c (value_dependent_expression_p) [ARRAY_REF]: Handle
62 2010-12-15 Nathan Froyd <froydnj@codesourcery.com>
67 * parser.c (struct cp_parser): Add colon_corrects_to_scope_p field.
68 (cp_parser_new): Initialize it.
69 (cp_parser_nested_name_specifier_opt): Auto-correct colons to
70 scopes if we are able to.
71 (cp_parser_question_colon_clause): Disallow colon correction.
72 (cp_parser_label_for_labeled_statement): Likewise.
73 (cp_parser_range_for): Likewise.
74 (cp_parser_enum_specifier): Likewise.
75 (cp_parser_class_head): Likewise.
76 (cp_parser_member_declaration): Likewise.
78 2010-12-15 Nathan Froyd <froydnj@codesourcery.com>
81 * parser.c (cp_parser_class_specifier): Check for TYPE_P.
83 2010-12-15 Jakub Jelinek <jakub@redhat.com>
86 * cp-gimplify.c (cp_genericize): When changing RESULT_DECL
87 into invisible reference, change also DECL_VALUE_EXPR of
88 NRV optimized variable.
90 2010-12-15 Paolo Carlini <paolo.carlini@oracle.com>
93 * init.c (build_value_init): Check build_special_member_call return
94 value for error_mark_node.
96 2010-12-14 Jason Merrill <jason@redhat.com>
99 * decl.c (grokdeclarator): Reject uninitialized constexpr
102 2010-12-14 Nathan Froyd <froydnj@codesourcery.com>
105 * cp-tree.h (suggest_alternatives_for): Add location_t parameter.
106 * name-lookup.c (suggest_alternatives_for): Likewise. Adjust.
107 * lex.c (unqualified_name_lookup_error): Adjust call to it.
108 * semantics.c (qualified_name_lookup_error): Move to...
109 * error.c (qualified_name_lookup_error): ...here. Call.
110 suggest_alternatives_for.
112 2010-12-13 Jason Merrill <jason@redhat.com>
116 * semantics.c (build_data_member_initialization): Handle
117 cv-qualified data member.
119 2010-12-13 Jan Hubicka <jh@suse.cz>
122 * decl2.c (start_objects): Do not generate collect2 recognicable name
125 2010-12-12 Paolo Carlini <paolo.carlini@oracle.com>
128 * typeck.c (convert_for_assignment): Fix typo in warning message.
130 2010-12-10 Jakub Jelinek <jakub@redhat.com>
133 * decl.c (record_builtin_java_type): Call build_distinct_type_copy
134 on build_nonstandard_integer_type result for __java_* types.
136 2010-12-10 Nathan Froyd <froydnj@codesourcery.com>
138 * decl.c (grokmethod): Test DECL_CLASS_SCOPE_P.
139 * error.c (dump_decl): Test DECL_FILE_SCOPE_P.
141 2010-12-10 Nathan Froyd <froydnj@codesourcery.com>
143 * cp-tree.h (readonly_error_kind): Delete.
144 (readonly_error): Rename to...
145 (cxx_readonly_error): ...this. Change second argument to be an
147 * semantics.c (finish_asm_stmt): Call cxx_readonly_error.
148 * typeck.c (cp_build_unary_op): Likewise.
149 (cp_build_modify_expr): Likewise.
150 * typeck2.c (readonly_error): Rename to...
151 (cxx_readonly_error): ...this. Delegate to readonly_error for
154 2010-12-10 Nicola Pero <nicola.pero@meta-innovation.com>
156 * parser.c (cp_parser_objc_superclass_or_category): Recognize
157 Objective-C 2.0 class extensions. Added iface_p and
158 is_class_extension arguments.
159 (cp_parser_objc_class_interface): Updated call to
160 cp_parser_objc_superclass_or_category.
161 (cp_parser_objc_class_implementation): Same change.
163 2010-12-09 Nathan Froyd <froydnj@codesourcery.com>
165 * call.c (print_conversion_rejection): Indent messages two spaces.
167 2010-12-09 Nathan Froyd <froydnj@codesourcery.com>
169 * typeck.c (cp_build_indirect_ref): Call invalid_indirection_error.
171 2010-12-09 Nathan Froyd <froydnj@codesourcery.com>
173 * typeck.c (composite_pointer_error): New function.
174 (composite_pointer_type_r, composite_pointer_type): Call it.
176 2010-12-08 Jason Merrill <jason@redhat.com>
179 * semantics.c (cxx_eval_vec_init_1): Handle value-init.
180 (cxx_eval_vec_init): Pass value_init arg.
182 2010-12-08 Nathan Froyd <froydnj@codesourcery.com>
185 * call.c (struct conversion): Document bad_p field.
186 (enum rejection_reason_code): Define.
187 (struct conversion_info): Define.
188 (struct rejection_reason): Define.
189 (struct z_candidate): Add `reason' field.
190 (add_candidate): Add `reason' parameter. Store it in CAND.
191 (alloc_rejection, arity_rejection, arg_conversion_rejection):
193 (bad_arg_conversion_rejection): New function.
194 (convert_class_to_reference): Add comment.
195 (remaining_arguments): New function.
196 (add_function_candidate): Record rejection reason and pass it to
198 (add_conv_candidate, build_builtin_candidate): Likewise.
199 (add_template_candidate_real): Likewise.
200 (print_conversion_rejection): New function.
201 (print_z_candidate): Print CAND->REASON if it exists. Adjust
203 (print_z_candidates): Add location_t argument. Adjust calling
204 sequence for print_z_candidate. Print header line directly.
205 (build_user_type_conversion_1): Add reason for rejection to
206 CAND. Adjust call to print_z_candidates.
207 (print_error_for_call_failure): New function.
208 (build_new_function_call): Call it. Adjust call to
210 (build_operator_new_call): Likewise.
211 (build_op_call): Likewise.
212 (build_conditional_expr): Likewise.
213 (build_new_op): Likewise.
214 (build_new_method_call): Likewise.
216 2010-12-08 Jason Merrill <jason@redhat.com>
219 * cp-tree.h (LOOKUP_DEFAULTED): New.
220 * call.c (add_function_candidate): Check it.
221 * method.c (synthesized_method_walk): Set it.
222 (do_build_copy_assign): Likewise.
223 * init.c (perform_member_init): Likewise.
224 (emit_mem_initializers): Likewise.
227 * decl.c (cp_finish_decl): Complain about an implicitly deleted
228 method defaulted outside the class.
229 * method.c (maybe_explain_implicit_delete): Don't check DECL_INITIAL.
231 2010-12-07 Joseph Myers <joseph@codesourcery.com>
233 * rtti.c: Don't include assert.h.
235 2010-12-07 Nathan Froyd <froydnj@codesourcery.com>
238 * cp-tree.h (suggest_alternatives_for, location_of): Declare.
239 * error.c (dump_expr): Handle TYPE_DECL.
240 (location_of): Unstaticize.
241 * name-lookup.c (suggest_alternatives_for): New function.
242 * lex.c (unqualified_name_lookup_error): Call it.
244 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com>
246 * call.c: Include c-family/c-objc.h.
247 * decl.c: Same change.
248 * decl2.c: Same change.
249 * error.c: Same change.
250 * lex.c: Same change.
251 * parser.c: Same change.
253 * semantics.c: Same change.
254 * typeck.c: Same change.
255 * Make-lang.in (cp/decl.o): Depend on c-family/c-objc.h.
256 (cp/decl2.o): Same change.
257 (cp/call.o): Same change.
258 (cp/error.o): Same change.
259 (cp/lex.o): Same change.
260 (cp/parser.o): Same change.
261 (cp/pt.o): Same change.
262 (cp/semantics.o): Same change.
263 (cp/typeck.o): Same change.
264 * config-lang.in (gtfiles): Added c-family/c-objc.h.
266 2010-12-03 Jason Merrill <jason@redhat.com>
269 * semantics.c (build_data_member_initialization): Remove assert.
272 * tree.c (lvalue_kind) [SCOPE_REF]: Handle non-dependent case.
274 2010-12-03 Richard Guenther <rguenther@suse.de>
277 * error.c (dump_expr): Handle MEM_REF.
279 2010-12-03 Laurynas Biveinis <laurynas.biveinis@gmail.com>
281 * cp-tree.h (struct aggr_init_expr_arg_iterator_d): Remove GTY
284 2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com>
286 * parser.c (cp_parser_objc_throw_statement): Use
287 cp_parser_expression, not cp_parser_assignment_expression, to
288 parse the argument of a @throw.
290 2010-12-01 Joseph Myers <joseph@codesourcery.com>
292 * cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h.
293 * Make-lang.in (cp/lex.o, cp/cp-objcp-common.o, cp/typeck2.o):
296 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com>
298 * decl.c (finish_function): Call objc_finish_function when
299 compiling Objective-C++.
300 * call.c (standard_conversion): Do not call
301 objc_non_volatilized_type().
302 (implicit_conversion): Same change.
303 * typeck.c (comp_ptr_ttypes_real): Same change.
305 2010-11-30 Joseph Myers <joseph@codesourcery.com>
307 * cp-gimplify.c, cp-lang.c, cvt.c, cxx-pretty-print.c, error.c,
308 except.c, expr.c, friend.c, init.c, mangle.c, name-lookup.c,
309 optimize.c, parser.c, rtti.c, tree.c, typeck2.c: Don't include
311 * Make-lang.in: Dependencies for above files changed to remove
314 2010-11-29 Dodji Seketeli <dodji@redhat.com>
317 * call.c (add_builtin_candidate): At this point the resulting type
318 of an indirection operator should be complete.
320 2010-11-29 Dodji Seketeli <dodji@redhat.com>
323 Reverted patch for PR c++/42260
324 * cp-tree.h (lookup_conversions): Reverted "Add new bool parameter to
326 * search.c (lookup_conversion): Reverted "Use new bool parameter in
328 * call.c (add_builtin_candidates): Reverted "Don't lookup template
330 (convert_class_to_reference, build_user_type_conversion_1,
331 build_op_call): Reverted "Adjust".
332 * cvt.c (build_expr_type_conversion): Reverted "Likewise".
334 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
336 * parser.c (cp_parser_objc_try_catch_finally_statement): Parse
337 @catch(...) and pass NULL_TREE to objc_begin_catch_clause() in
338 that case. Improved error recovery. Reorganized code to be
339 almost identical to c_parser_objc_try_catch_finally_statement.
341 2010-11-27 Nicola Pero <nicola.pero@meta-innovation.com>
344 * decl.c (grokdeclarator): Replaced an assert (for a case that can
345 never happen in C++, but could happen in ObjC++ for invalid code)
346 with a check that prints an error message and returns
349 2010-11-23 Jeffrey Yasskin <jyasskin@google.com>
352 * pt.c (instantiate_decl): Propagate the template's location to
355 2010-11-20 Joseph Myers <joseph@codesourcery.com>
357 * name-lookup.c (handle_namespace_attrs): Don't check
358 HANDLE_PRAGMA_VISIBILITY.
359 * parser.c (cp_parser_namespace_definition): Don't check
360 HANDLE_PRAGMA_VISIBILITY.
362 2010-11-20 Nathan Froyd <froydnj@codesourcery.com>
367 * parser.c (cp_lexer_set_token_position): New function.
368 (cp_lexer_previous_token_position): New function.
369 (cp_lexer_previous_token): Call it.
370 (cp_parser_class_specifier): Try to gracefully handle a missing
373 2010-11-20 Jakub Jelinek <jakub@redhat.com>
376 * decl.c (cp_make_fname_decl): Return error_mark_node if
377 current_binding_level has already sk_function_parms kind.
380 * semantics.c (cxx_eval_call_expression): Unshare the result.
382 2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com>
384 * parser.c (cp_parser_objc_protocol_declaration): Pass attributes
385 to objc_declare_protocols.
387 2010-11-18 Nathan Froyd <froydnj@codesourcery.com>
390 * typeck.c (cp_build_unary_op): Call build_real_imag_expr for
391 REALPART_EXPR and IMAGPART_EXPR.
393 2010-11-16 Jason Merrill <jason@redhat.com>
395 * call.c (convert_like_real): Don't make a temp for copy-list-init.
396 (build_over_call): Don't handle that here.
397 (build_new_method_call): Use COMPLETE_OR_OPEN_TYPE_P for error.
400 * call.c (build_over_call): Check for =delete even when trivial.
403 * decl.c (make_unbound_class_template): Handle using
404 injected-type-name as template.
406 2010-11-15 Nicola Pero <nicola.pero@meta-innovation.com>
408 * typeck.c (cp_build_unary_op): Use
409 objc_build_incr_expr_for_property_ref to build the pre/post
410 increment/decrement of an Objective-C property ref.
412 2010-11-13 Jason Merrill <jason@redhat.com>
414 * decl.c (cp_finish_decl): Use resolve_nondeduced_context for auto.
415 * init.c (build_new): Likewise.
416 * pt.c (tsubst_decl): Likewise.
417 (do_auto_deduction): Likewise.
418 (resolve_nondeduced_context): Use build_offset_ref and
421 2010-11-12 Joseph Myers <joseph@codesourcery.com>
423 * Make-lang.in (g++spec.o): Use $(OPTS_H).
425 2010-11-13 Ville Voutilainen <ville.voutilainen@gmail.com> <ville.voutilainen@symbio.com>
427 Core 1135, 1136, 1145, 1149
428 * method.c (defaultable_fn_check): Do not disallow defaulting a
429 non-public or explicit special member function on its first
432 2010-11-12 James Dennett <jdennett@google.com>
435 * typeck.c (build_static_cast_1): Convert to the target type
436 when doing static_cast<cv Derived*>(Base*).
438 2010-11-10 Jason Merrill <jason@redhat.com>
441 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: New case.
442 [CONSTRUCTOR]: Use the tsubsted type.
445 * semantics.c (cxx_eval_bit_field_ref): New.
446 (cxx_eval_constant_expression): Call it.
448 2010-11-10 Joseph Myers <joseph@codesourcery.com>
450 * cvt.c (cp_convert_to_pointer): Use %' in diagnostic.
451 * decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator):
452 Use %' in diagnostics.
453 * decl2.c (check_classfn): Use %' in diagnostic.
454 * init.c (build_java_class_ref): Use %' in diagnostic.
455 (build_delete): Remove trailing '.' from diagnostic.
456 * method.c (do_build_copy_assign, walk_field_subobs): Use %' in
458 * name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic.
459 * parser.c (cp_parser_exception_specification_opt): Remove
460 trailing '.' from diagnostic.
461 (cp_parser_objc_interstitial_code): Use %qs for quoting in
463 * pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in
465 * repo.c (reopen_repo_file_for_write): Use %' in diagnostic.
467 2010-11-10 Nathan Froyd <froydnj@codesourcery.com>
470 * decl.c (poplevel_named_label_1): Use TREE_CHAIN if necessary.
472 2010-11-09 Jakub Jelinek <jakub@redhat.com>
475 * tree.c (lvalue_kind): Don't crash if ref has NULL type.
477 2010-11-08 Jason Merrill <jason@redhat.com>
480 * semantics.c (check_constexpr_ctor_body): New fn.
481 * parser.c (cp_parser_ctor_initializer_opt_and_function_body): Call it.
482 * cp-tree.h: Declare it.
485 * tree.c (bot_manip): Check TREE_SIDE_EFFECTS as well.
487 Correct conversion/overflow behavior.
488 * cvt.c (ignore_overflows): Move here from typeck.c.
489 (ocp_convert): Use it.
490 (cp_fold_convert): Use it. Don't call rvalue.
491 * typeck.c (build_static_cast_1): Don't use it. Do call rvalue.
492 * error.c (location_of): Handle expressions, too.
493 * class.c (check_bitfield_decl): Set input_location around call to
495 * semantics.c (cxx_eval_outermost_constant_expr): Don't
496 print the expression if it already had TREE_OVERFLOW set.
497 (reduced_constant_expression_p): Check TREE_OVERFLOW_P for C++98, too.
498 (verify_constant): Allow overflow with a permerror if we're
500 (cxx_eval_outermost_constant_expr): Use verify_constant.
501 (adjust_temp_type): Use cp_fold_convert.
502 * decl.c (build_enumerator): Don't call constant_expression_warning.
503 * decl2.c (grokbitfield): Likewise.
505 2010-11-06 Jason Merrill <jason@redhat.com>
508 * init.c (perform_member_init): Use build_vec_init_expr for
509 value-init of arrays, too.
510 * cp-gimplify.c (cp_gimplify_expr): Use VEC_INIT_EXPR_VALUE_INIT.
511 * cp-tree.h (VEC_INIT_EXPR_IS_CONSTEXPR): New macro.
512 (VEC_INIT_EXPR_VALUE_INIT): New macro.
513 * semantics.c (potential_constant_expression): No longer static.
514 Check VEC_INIT_EXPR_IS_CONSTEXPR.
515 * tree.c (build_vec_init_expr): Handle value-init. Set
516 VEC_INIT_EXPR_IS_CONSTEXPR and VEC_INIT_EXPR_VALUE_INIT.
518 2010-11-06 Nathan Froyd <froydnj@codesourcery.com>
521 * parser.c (cp_lexer_previous_token): New function.
522 (cp_parser_member_declaration): Use previous token for error
523 messages. Assume semicolon presence rather than grovelling for
526 2010-11-06 Joern Rennecke <amylaar@spamcop.net>
529 * method.c (make_alias_for_thunk):
530 Use targetm.asm_out.generate_internal_label.
532 2010-11-05 Jason Merrill <jason@redhat.com>
535 * search.c (look_for_overrides): A constructor is never virtual.
537 2010-11-05 Jakub Jelinek <jakub@redhat.com>
540 * cp-gimplify.c (cp_gimplify_expr): Drop volatile MEM_REFs
541 on the RHS to avoid infinite recursion with gimplify_expr.
543 2010-11-05 Jason Merrill <jason@redhat.com>
546 * pt.c (tsubst_copy): Handle COMPLEX_CST.
548 2010-11-04 Nicola Pero <nicola.pero@meta-innovation.com>
550 Fixed using the Objective-C 2.0 dot-syntax with class names.
551 * parser.c (cp_parser_primary_expression): Recognize Objective-C
552 2.0 dot-syntax with class names and process it.
553 (cp_parser_nonclass_name): Recognize Objective-C 2.0 dot-syntax
555 (cp_parser_class_name): Same change.
556 (cp_parser_simple_type_specifier): Tidied comments.
558 2010-11-04 Jason Merrill <jason@redhat.com>
561 * semantics.c (build_constexpr_constructor_member_initializers):
562 Handle an enclosing STATEMENT_LIST.
564 * semantics.c (speculative_access_check): New.
565 * cp-tree.h: Declare it.
566 * call.c (build_over_call): Use it.
567 * class.c (type_has_constexpr_default_constructor): Use locate_ctor.
568 * method.c (locate_ctor): Use push/pop_deferring_access_checks.
570 2010-11-03 Jason Merrill <jason@redhat.com>
573 * semantics.c (build_data_member_initialization): Handle
574 value-init of aggregate empty base.
577 * call.c (can_convert_array): New fn.
578 (build_aggr_conv): Use it.
581 * semantics.c (build_constexpr_constructor_member_initializers):
584 2010-11-02 Dodji Seketeli <dodji@redhat.com>
586 * cp-tree.h (enum tsubst_flags)<tf_no_class_instantiations>:
588 * pt.c (tsubst): Remove the use of tf_no_class_instantiations.
590 2010-11-03 Jason Merrill <jason@redhat.com>
593 * init.c (expand_default_init): Avoid ICE if we can't figure out
594 which function is being called.
596 2010-11-02 Nathan Froyd <froydnj@codesourcery.com>
598 * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
599 instead of fold_convert.
600 * init.c (build_zero_init): Likewise.
601 * typeck.c (cp_build_binary_op): Likewise.
603 2010-11-02 Dodji Seketeli <dodji@redhat.com>
607 * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
609 (convert_nontype_argument, convert_nontype_argument): Pass the
610 complain parameter down to check_valid_ptrmem_cst_expr.
612 2010-11-02 Dodji Seketeli <dodji@redhat.com>
615 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
616 (struct template_parm_index_s)<num_siblings>: New field.
617 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
618 (process_template_parm): Extend the API to accept the number of
619 template parms in argument.
620 (cp_set_underlying_type): Remove this.
621 * class.c (build_self_reference): Require canonical type equality
622 back on the self reference of class.
623 * decl2.c (grokfield): Require canonical type equality back on
624 typedef class fields.
625 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
626 equality back on typedefs.
627 * parser.c (cp_parser_template_parameter_list): Do not require
628 canonical type equality on dependent types created during template
630 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
631 (fixup_template_parm, fixup_template_parms): New private
633 (current_template_args): Declare this.
634 (process_template_parm): Pass the total number of template parms
635 to canonical_type_parameter.
636 (build_template_parm_index): Add a new argument to carry the total
637 number of template parms.
638 (reduce_template_parm_level, process_template_parm, make_auto):
640 (current_template_args): Fix this for template template
642 (tsubst_template_parm): Split out of ...
643 (tsubst_template_parms): ... this.
644 (reduce_template_parm_level): Don't loose
645 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
646 (template_parm_to_arg): Extracted this function from
647 current_template_args. Make it represent invalid template parms
648 with an error_mark_node instead of a LIST_TREE containing an
650 (current_template_args): Use template_parm_to_arg.
651 (dependent_template_arg_p): Consider an invalid template argument
653 (end_template_parm_list): Do not update template sibling parms
654 here anymore. Use fixup_template_parms instead.
655 (process_template_parm): Pass the number of template parms to
656 canonical_type_parameter.
657 (make_auto): Require structural equality on auto
658 TEMPLATE_TYPE_PARM for now.
659 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
660 using all the arguments deduced so far.
661 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
662 canonical_type_parameter.
663 * tree.c (cp_set_underlying_type): Remove.
664 * typeck.c (get_template_parms_of_dependent_type)
665 (incompatible_dependent_types_p): Remove.
666 (structural_comptypes): Do not call incompatible_dependent_types_p
668 (comp_template_parms_position): Re-organized. Take the length of
669 template parms list in account.
671 2010-11-01 Jason Merrill <jason@redhat.com>
673 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
674 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
675 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
676 of giving follow-on errors.
677 * error.c (maybe_print_constexpr_context): New.
678 (cp_diagnostic_starter): Call it.
679 * cp-tree.h: Declare cx_error_context.
681 * semantics.c (cxx_eval_constant_expression): Explain
682 unacceptable use of variable better.
684 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
685 Jason Merrill <jason@redhat.com>
687 * call.c (null_ptr_cst_p): Use maybe_constant_value.
688 (set_up_extended_ref_temp): Support constant initialization.
689 (initialize_reference): Adjust.
690 * class.c (check_bitfield_decl): Use cxx_constant_value.
691 * cvt.c (ocp_convert): Don't use integral_constant_value when
692 converting to class type.
693 * decl.c (finish_case_label): Use maybe_constant_value.
694 (build_init_list_var_init): Support constant initialization.
695 (check_initializer): Likewise. Reorganize.
696 (cp_finish_decl): Likewise.
697 (expand_static_init): Likewise.
698 (compute_array_index_type): Use maybe_constant_value.
700 (create_array_type_for_decl, grokdeclarator): Pass it.
701 (build_enumerator): Use cxx_constant_value.
702 * decl2.c (grokfield): Use maybe_constant_init.
703 * except.c (check_noexcept_r): Handle constexpr.
704 (build_noexcept_spec): Use maybe_constant_value.
705 * init.c (expand_default_init): Support constant initialization.
706 (build_vec_init): Likewise.
707 (constant_value_1): Adjust.
708 (build_new_1): Adjust.
709 * parser.c (cp_parser_constant_expression): Allow non-integral
711 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
712 (cp_parser_initializer_clause): Toss folded result if non-constant.
713 * pt.c (fold_decl_constant_value): Remove.
714 (convert_nontype_argument): Use maybe_constant_value. Give clearer
715 error about overflow.
716 (tsubst): Move array bounds handling into compute_array_index_type.
717 (value_dependent_expression_p): Handle constant CALL_EXPR.
718 (tsubst_decl): Don't set
719 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
720 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
721 (instantiate_decl): Here too.
722 * semantics.c (finish_static_assert): Use maybe_constant_value.
723 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
724 (potential_constant_expression): Use maybe_constant_value.
725 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
726 is potentially valid in C++0x.
727 * typeck2.c (store_init_value): Handle constant init.
728 (check_narrowing): Use maybe_constant_value.
729 (build_functional_cast): Set TREE_CONSTANT on literal T().
730 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
731 (LOOKUP_ALREADY_DIGESTED): New.
732 (compute_array_index_type): Adjust prototype.
734 * semantics.c (constexpr_call): New datatype.
735 (constexpr_call_table): New global table.
736 (constexpr_call_hash): New.
737 (constexpr_call_equal): Likewise.
738 (maybe_initialize_constexpr_call_table): Likewise.
739 (lookup_parameter_binding): Likewise.
740 (cxx_eval_builtin_function_call): Likewise.
741 (cxx_bind_parameters_in_call): Likewise.
742 (cxx_eval_call_expression): Likewise.
743 (cxx_eval_unary_expression): Likewise.
744 (cxx_eval_binary_expression): Likewise.
745 (cxx_eval_conditional_expression): Likewise.
746 (cxx_eval_array_reference): Likewise.
747 (cxx_eval_component_reference): Likewise.
748 (cxx_eval_logical_expression): Likewise.
749 (cxx_eval_object_construction): Likewise.
750 (cxx_eval_constant_expression): Likewise.
751 (cxx_eval_indirect_ref): Likewise.
752 (cxx_constant_value): Likewise.
753 (cxx_eval_bare_aggregate): Likewise.
754 (adjust_temp_type): New.
755 (reduced_constant_expression_p): New.
756 (verify_constant): New.
757 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
758 (cxx_eval_outermost_constant_expr): New.
759 (maybe_constant_value, maybe_constant_init): New.
760 (cxx_eval_constant_expression): Use them.
761 * pt.c (iterative_hash_template_arg): No longer static.
762 * cp-tree.h: Declare fns.
764 * cp-tree.h (register_constexpr_fundef): Declare.
765 * decl.c (maybe_save_function_definition): New.
766 (finish_function): Use it.
767 * semantics.c (constexpr_fundef): New datatype.
768 (constexpr_fundef_table): New global table.
769 (constexpr_fundef_equal): New.
770 (constexpr_fundef_hash): Likewise.
771 (retrieve_constexpr_fundef): Likewise.
772 (validate_constexpr_fundecl): Store in the table.
773 (build_data_member_initialization): New fn.
774 (build_constexpr_constructor_member_initializers): New.
775 (register_constexpr_fundef): Define.
776 (is_this_parameter): New.
777 (get_function_named_in_call): Likewise.
778 (get_nth_callarg): Likewise.
779 (check_automatic_or_tls): New.
780 (morally_constexpr_builtin_function_p): New.
781 (potential_constant_expression): New.
783 2010-11-01 Jason Merrill <jason@redhat.com>
785 * decl2.c (decl_constant_var_p): New fn.
786 (decl_maybe_constant_var_p): New fn.
787 (mark_used): Rework instantiation of things needed for constant
789 * cp-tree.h: Declare new fns.
790 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
791 (always_instantiate_p): Use decl_maybe_constant_var_p.
792 (instantiate_decl): Don't defer constexpr functions.
793 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
794 * semantics.c (finish_id_expression): Use decl_constant_var_p.
795 Check for valid name in constant expr after mark_used.
797 2010-10-31 Jason Merrill <jason@redhat.com>
799 * class.c (is_really_empty_class): Work when type is not complete.
800 (synthesized_default_constructor_is_constexpr): New.
801 (add_implicitly_declared_members): Use it.
802 (type_has_constexpr_default_constructor): Likewise.
803 * cp-tree.h: Declare it.
804 * method.c (synthesized_method_walk): Use it.
806 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
807 * typeck.c (convert_for_assignment): Likewise.
809 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
810 message about constexpr without -std=c++0x.
812 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
815 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
817 * class.c (layout_vtable_decl): Call build_array_of_n_type.
818 (build_vtt, build_ctor_vtabl_group): Likewise.
820 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
822 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
823 * parser.c (cp_parser_objc_at_property_declaration): Removed
824 parsing of RID_COPIES and RID_IVAR. Updated call to
825 objc_add_property_declaration.
826 * typecheck.c (finish_class_member_access_expr): Call
827 objc_maybe_build_component_ref instead of objc_build_setter_call.
828 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
829 of objc_build_getter_call.
831 2010-10-27 Jason Merrill <jason@redhat.com>
833 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
834 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
835 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
836 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
837 (cp_parser_trait_expr): Likewise.
839 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
840 Jason Merrill <jason@redhat.com>
842 * decl.c (finish_case_label): Use decl_constant_value.
844 * method.c (synthesized_method_walk): Track constexprness too.
845 (process_subob_fn, walk_field_subobs): Likewise.
846 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
847 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
848 * class.c (add_implicitly_declared_members): Handle
849 constexpr default ctor.
851 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
852 Make sure a constexpr ctor has an empty body.
853 * class.c (type_has_constexpr_default_constructor): New.
854 * cp-tree.h: Declare it.
855 * init.c (perform_member_init): Complain about uninitialized
856 member in constexpr ctor.
857 (emit_mem_initializers): And uninitialized base.
858 * decl.c (check_tag_decl): Fix typo.
860 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
861 (is_valid_constexpr_fn): New fn.
862 (validate_constexpr_fundecl): Use it.
863 * decl.c (validate_constexpr_redeclaration): New.
864 (duplicate_decls): Use it.
865 (cp_finish_decl): Call validate_constexpr_fundecl and
866 ensure_literal_type_for_constexpr_object here.
867 (start_decl): Not here. Don't ICE on constexpr reference.
868 (check_for_uninitialized_const_var): Don't handle constexpr specially.
869 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
870 (check_static_variable_definition): Give friendly message about
872 (grokdeclarator): Complain about typedef and volatile with constexpr.
873 Reorganize. Give sorry about non-static data members in C++0x mode.
874 (start_preparsed_function): Check validate_constexpr_fundecl here.
875 (check_function_type): Not here.
876 * decl2.c (finish_static_data_member_decl): Don't complain about
878 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
879 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
880 (cp_parser_decl_specifier_seq): Handle it.
881 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
883 * class.c (check_bases): Propagate non-literality.
884 (check_field_decls): Likewise.
885 (finalize_literal_type_property): New.
886 (check_bases_and_members): Call it.
887 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
888 (lang_type_class): Add has_constexpr_ctor field.
889 (DECL_DECLARED_CONSTEXPR_P): Strip template.
890 * decl.c (grok_special_member_properties): Set
891 TYPE_HAS_CONSTEXPR_CTOR.
893 2010-10-27 Jason Merrill <jason@redhat.com>
895 * call.c (build_integral_nontype_arg_conv): New.
896 * cp-tree.h: Declare it.
897 * pt.c (convert_nontype_argument): Use it.
899 * error.c (dump_simple_decl): Print constexpr.
901 * cvt.c (build_up_reference): Use target_type for the temporary var.
903 * except.c (build_throw): Set EXPR_LOCATION.
905 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
907 * semantics.c (finish_compound_stmt): Avoid creating an
908 unnecessary BIND_EXPR.
910 * call.c (convert_like_real): Don't check narrowing if the element
911 is also an initializer-list.
913 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
915 * parser.c (cp_parser_objc_at_property_declaration): Recognize
916 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
917 Do not use objc_set_property_attr, but use local variables
918 instead. Detect repeated usage of setter, getter and ivar
919 attributes. Improved error processing when a setter name does not
920 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
921 that the token is a keyword. Updated call to
922 objc_add_property_declaration.
924 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
926 * parser.c (cp_parser_objc_property_decl): Renamed to
927 cp_parser_objc_struct_declaration. Return the parsed trees
928 instead of calling objc_add_property_variable directly. Detect
929 missing or invalid declspecs. Implemented attributes. Do not eat
930 the ';' at the end. Exit loop whenever a non-comma is parsed, not
932 (cp_parser_objc_at_property): Renamed to
933 cp_parser_objc_at_property_declaration. Updated calls to
934 objc_add_property_variable, now objc_add_property_declaration, and
935 to cp_parser_objc_property_decl, now
936 cp_parser_objc_struct_declaration. Rewritten all code to be more
937 robust in dealing with syntax errors, and almost identical to the
938 one in c_parser_objc_at_property_declaration.
939 (cp_parser_objc_property_attrlist): Removed.
940 (cp_parser_objc_method_prototype_list): Updated call to
941 cp_parser_objc_at_property.
942 (cp_parser_objc_method_definition_list): Same change.
943 (cp_parser_objc_class_ivars): Detect a number of invalid
944 declarations of instance variables and produce errors when they
947 2010-10-26 Jason Merrill <jason@redhat.com>
949 * tree.c (build_vec_init_expr): Split out from...
950 (build_array_copy): ...here.
951 * init.c (perform_member_init): Use it.
952 * cp-tree.h: Declare it.
953 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
954 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
955 (cp_gimplify_expr): Handle array default-initialization via
958 * tree.c (stabilize_expr): Handle xvalues properly.
960 * call.c (build_over_call): Use argarray[0] for 'this' argument.
962 * decl.c (finish_function): Don't look at function_depth.
964 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
966 Implement opaque-enum-specifiers for C++0x.
967 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
968 (OPAQUE_ENUM_P): New.
969 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
970 (start_enum): Update prototype.
971 (finish_enum_value_list): New prototype.
972 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
973 "enum class" is used in an elaborated-type-specifier.
974 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
975 * decl.c (copy_type_enum): New.
976 (finish_enum_value_list): New, with code from finish_enum.
977 (finish_enum): A lot of code removed. Added a gcc_assert.
978 (start_enum): Add parameters enumtype and is_new.
979 Rewrite to work with opaque-enum-specifiers.
980 * pt.c (maybe_process_partial_specialization): Allow for template
981 specialization of enumerations, with a pedwarn.
982 (lookup_template_class): Update call to start_enum. Call to
984 (tsubst_enum): Call to begin_scope, finish_scope and
985 finish_enum_value_list.
987 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
989 Removed Objective-C++ specific replacement of cxx_printable_name.
990 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
991 to cxx_printable_name for both C++ and Objective-C++.
992 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
994 * error.c (dump_decl): For Objective-C++, call
995 objc_maybe_printable_name here ...
996 * tree.c (cxx_printable_name_internal): ... instead of here.
998 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
1000 * tree.c (cxx_printable_name_internal): In Objective-C++, call
1001 objc_maybe_printable_name.
1003 2010-10-22 Jason Merrill <jason@redhat.com>
1006 * pt.c (instantiate_class_template): Don't instantiate default
1010 * init.c (build_vec_init): Handle memberwise move.
1012 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
1015 * call.c (add_function_candidate): Don't use TREE_VALUE on null
1018 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
1020 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
1021 bool instead of calling objc_set_method_type.
1022 (cp_parser_objc_method_signature): Updated calls to
1023 cp_parser_objc_method_type and to objc_build_method_signature.
1024 (cp_parser_objc_method_prototype_list): Updated calls to
1025 objc_add_method_declaration. Use token->type to determine if it
1026 is a class method or not.
1027 (cp_parser_objc_method_definition_list): Same change.
1029 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1032 * parser.c (cp_convert_range_for): Call cp_finish_decl
1033 instead of finish_expr_stmt.
1035 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
1037 * cp-lang.c (finish_file): Removed.
1038 * decl2.c (cp_write_global_declarations): Call
1039 objc_write_global_declarations when compiling Objective-C++.
1041 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
1044 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
1045 (coerce_template_parms): Likewise for args.
1047 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
1049 Implemented parsing @synthesize and @dynamic for Objective-C++.
1050 * parser.c (cp_parser_objc_method_definition_list): Recognize
1051 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
1052 (cp_parser_objc_at_dynamic_declaration): New.
1053 (cp_parser_objc_at_synthesize_declaration): New.
1055 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
1057 * parser.c (cp_parser_objc_identifier_list): Check the return
1058 value of cp_parser_identifier and react if it is error_mark_node.
1060 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
1062 Merge from apple/trunk branch on FSF servers.
1064 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
1067 * call.c (standard_conversion, implicit_conversion): Ignore
1068 'volatile' attribute of artificially volatized type in objc when
1069 evaluating various conversion weights.
1071 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
1074 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
1075 artiificially 'volatized' type before doing pointer comparison.
1077 2010-10-18 Jakub Jelinek <jakub@redhat.com>
1080 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
1083 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
1085 Merge from apple/trunk branch on FSF servers.
1087 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
1090 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
1091 objc object types if type is scope qualified.
1093 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
1095 Merge from apple/trunk branch on FSF servers.
1097 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
1100 * lex.c (unqualified_name_lookup_error): Issue diagnostic
1101 for private 'ivar' access.
1103 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
1105 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
1106 enum, and handle @package.
1108 2010-10-15 Jason Merrill <jason@redhat.com>
1111 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
1112 with a different typedef variant of the element type.
1114 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
1116 merge from FSF apple 'trunk' branch.
1117 2006 Fariborz Jahanian <fjahanian@apple.com>
1119 Radars 4436866, 4505126, 4506903, 4517826
1120 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
1122 (cp_build_modify_expr): Likewise.
1123 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
1124 (cp_parser_objc_method_definition_list): Likewise.
1125 (cp_parser_objc_property_decl): New.
1126 (cp_parser_objc_property_attrlist): New.
1127 (cp_parser_objc_at_property): New.
1129 2010-10-14 Richard Guenther <rguenther@suse.de>
1132 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
1133 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
1135 * error.c (dump_type): Handle NULLPTR_TYPE.
1136 (dump_type_prefix): Likewise.
1137 (dump_type_suffix): Likewise.
1138 * mangle.c (write_type): Likewise.
1139 * name-lookup.c (arg_assoc_type): Likewise.
1140 * rtti.c (typeinfo_in_lib_p): Likewise.
1141 * pt.c (tsubst): Likewise.
1143 2010-10-13 Jason Merrill <jason@redhat.com>
1146 * class.c (fixup_attribute_variants): New fn.
1147 * cp-tree.h: Declare it.
1148 * pt.c (instantiate_class_template): Call it.
1149 * semantics.c (begin_class_definition): Call it.
1151 2010-10-13 Richard Henderson <rth@redhat.com>
1153 * cp-lang.c (cp_eh_personality): Update call to
1154 build_personality_function.
1155 * except.c (choose_personality_routine): Update function comment.
1157 2010-10-13 Richard Guenther <rguenther@suse.de>
1159 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
1160 clear DECL_CHAIN of NAMESPACE_DECLs.
1162 2010-10-11 Martin Jambor <mjambor@suse.cz>
1165 * cp-tree.h (current_class_ref): Check that cp_function_chain is
1167 * call.c (build_cxx_call): Likewise.
1169 2010-10-10 Jason Merrill <jason@redhat.com>
1171 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
1172 (tsubst_default_arguments): Only do this once for cloned fns.
1173 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
1175 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
1176 (tsubst_copy_and_build): Likewise.
1177 (tsubst_initializer_list): Likewise.
1178 (tsubst_copy): Change default to gcc_unreachable. Handle
1179 OVERLOAD and PTRMEM_CST.
1181 2010-10-10 Jason Merrill <jason@redhat.com>
1185 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
1187 2010-10-07 Andi Kleen <ak@linux.intel.com>
1189 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
1190 (cc1plus-dummy): Remove.
1191 (cc1plus-checksum): Change to run checksum over object files
1194 2010-10-08 Joseph Myers <joseph@codesourcery.com>
1196 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
1198 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
1200 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
1202 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
1204 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
1205 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
1206 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
1207 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
1208 * parser.c (cp_parser_objc_encode_expression): Updated comment.
1210 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
1212 Merge from apple/trunk branch on FSF servers.
1214 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
1217 * parser.c (cp_parser_objc_interstitial_code): Recognize
1218 and parse RID_NAMESPACE keyword.
1220 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
1222 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
1223 finding ellipsis, before checking for attributes.
1225 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
1227 Merge from apple/trunk branch on FSF servers.
1228 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
1229 longer existing gcc/c-common.def.
1231 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
1234 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
1235 * parser.c (cp_parser_objc_encode_expression): Build a templatized
1236 parse tree for @encode(T).
1238 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
1241 * c-common.def: Add new expression code AT_ENCODE_EXPR.
1243 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
1246 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
1247 code folding offsetof-like computations.
1249 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
1252 * parser.c (cp_parser_objc_class_interface): If no identifier
1253 follows an @interface token, stop parsing the interface after
1255 (cp_parser_objc_class_implementation): If no identifier follows an
1256 @implementation token, stop parsing the implementation after
1259 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
1262 * parser.c (cp_parser_objc_method_keyword_params): If the required
1263 colon is not found while parsing parameters, stop parsing them.
1265 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
1268 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
1269 @end after detecting it. Print an error if @end is found without
1271 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
1272 detecting it. Fixed reading the next token when continuing
1273 because of an error in a method signature. Print an error if EOF
1274 is found without an '@end'.
1275 (cp_parser_objc_method_definition_list): Same change.
1277 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
1279 Merge from apple/trunk branch on FSF servers:
1281 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
1284 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
1285 method parameters and issue error.
1286 (cp_parser_objc_method_definition_list): Check for invalid tokens
1287 which cannot start a function definition.
1289 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
1292 * parser.c (cp_parser_objc_message_args): Check for missing message
1293 arguments and syntax error.
1295 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
1298 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
1301 2005-08-15 Ziemowit Laski <zlaski@apple.com>
1304 * parser.c (cp_parser_objc_interstitial_code): Catch stray
1305 '{' and '}' tokens and issue appropriate errors.
1307 2005-08-02 Ziemowit Laski <zlaski@apple.com>
1310 (cp_parser_statement_seq_opt): In addition to '}' and
1311 end-of-file, a statement sequence may also be terminated
1314 2010-10-05 Joseph Myers <joseph@codesourcery.com>
1316 * cp-tree.h (cxx_print_error_function,
1317 cxx_initialize_diagnostics): Declare using diagnostic_context
1320 2010-10-04 Andi Kleen <ak@linux.intel.com>
1322 * Make-lang.in (g++, cc1plus): Add + to build rule.
1324 2010-10-04 Jason Merrill <jason@redhat.com>
1326 * tree.c (decl_storage_duration): New.
1327 * cp-tree.h: Declare it.
1328 (duration_kind): Return values.
1330 2010-10-03 Jason Merrill <jason@redhat.com>
1332 * typeck.c (require_complete_type_sfinae): Add complain parm to...
1333 (require_complete_type): ...this function.
1334 (cp_build_array_ref, convert_arguments): Use it.
1335 (convert_for_initialization, cp_build_modify_expr): Likewise.
1336 * cp-tree.h: Declare it.
1337 * call.c (build_over_call): Use it.
1339 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
1341 merge from FSF 'apple/trunk' branch.
1342 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
1345 * cp/parser.c (cp_parser_objc_interstitial_code): For
1346 @optional/@required set the optional/required flag.
1348 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
1350 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
1351 and indentation when finding an Objective-C++ CPP_AT_NAME token.
1353 2010-09-29 Richard Guenther <rguenther@suse.de>
1355 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
1356 (CP_TYPE_CONTEXT): Similar.
1357 (FROB_CONTEXT): Frob global_namespace to the global
1358 TRANSLATION_UNIT_DECL.
1359 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
1360 set DECL_CONTEXT of global_namespace to it.
1361 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
1362 instead of zeroing context.
1363 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
1364 (grokfndecl): Likewise.
1365 (start_preparsed_function): Likewise.
1366 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
1367 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
1368 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
1369 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
1370 (push_template_decl_real): Likewise.
1371 (tsubst_friend_class): Likewise. Adjust context comparisons.
1372 (instantiate_class_template): Use CP_TYPE_CONTEXT.
1373 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
1374 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
1377 2010-09-29 Yao Qi <yao@codesourcery.com>
1379 * decl.c (get_atexit_node): Fix typo.
1381 2010-09-28 Jason Merrill <jason@redhat.com>
1383 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
1384 (real_lvalue_p): Take const_tree.
1385 * cp-tree.h: Adjust.
1386 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
1387 (cp_build_addr_expr_1): Likewise.
1389 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
1391 Partially merged from apple/trunk branch on FSF servers:
1392 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
1393 Radar 3803157 (method attributes)
1395 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
1396 (cp_parser_objc_method_tail_params_opt): Likewise.
1397 (cp_parser_objc_method_signature): Likewise.
1398 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
1399 (cp_parser_objc_method_prototype_list): Handle attributes.
1400 (cp_parser_objc_method_definition_list): Likewise.
1402 2010-09-28 Richard Henderson <rth@redhat.com>
1404 * cp-lang.c: Include "target.h".
1405 (cp_eh_personality): Use targetm.except_unwind_info.
1406 * Make-lang.in (cp-lang.o): Update deps.
1408 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
1410 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
1411 (cp_parser_declaration): Parse prefix attributes for ObjC++.
1412 (cp_parser_objc_protocol_declaration): Handle attributes.
1413 (cp_parser_objc_class_interface): Likewise.
1414 (cp_parser_objc_declaration): Likewise.
1416 2010-09-27 Jason Merrill <jason@redhat.com>
1418 Require lvalues as specified by the standard.
1419 * typeck.c (lvalue_or_else): Use real_lvalue_p.
1420 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
1421 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
1422 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
1423 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
1424 (build_const_cast_1): Adjust.
1425 * cp-tree.h: Declare new fns.
1426 * call.c (build_this, convert_like_real, build_over_call): Adjust.
1427 (initialize_reference): Adjust.
1428 * class.c (build_base_path, convert_to_base_statically): Adjust.
1429 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
1430 * cvt.c (build_up_reference, convert_to_reference): Adjust.
1431 * decl.c (register_dtor_fn): Adjust.
1432 * decl2.c (build_offset_ref_call_from_tree): Adjust.
1433 * except.c (initialize_handler_parm): Adjust.
1434 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
1435 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
1436 * tree.c (stabilize_expr): Adjust.
1438 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
1440 Merge from apple/trunk branch on FSF servers:
1442 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
1445 * typeck.c (composite_pointer_type): Call objc_have_common_type
1446 when comparing two objective-c pointer types.
1448 2005-07-18 Ziemowit Laski <zlaski@apple.com>
1451 * call.c (standard_conversion): Do not issue warnings when
1452 comparing ObjC pointer types.
1454 2005-06-22 Ziemowit Laski <zlaski@apple.com>
1457 * call.c (standard_conversion): Allow for a pointer conversion
1458 between any two ObjC pointer types.
1459 * typeck.c (composite_pointer_type): Determine common type
1460 for two ObjC pointer types.
1462 2010-09-24 Jan Hubicka <jh@suse.cz>
1464 * decl.c (finish_function): Use decl_replaceable_p
1465 * method.c (make_alias_for_thunk): Update call of
1466 cgraph_same_body_alias.
1468 2010-09-24 Jason Merrill <jason@redhat.com>
1470 * decl.c (compute_array_index_type): Remember type dependence of
1472 * pt.c (dependent_type_p_r): Don't recompute it here.
1474 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
1475 reference and pointer to the same type as "*" or "&".
1477 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
1479 * typeck.c (warn_args_num): Use warning 'too many arguments to
1480 method [methodname]' for an Objective-C method instead of the less
1481 satisfactory 'too many arguments to function' (with no method
1484 2010-09-21 Jason Merrill <jason@redhat.com>
1486 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
1487 special handling if we know the member.
1489 2010-09-18 Jason Merrill <jason@redhat.com>
1491 * call.c (compare_ics): Do lvalue/rvalue reference binding
1492 comparison for ck_list, too.
1494 2010-09-15 Jason Merrill <jason@redhat.com>
1496 * semantics.c (finish_id_expression): Diagnose use of function
1497 parms in evaluated context outside function body.
1499 * decl2.c (grokbitfield): Diagnose non-integral width.
1501 * call.c (convert_like_real): Use the underlying type of the
1502 reference for the temporary.
1504 2010-09-15 Jakub Jelinek <jakub@redhat.com>
1507 * class.c (build_vtbl_initializer): Use fn instead of init's operand
1508 as first argument to FDESC_EXPR.
1510 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
1513 * decl.c (grokdeclarator): Check build_memfn_type return value
1514 for error_mark_node.
1516 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1518 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
1519 (begin_range_for_stmt): Likewise.
1521 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
1523 Implement range-based for-statements.
1524 * cp-tree.def (RANGE_FOR_STMT): New.
1525 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
1526 (cp_convert_range_for): Declare.
1527 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
1528 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
1529 * semantics.c (begin_range_for_stmt): New.
1530 (finish_range_for_decl): New.
1531 (finish_for_stmt): Accept also RANGE_FOR_STMT.
1532 (perform_koenig_lookup): Add extra argument include_std.
1533 * parser.c (cp_parser_c_for): New with code from
1534 cp_parser_iteration_statement().
1535 (cp_parser_range_for): New.
1536 (cp_convert_range_for): New.
1537 (cp_parser_iteration_statement): Add range-for support.
1538 (cp_parser_condition): Adjust comment.
1539 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
1541 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
1542 * cxx-pretty-print.c: Likewise.
1543 * lex.c (cxx_init): Likewise.
1544 * name-lookup.c (lookup_function_nonclass): Add extra argument
1546 (lookup_arg_dependent): Likewise.
1547 * name-lookup.h: Likewise.
1549 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1552 * error.c (maybe_warn_cpp0x): Add new warning
1553 CPP0X_INLINE_NAMESPACES.
1554 * parser.c (cp_parser_namespace_definition): Likewise.
1555 * cp-tree.h (cpp0x_warn_str): Likewise.
1557 2010-09-10 Richard Guenther <rguenther@suse.de>
1559 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
1560 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
1562 2010-09-10 Jan Hubicka <jh@suse.cz>
1564 PR tree-optimization/45605
1565 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
1568 2010-09-08 Jakub Jelinek <jakub@redhat.com>
1571 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
1572 before calling fold_decl_constant_value.
1574 2010-09-07 Arnaud Charlet <charlet@adacore.com>
1576 * cp-tree.h (build_enumerator): Add new location_t parameter.
1577 (build_lang_decl_loc): New function.
1578 * decl.c (build_enumerator): New parameter loc. Use it when calling
1579 build_decl. Replace build_lang_decl with build_lang_decl_loc.
1580 * pt.c (tsubst_enum): Adjust call to build_enumerator.
1581 * parser.c (cp_parser_enumerator_definition): Ditto.
1582 * lex.c (build_lang_decl_loc): New function.
1584 2010-09-06 Dodji Seketeli <dodji@redhat.com>
1589 * tree.c (strip_typedefs): Strip typedefs from the context of
1592 2010-09-06 Mark Mitchell <mark@codesourcery.com>
1594 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
1595 * call.c (build_conditional_expr): Likewise.
1596 (convert_arg_to_ellipsis): Likewise.
1598 2010-09-06 Arnaud Charlet <charlet@adacore.com>
1600 * parser.c (make_pointer_declarator, make_reference_declarator,
1601 make_call_declarator, make_array_declarator): Set declarator->id_loc.
1602 (cp_parser_init_declarator): Adjust location of decl if appropriate.
1604 2010-09-06 Jason Merrill <jason@redhat.com>
1606 * call.c (implicit_conversion): Fix value-init of enums.
1607 (convert_like_real): Likewise.
1609 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1611 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1612 (fold_non_dependent_expr): ...here.
1613 (convert_nontype_argument): Use it. Take complain parm.
1614 Use perform_implicit_conversion instead of ocp_convert.
1615 Allow cv-qual changes.
1616 (convert_template_argument): Pass complain down.
1617 (tsubst_template_arg): Suppress constant expression warnings.
1620 * method.c (synthesized_method_walk): In constructors, also check
1621 subobject destructors.
1623 * semantics.c (finish_compound_literal): Always build a
1626 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1629 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1631 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1634 * parser.c (cp_parser_omp_atomic): Handle boolean
1635 {PRE,POST}_INCREMENT.
1637 2010-08-29 Jason Merrill <jason@redhat.com>
1640 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1641 after tentative parsing.
1643 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1645 * Make-lang.in (g++spec.o): Update dependencies.
1646 * g++spec.c: Include opts.h
1647 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1648 (lang_specific_driver): Use cl_decoded_option structures.
1650 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1652 * call.c: Use FOR_EACH_VEC_ELT.
1653 * class.c: Likewise.
1655 * decl2.c: Likewise.
1656 * error.c: Likewise.
1657 * except.c: Likewise.
1658 * mangle.c: Likewise.
1659 * method.c: Likewise.
1660 * name-lookup.c: Likewise.
1661 * parser.c: Likewise.
1664 * semantics.c: Likewise.
1665 * typeck2.c: Likewise.
1667 2010-08-19 Jason Merrill <jason@redhat.com>
1669 * call.c (reference_related_p): Check for error_mark_node.
1670 (add_function_candidate): Check it instead of
1671 same_type_ignoring_top_level_qualifiers_p.
1674 * init.c (build_new_1): Don't use build_value_init in a template.
1675 (build_value_init): Make sure we don't.
1678 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1679 of empty class CONSTRUCTOR.
1681 * except.c (pending_noexcept, pending_noexcept_checks): New.
1682 (perform_deferred_noexcept_checks): New.
1683 (maybe_noexcept_warning): Split from...
1684 (finish_noexcept_expr): ...here. Adjust.
1685 * decl2.c (cp_write_global_declarations): Call
1686 perform_deferred_noexcept_checks.
1687 * cp-tree.h: And declare it.
1689 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1692 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1695 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1697 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1698 or if -fms-extensions is enabled check, check permissive.
1700 2010-08-09 Jason Merrill <jason@redhat.com>
1703 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1705 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1707 * call.c (add_builtin_candidates): Use VECs for local variable
1708 `types'. Adjust remainder of function accordingly.
1710 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1712 * name-lookup.c (is_associated_namespace): Convert local variables
1713 to be VECs instead of TREE_LISTs.
1715 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1717 * tree.c (varargs_function_p): Use stdarg_p.
1719 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1721 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1722 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1723 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1724 Change type to a VEC.
1725 (unparsed_funs_with_default_args): Define.
1726 (unparsed_funs_with_definitions): Define.
1727 (push_unparsed_function_queues): New function.
1728 (cp_parser_new): Call it.
1729 (pop_unparsed_function_queues): New function.
1730 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1731 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1732 (cp_parser_save_member_function_body): Likewise.
1733 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1734 and pop_unparsed_function_queues.
1735 (cp_parser_late_parsing_default_args): Likewise.
1736 (cp_parser_save_default_args): Use VEC_safe_push.
1738 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1740 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1742 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1744 * decl.c (poplevel): Adjust for type changes.
1745 (declare_local_label): Likewise.
1747 2010-08-06 Jason Merrill <jason@redhat.com>
1749 * typeck.c (complete_type_or_maybe_complain): Split out from...
1750 (complete_type_or_else): Here.
1751 (build_class_member_access_expr): Call it.
1752 (finish_class_member_access_expr): Likewise.
1753 * call.c (build_special_member_call): Likewise.
1754 * cvt.c (build_expr_type_conversion): Likewise.
1755 * init.c (build_new): Likewise.
1756 * typeck2.c (build_functional_cast): Likewise.
1757 * cp-tree.h: Declare it.
1759 * init.c (build_value_init): Add complain parm.
1760 (build_value_init_noctor): Likewise.
1761 (perform_member_init): Pass it.
1762 (expand_aggr_init_1): Likewise.
1763 (build_new_1): Likewise.
1764 (build_vec_init): Likewise.
1765 * pt.c (tsubst_expr): Likewise.
1766 * typeck2.c (build_functional_cast): Likewise.
1767 * cp-tree.h: Adjust.
1768 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1770 * typeck.c (decay_conversion): Any expression with type nullptr_t
1773 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1776 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1778 2010-07-27 Jason Merrill <jason@redhat.com>
1780 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1781 from build_value_init.
1782 * init.c (build_value_init_noctor): Give error for unknown array
1785 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1787 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1789 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1791 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1792 c_common_initialize_diagnostics.
1793 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1794 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1796 2010-07-21 Jason Merrill <jason@redhat.com>
1798 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1800 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1803 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1806 * pt.c (instantiate_class_template): Propagate the template's
1807 location to its instance.
1809 2010-07-20 Jason Merrill <jason@redhat.com>
1812 * pt.c (tsubst_copy_and_build): Rework last change.
1815 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1818 2010-07-19 Jason Merrill <jason@redhat.com>
1821 * semantics.c (finish_decltype_type): Correct decltype
1822 of parenthesized rvalue reference variable.
1825 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1826 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1828 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1831 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1833 * cp-tree.h: Adjust declaration.
1834 * init.c (perform_member_init): Adjust caller.
1835 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1836 * typeck2.c (store_init_value): Likewise.
1837 (build_functional_cast): Pass complain argument to
1838 build_x_compound_expr_from_list.
1840 2010-07-16 Jason Merrill <jason@redhat.com>
1843 * pt.c (process_partial_specialization): Diagnose partial
1844 specialization after instantiation.
1845 (most_specialized_class): Add complain parm.
1847 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1849 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1851 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1852 cp_build_function_call.
1854 2010-07-15 Jason Merrill <jason@redhat.com>
1857 * call.c (add_function_candidate): If we're working on an implicit
1858 declaration, don't consider candidates that won't match.
1859 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1860 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1863 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1864 (TYPE_HAS_USER_OPEQ): New.
1865 * decl.c (grok_special_member_properties): Set it.
1866 * class.c (add_implicitly_declared_members): Don't lazily declare
1867 constructors/operator= if a base or member has a user-declared one.
1868 (check_bases_and_members, check_bases): Adjust.
1869 (check_field_decls, check_field_decl): Adjust.
1871 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1873 * decl.c (integer_three_node): Remove.
1874 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1875 * cp-tree.h (integer_three_node): Remove.
1877 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1879 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1881 * class.c: Likewise.
1882 * cp-gimplify.c: Likewise.
1884 * decl2.c: Likewise.
1886 * mangle.c: Likewise.
1887 * name-lookup.c: Likewise.
1888 * optimize.c: Likewise.
1889 * parser.c: Likewise.
1892 * search.c: Likewise.
1893 * semantics.c: Likewise.
1894 * typeck.c: Likewise.
1895 * typeck2.c: Likewise.
1897 2010-07-14 Jason Merrill <jason@redhat.com>
1899 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1900 (build_field_list): Cache field type.
1902 Implement C++0x unrestricted unions (N2544)
1903 * class.c (check_field_decl): Loosen union handling in C++0x.
1904 * method.c (walk_field_subobs): Split out from...
1905 (synthesized_method_walk): ...here. Set msg before loops.
1906 (process_subob_fn): Check for triviality in union members.
1907 * init.c (sort_mem_initializers): Splice out uninitialized
1908 anonymous unions and union members.
1909 (push_base_cleanups): Don't automatically destroy anonymous unions
1912 2010-07-13 Jason Merrill <jason@redhat.com>
1915 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1916 (TYPE_HAS_USER_OPEQ): New.
1917 * decl.c (grok_special_member_properties): Set it.
1918 * class.c (add_implicitly_declared_members): Don't lazily declare
1919 constructors/operator= if a base or member has a user-declared one.
1920 (check_bases_and_members, check_bases): Adjust.
1921 (check_field_decls, check_field_decl): Adjust.
1922 * method.c (synthesized_method_walk): Initialize check_vdtor.
1925 * mangle.c (write_type): Canonicalize.
1926 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1927 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1929 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1932 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1934 * typeck.c (get_delta_difference): Update prototype, add a
1935 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1936 add checks for error_mark_node.
1937 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1938 parameter; update lookup_base call.
1939 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1940 parameter; update get_delta_difference call and add check for
1942 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1943 parameter; update get_delta_difference call and add check for
1944 error_mark_node; update build_ptrmemfunc call.
1945 (build_static_cast_1): Adjust convert_ptrmem call.
1946 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1947 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1948 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1949 and build_ptrmemfunc calls.
1950 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1952 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1955 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1956 adjust build_special_member_call call, pass complain.
1957 (convert_like_real): Adjust build_temp call, pass complain.
1959 2010-07-09 Jason Merrill <jason@redhat.com>
1962 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1963 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1964 Set BV_LOST_PRIMARY.
1965 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1967 2010-07-08 Jason Merrill <jason@redhat.com>
1970 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1971 virtual bases for covariant thunks.
1973 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1975 * cp-tree.h: Do not include toplev.h.
1977 2010-07-06 Jason Merrill <jason@redhat.com>
1980 * call.c (is_std_init_list): Look through typedefs.
1983 * init.c (build_offset_ref): If scope isn't dependent,
1984 don't exit early. Look at TYPE_MAIN_VARIANT.
1985 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1987 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1989 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1991 * cp-tree.h (impl_conv_void): New type.
1992 (convert_to_void): Adjust prototype.
1993 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1994 diagnostic for easy translation. Change caller.
1995 * typeck.c: Update call to convert_to_void.
1996 * semantics.c: Likewise.
1999 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
2001 * decl.c (cp_finish_decl): Call add_local_decl.
2002 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
2004 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
2006 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
2009 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
2012 * parser.c (cp_parser_primary_expression): Error if local template is
2015 2010-07-02 Le-Chun Wu <lcwu@google.com>
2018 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
2019 (variable or type) shadows another type.
2021 2010-07-02 Jakub Jelinek <jakub@redhat.com>
2024 * typeck.c (convert_for_assignment): When converting a convertible
2025 vector type or objc++ types, call mark_rvalue_use.
2026 * typeck2.c (build_m_component_ref): Use return values from
2027 mark_rvalue_use or mark_lvalue_use.
2028 * class.c (build_base_path): Likewise.
2029 * call.c (build_conditional_expr): Likewise.
2031 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
2034 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
2037 2010-07-01 Richard Guenther <rguenther@suse.de>
2039 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
2040 predicate we are looking for, allow non-gimplified
2043 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
2046 * typeck.c (cp_build_unary_op): Early return error_mark_node when
2047 arg is NULL_TREE too.
2048 * call.c (convert_class_to_reference): Return error_mark_node when
2051 2010-06-30 Michael Matz <matz@suse.de>
2053 * repo.c (finish_repo): Fix typo.
2055 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
2057 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
2059 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
2061 * repo.c (pending_repo): Change type to a VEC.
2062 (finish_repo): Adjust for new type of pending_repo.
2063 (repo_emit_p): Likewise.
2065 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
2067 * tree.c: Include gimple.h. Do not include tree-flow.h
2068 * decl.c: Do not include tree-flow.h
2069 * Make-lang.in: Adjust dependencies.
2071 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
2073 * decl.c (incomplete_var): Declare. Declare VECs containing them.
2074 (incomplete_vars): Adjust comment. Change type to a VEC.
2075 (maybe_register_incomplete_var): Adjust for new type.
2076 (complete_vars): Adjust iteration over incomplete_vars.
2078 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
2080 * decl.c (struct named_label_entry): Change type of bad_decls field
2082 (poplevel_named_label_1): Adjust for new type of bad_decls.
2083 (check_goto): Likewise.
2085 2010-06-29 Jason Merrill <jason@redhat.com>
2087 Enable implicitly declared move constructor/operator= (N3053).
2088 * class.c (add_implicitly_declared_members): A class with no
2089 explicitly declared copy or move constructor gets both declared
2090 implicitly, and similarly for operator=.
2091 (check_bases): A type with no copy ctor does not inhibit
2092 a const copy ctor in a derived class. It does mean the derived
2094 (check_field_decl): Likewise.
2095 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
2096 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
2097 (trivially_copyable_p): Likewise.
2098 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
2099 * class.c (finish_struct_bits): Likewise.
2100 * tree.c (build_target_expr_with_type): Likewise.
2101 * typeck2.c (store_init_value): Likewise.
2103 Enable implicitly deleted functions (N2346)
2104 * class.c (check_bases_and_members): Adjust lambda flags.
2105 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
2107 * decl2.c (mark_used): Adjust error for use of deleted function.
2109 Machinery to support implicit delete/move.
2110 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
2111 has_complex_move_ctor, has_complex_move_assign bitfields.
2112 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
2113 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
2114 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
2115 (enum special_function_kind): Add sfk_move_assignment.
2116 (LOOKUP_SPECULATIVE): New.
2117 * call.c (build_over_call): Return early if it's set.
2118 (build_over_call): Use trivial_fn_p.
2119 * class.c (check_bases): If the base has no default constructor,
2120 the derived one is non-trivial. Handle move ctor/op=.
2121 (check_field_decl): Likewise.
2122 (check_bases_and_members): Handle move ctor/op=.
2123 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
2124 (type_has_move_constructor, type_has_move_assign): New.
2125 * decl.c (grok_special_member_properties): Handle move ctor/op=.
2126 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
2127 (trivial_fn_p): New.
2128 (do_build_copy_constructor): Use it.
2129 (do_build_assign_ref): Likewise. Handle move assignment.
2130 (build_stub_type, build_stub_object, locate_fn_flags): New.
2131 (locate_ctor): Use locate_fn_flags.
2132 (locate_copy, locate_dtor): Remove.
2133 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
2134 (process_subob_fn, synthesized_method_walk): New.
2135 (maybe_explain_implicit_delete): New.
2136 (implicitly_declare_fn): Use synthesized_method_walk,
2137 type_has_trivial_fn, and type_set_nontrivial_flag.
2138 (defaulted_late_check): Set DECL_DELETED_FN.
2139 (defaultable_fn_check): Handle sfk_move_assignment.
2140 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
2141 implicitly deleted move ctor/op=.
2142 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
2143 (lookup_fnfields_slot): New.
2144 * semantics.c (omp_clause_info_fndecl): Remove.
2145 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
2146 get_copy_assign, trivial_fn_p.
2147 (trait_expr_value): Adjust call to locate_ctor.
2148 * tree.c (special_function_p): Handle sfk_move_assignment.
2150 * class.c (type_has_virtual_destructor): New.
2151 * cp-tree.h: Declare it.
2152 * semantics.c (trait_expr_value): Use it.
2154 * call.c (build_over_call): Only give warnings with tf_warning.
2156 * name-lookup.c (pop_scope): Handle NULL_TREE.
2158 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
2159 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
2160 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
2161 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
2162 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
2163 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
2164 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
2165 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
2166 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
2167 (sfk_assignment_operator): Rename to sfk_copy_assignment.
2168 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
2169 * search.c, semantics.c, tree.c: Adjust.
2171 * pt.c (dependent_scope_ref_p): Remove.
2172 (value_dependent_expression_p): Don't call it.
2173 (type_dependent_expression_p): Here either.
2174 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
2175 if the scope isn't dependent.
2177 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
2181 * pt.c (has_value_dependent_address): New.
2182 (value_dependent_expression_p): Check it.
2183 (convert_nontype_argument): Likewise. Call decay_conversion before
2184 folding if we want a pointer.
2185 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
2186 scope is the current instantiation.
2188 2010-06-28 Jakub Jelinek <jakub@redhat.com>
2191 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
2194 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
2196 * init.c: Do not include except.h.
2199 * cp-lang.c: Likewise.
2201 * semantics.c: Likewise.
2202 * decl2.c: Likewise.
2203 * except.c: Likewise.
2204 (init_exception_processing): Do not set the removed
2205 lang_protect_cleanup_actions here.
2206 (cp_protect_cleanup_actions): Make non-static and remove prototype.
2207 (doing_eh): New, moved from except.c but removed the do_warning flag.
2208 (expand_start_catch_block): Update doing_eh call.
2209 (expand_end_catch_block): Likewise.
2210 (build_throw): Likewise.
2211 * cp-tree.h: Prototype cp_protect_cleanup_actions.
2212 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
2213 cp_protect_cleanup_actions.
2214 * Make-lang.in: Update dependencies.
2216 2010-06-26 Jason Merrill <jason@redhat.com>
2218 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
2219 constructor called with a single argument that takes a reference
2220 to the constructor's class.
2221 (BAD_CONVERSION_RANK): New.
2222 (compare_ics): Use it to compare bad ICSes.
2224 2010-06-25 Joseph Myers <joseph@codesourcery.com>
2226 * lang-specs.h: Remove +e handling.
2228 2010-06-24 Andi Kleen <ak@linux.intel.com>
2230 * parser.c: (cp_parser_question_colon_clause):
2231 Switch to use cp_lexer_peek_token.
2232 Call warn_for_omitted_condop. Call pedwarn for omitted
2235 2010-06-22 Jakub Jelinek <jakub@redhat.com>
2238 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
2239 datum and mark_rvalue_use on component.
2242 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
2243 the CALL_EXPR has no arguments.
2245 2010-06-21 Jason Merrill <jason@redhat.com>
2247 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
2249 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
2252 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
2254 * name-lookup.c (struct arg_lookup): Convert namespaces and
2255 classes fields to VEC.
2256 (arg_assoc_namespace): Adjust for new type of namespaces.
2257 (arg_assoc_class): Adjust for new type of classes.
2258 (lookup_arg_dependent): Use make_tree_vector and
2259 release_tree_vector.
2260 * typeck2.c (build_x_arrow): Use vec_member.
2262 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
2265 * error.c (dump_decl): Better wording for anonymous namespace.
2267 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
2269 * class.c (build_vtbl_initializer): Adjust computation of new_position
2270 and which entry to add padding for.
2272 2010-06-16 Jason Merrill <jason@redhat.com>
2274 * except.c (check_noexcept_r): Return the problematic function.
2275 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
2276 * pt.c (tsubst_copy_and_build): Pass it.
2277 * parser.c (cp_parser_unary_expression): Likewise.
2278 * cp-tree.h: Adjust prototype.
2280 * method.c (defaulted_late_check): Give the defaulted method
2281 the same exception specification as the implicit declaration.
2283 2010-06-15 Jason Merrill <jason@redhat.com>
2285 * class.c (add_implicitly_declared_members): Implicit assignment
2286 operators can also be virtual overriders.
2287 * method.c (lazily_declare_fn): Likewise.
2289 * call.c (convert_like_real): Give "initializing argument of"
2290 information for ambiguous conversion. Give source position
2293 * call.c (print_z_candidates): Do print viable deleted candidates.
2294 (joust): Don't choose a deleted function just because its worst
2295 conversion is better than another candidate's worst.
2297 * call.c (convert_like_real): Don't complain about
2298 list-value-initialization from an explicit constructor.
2300 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
2301 DECL_SOURCE_LOCATION directly.
2303 * class.c (type_has_user_provided_default_constructor): Use
2306 * call.c (is_subseq): Handle ck_aggr, ck_list.
2307 (compare_ics): Treat an aggregate or ambiguous conversion to the
2308 same type as involving the same function.
2310 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
2312 * typeck.c (convert_for_assignment): Fix comment. Change message
2313 format from %d to %qP.
2314 (convert_for_initialization): Fix comment.
2316 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
2318 * cp-tree.h (expr_list_kind): New type.
2319 (impl_conv_rhs): New type.
2320 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
2322 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
2323 diagnostics for easy translation. Change caller.
2324 (convert_for_initialization): Use impl_conv_rhs and change caller.
2325 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
2326 diagnostics for easy translation. Change caller.
2327 * decl.c (bad_spec_place): New enum.
2328 (bad_specifiers): Use it and emit the diagnostics for easy
2329 translation. Change caller.
2330 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
2332 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
2334 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
2336 * decl2.c (cp_write_global_declarations): Adjust for new type of
2337 decl_namespace_list.
2338 * name-lookup.c (current_decl_namespace): Likewise.
2339 (push_decl_namespace): Likewise.
2340 (pop_decl_namespace): Likewise.
2342 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
2344 * call.c (build_java_interface_fn_ref): Call build_function_type_list
2345 instead of build_function_type.
2346 * decl.c (cxx_init_decl_processing): Likewise.
2347 (declare_global_var): Likewise.
2348 (get_atexit_node): Likewise.
2349 (expand_static_init): Likewise.
2350 * decl2.c (start_objects): Likewise.
2351 (start_static_storage_duration_function): Likewise.
2352 * except.c (init_exception_processing): Likewise.
2353 (build_exc_ptr): Likewise.
2354 (build_throw): Likewise.
2355 * rtti.c (throw_bad_cast): Likewise.
2356 (throw_bad_typeid): Likewise.
2357 (build_dynamic_cast_1): Likewise.
2359 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
2361 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
2362 (build_op_delete_call): Likewise.
2363 (build_over_call): Likewise.
2364 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
2365 * pt.c (process_partial_specialization): Likewise.
2366 (tsubst_template_args): Likewise.
2367 * semantics.c (finish_asm_stmt): Likewise.
2369 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
2371 * decl.c (record_key_method_defined): New, broken out of ...
2372 (finish_function): ... here. Call it.
2373 (start_decl): Treat aliases as definitions.
2375 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2377 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
2379 * pt.c (maybe_process_partial_specialization): Likewise.
2380 (register_specialization): Likewise.
2381 (add_pending_template): Likewise.
2382 (lookup_template_class): Likewise.
2383 (push_tinst_level): Likewise.
2385 * parser.c (cp_lexer_new_main): Likewise.
2386 (cp_lexer_new_from_tokens): Likewise.
2387 (cp_token_cache_new): Likewise.
2388 (cp_parser_context_new): Likewise.
2389 (cp_parser_new): Likewise.
2390 (cp_parser_nested_name_specifier_opt): Likewise.
2391 (cp_parser_template_id): Likewise.
2393 * name-lookup.c (binding_entry_make): Likewise.
2394 (binding_table_construct): Likewise.
2395 (binding_table_new): Likewise.
2396 (cxx_binding_make): Likewise.
2397 (pushdecl_maybe_friend): Likewise.
2398 (begin_scope): Likewise.
2399 (push_to_top_level): Likewise.
2401 * lex.c (init_reswords): Likewise.
2402 (retrofit_lang_decl): Likewise.
2403 (cxx_dup_lang_specific_decl): Likewise.
2404 (copy_lang_type): Likewise.
2405 (cxx_make_type): Likewise.
2407 * decl.c (make_label_decl): Likewise.
2408 (check_goto): Likewise.
2409 (start_preparsed_function): Likewise.
2410 (save_function_data): Likewise.
2412 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
2414 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
2416 * class.c (finish_struct_1): Likewise.
2418 * cp-tree.h (struct lang_type): Add variable_size GTY option.
2419 (struct lang_decl): Likewise.
2421 * parser.c (cp_parser_new): Update comment to not reference
2424 2010-06-07 Jason Merrill <jason@redhat.com>
2427 * error.c (dump_parameters): Mask out TFF_SCOPE.
2428 (dump_simple_decl): Don't print the scope of a PARM_DECL.
2429 (dump_scope): Remove no-op mask.
2432 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
2434 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
2435 * init.c (build_offset_ref): Use it.
2436 * pt.c (maybe_process_partial_specialization): Use it.
2437 (instantiate_class_template): Use it.
2438 * search.c (lookup_base): Use it.
2440 2010-06-07 Jakub Jelinek <jakub@redhat.com>
2443 * expr.c (mark_exp_read): Handle INDIRECT_REF.
2444 * cvt.c (convert_to_void): Handle INDIRECT_REF like
2445 handled_component_p.
2448 * decl.c (initialize_local_var): If TREE_USED is set on the type,
2449 set also DECL_READ_P on the decl.
2451 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2454 * cp-tree.h (typedef_variant_p): Move this declaration to
2456 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2457 * decl.c (grokdeclarator): Do not rename debug info of an
2458 anonymous tagged type named by a typedef.
2460 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
2463 * class.c (check_field_decls): Move the call to
2464 check_bitfield_decl before trying to set the
2465 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
2467 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
2469 * typeck.c: Update include path for moved files.
2472 * cp-gimplify.c: Likewise.
2473 * cp-lang.c: Likewise.
2475 * semantics.c: Likewise.
2476 * cxx-pretty-print.h: Likewise.
2477 * decl2.c: Likewise.
2478 * parser.c: Likewise.
2479 * cp-objcp-common.c: Likewise.
2480 * cp-tree.h: Likewise.
2481 * name-lookup.c: Likewise.
2483 * name-lookup.h: Likewise.
2484 * config-lang.in: Update paths in gtfiles for files in c-family/.
2485 * Make-lang.in: Likewise.
2487 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
2489 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
2490 * typeck.c (build_ptrmemfunc): Likewise.
2492 2010-06-04 Jason Merrill <jason@redhat.com>
2494 * typeck2.c (merge_exception_specifiers): Adjust merging of
2495 throw() and noexcept(true).
2497 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
2498 using an uninitialized variable.
2500 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
2501 (pp_cxx_expression): Likewise.
2503 Implement noexcept-specification (15.4)
2504 * parser.c (cp_parser_exception_specification_opt): Parse it.
2505 Give -Wdeprecated warning about throw() specs.
2506 * pt.c (tsubst_exception_specification): Handle it.
2507 * error.c (dump_exception_spec): Handle it.
2508 (dump_expr): Handle NOEXCEPT_EXPR.
2509 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
2510 * typeck.c (comp_except_specs): Handle compatibility rules.
2511 Change exact parm to take an enum.
2512 * typeck2.c (merge_exception_specifiers): Handle noexcept.
2513 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
2514 (type_throw_all_p, build_noexcept_spec): New fns.
2515 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
2516 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
2517 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
2518 (noexcept_true_spec, noexcept_false_spec): New macros.
2519 * name-lookup.c (pushdecl_maybe_friend): Adjust.
2520 * search.c (check_final_overrider): Adjust.
2521 * decl.c (check_redeclaration_exception_specification): Adjust.
2522 (use_eh_spec_block): Use type_throw_all_p.
2523 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
2524 Give operator new a noexcept-specification in C++0x mode.
2525 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
2526 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
2528 Implement noexcept operator (5.3.7)
2529 * cp-tree.def (NOEXCEPT_EXPR): New.
2530 * except.c (check_noexcept_r, finish_noexcept_expr): New.
2531 * cp-tree.h: Declare finish_noexcept_expr.
2532 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
2533 * pt.c (tsubst_copy_and_build): And tsubst it.
2534 (type_dependent_expression_p): Handle it.
2535 (value_dependent_expression_p): Handle it.
2537 * call.c (build_conditional_expr): Never fold in unevaluated context.
2538 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
2539 * semantics.c (simplify_aggr_init_expr): Likewise.
2540 * typeck.c (merge_types): Call merge_exception_specifiers.
2541 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
2542 DECL_ANTICIPATED for preferring new type.
2544 2010-06-04 Joseph Myers <joseph@codesourcery.com>
2546 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
2549 2010-06-04 Jakub Jelinek <jakub@redhat.com>
2552 * typeck.c (build_class_member_access_expr): Call mark_exp_read
2553 on object for static data members.
2555 2010-06-04 Jakub Jelinek <jakub@redhat.com>
2556 Jason Merrill <jason@redhat.com>
2559 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
2560 with the same type, call mark_lvalue_use on both.
2562 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
2564 * class.c (struct vtbl_init_data_s): Remove last_init field.
2565 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
2567 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
2569 (build_vtt): Likewise.
2570 (initialize_vtable): Take a VEC instead of a tree.
2571 (build_vtt_inits): Change return type to void. Take a VEC **
2572 instead of a tree *; accumulate results into said VEC.
2573 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
2574 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
2575 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
2577 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
2578 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
2580 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
2581 rather than tree_cons.
2582 (build_vbase_offset_vtbl_entries): Likewise.
2583 (add_vcall_offset): Likewise.
2584 (build_rtti_vtbl_entries): Likewise.
2585 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
2586 * decl.c (initialize_artificial_var): Use build_constructor instead
2587 of build_constructor_from_list.
2589 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
2592 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
2595 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
2597 * parser.c (cp_parser_mem_initializer_list): Change error text.
2599 2010-06-02 Jakub Jelinek <jakub@redhat.com>
2601 * cp-objcp-common.c (shadowed_var_for_decl): Change into
2602 tree_decl_map hashtab from tree_map.
2603 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2604 (init_shadowed_var_for_decl): Adjust initialization.
2607 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2608 instead of calling mark_exp_read only when not an assignment.
2611 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2612 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2613 Set DECL_VALUE_EXPR on var.
2615 2010-06-02 Jason Merrill <jason@redhat.com>
2617 * error.c (dump_type): Improve typedef handling.
2622 * name-lookup.c (same_entity_p): New.
2623 (ambiguous_decl): Multiple declarations of the same entity
2626 2010-06-01 Jason Merrill <jason@redhat.com>
2629 * call.c (add_list_candidates): Prefer the default constructor.
2630 (build_aggr_conv): Treat missing initializers like { }.
2631 * typeck2.c (process_init_constructor_record): Likewise.
2632 * init.c (expand_default_init): Use digest_init for
2633 direct aggregate initialization, too.
2635 * call.c (add_list_candidates): Split out...
2636 (build_user_type_conversion_1): ...from here.
2637 (build_new_method_call): And here.
2638 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2641 * call.c (build_list_conv): Set list-initialization flags properly.
2643 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2645 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2647 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2648 Matthew Gingell <gingell@adacore.com>
2650 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2651 * decl2.c: Include langhooks.h and c-ada-spec.h.
2652 (cpp_check, collect_source_refs, collect_ada_namespace,
2653 collect_all_refs): New functions.
2654 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2655 * lang-specs.h: Ditto.
2657 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2659 * cp-tree.h (cp_build_function_call_nary): Declare.
2660 * typeck.c (cp_build_function_call_nary): Define.
2661 * decl.c (register_dtor_fn): Use it instead of
2662 cp_build_function_call.
2663 (cxx_maybe_build_cleanup): Likewise.
2664 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2665 * except.c (do_get_exception_ptr): Likewise.
2666 (do_begin_catch): Likewise.
2667 (do_allocate_exception): Likewise.
2668 (do_free_exception): Likewise.
2669 (build_throw): Likewise. Use cp_build_function_call_vec instead
2670 of cp_build_function_call.
2671 (do_end_catch): Likewise.
2673 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2675 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2676 (struct cp_declarator): Move id_loc field up.
2678 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2680 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2681 this file is included before c-common.h. Define GCC_DIAG_STYLE
2682 before including diagnostic-core.h and toplev.h.
2683 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2684 * pt.c: Include cp-tree.h before c-common.h.
2686 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2688 * tree.c (c_register_addr_space): Add stub.
2690 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2692 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2695 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2697 Revert fix of PR c++/44188
2698 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2700 * tree.c (typedef_variant_p): Revert moving this definition to
2702 * decl.c (grokdeclarator): Revert naming typedef handling.
2704 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2706 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2707 * cp-lang.c: Don't include diagnostic.h
2708 * name-lookup.c: Include diagnostic-core.h instead of
2710 (cp_emit_debug_info_for_using): Use seen_error.
2711 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2712 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2713 * pt.c (iterative_hash_template_arg): Use seen_error.
2714 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2715 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2716 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2717 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2720 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2723 * cp-tree.h (typedef_variant_p): Move this declaration to
2725 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2726 * decl.c (grokdeclarator): Do not rename debug info of an
2727 anonymous tagged type named by a typedef.
2729 2010-05-27 Jason Merrill <jason@redhat.com>
2732 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2735 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2738 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2739 * class.c (layout_class_type): Likewise.
2740 * decl.c (finish_enum): Likewise.
2741 * mangle.c (write_builitin_type): Likewise.
2743 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2745 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2747 * decl.c (grokdeclarator): Handle __int128.
2748 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2749 (cp_parser_simple_type_specifier): Likewise.
2750 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2751 * typeck.c (cp_common_type): Handle __int128.
2752 * mangle.c (integer_type_codes): Add itk_int128 and
2753 itk_unsigned_int128.
2755 2010-05-26 Jason Merrill <jason@redhat.com>
2758 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2761 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2763 * cp-lang.c: Do not include expr.h.
2765 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2767 * decl.c: Do not include rtl.h
2768 * semantics.c: Likewise.
2770 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2772 * cp-tree.h: Do not include splay-tree.h.
2773 (struct prtmem_cst): Remove unused field and false comment.
2774 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2775 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2776 * init.c: Do not include rtl.h and expr.h.
2777 * class.c: Do not include rtl.h. Include splay-tree.h.
2778 (build_clone): Use plain NULL instead of NULL_RTX.
2779 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2780 included. Include splay-tree.h.
2781 * method.c: Do not include rtl.h and expr.h.
2782 (use_thunk): Use plain NULL instead of NULL_RTX.
2783 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2784 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2785 and target.h. Include splay-tree.h.
2786 * expr.c: Do not include rtl.h and expr.h.
2787 * pt.c: Do not include obstack.h and rtl.h.
2788 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2789 (tsubst_decl): Likewise.
2790 (instantiate_decl): Likewise.
2791 * semantics.c: Do not include exprt.h and debug.h. Explain why
2792 rtl.h has to be included.
2793 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2794 * call.c: Do not include rtl.h and expr.h.
2795 * search.c: Do not include obstack.h and rtl.h.
2796 * friend.c: Do not include rtl.h and expr.h.
2797 * Make-lang.in: Update dependencies.
2799 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2802 * parser.c (non_integral_constant): Add NIC_NONE.
2803 (required_token): Add RT_NONE.
2804 (cp_parser_unary_expression): Initialize non_constant_p
2806 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2807 (cp_parser_primary_expression, cp_parser_postfix_expression,
2808 cp_parser_cast_expression, cp_parser_binary_expression,
2809 cp_parser_functional_cast): Fix formatting.
2811 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2814 * parser.c: Remove inclusion of dyn-string.h.
2815 (non_integral_constant): New enum.
2816 (name_lookup_error): New enum.
2817 (required_token): New enum.
2818 (cp_parser_required_error): New function.
2819 (cp_parser_require): Change the type of variable token_desc to
2820 required_token and use cp_parser_required_error.
2821 (cp_parser_require_keyword): Likewise.
2822 (cp_parser_error): Use gmsgid as parameter.
2823 (cp_parser_name_lookup_error): Change the type of variable desired to
2824 name_lookup_error and put the diagnostic in the full sentences. Change
2826 (cp_parser_non_integral_constant_expression): Change the type of the
2827 variable thing to non_integral_constant and put the diagnostics in
2828 full sentences. Change caller.
2830 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2833 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2835 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2837 * error.c (cp_diagnostic_starter): Update call to
2838 diagnostic_build_prefix.
2839 (cp_print_error_function,
2840 print_instantiation_partial_context_line): Check show_column flag
2843 2010-05-24 Jason Merrill <jason@redhat.com>
2846 * decl.c (check_initializer): Don't wrap an init-list in a
2848 * init.c (build_aggr_init): Don't assume copy-initialization if
2849 init has CONSTRUCTOR_IS_DIRECT_INIT.
2850 * call.c (build_new_method_call): Sanity check.
2852 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2854 * rtti.c (tinfo_base_init): Use build_constructor instead of
2855 build_constructor_from_list. Don't cons a tree node for
2857 (generic_initializer): Use build_constructor_single instead of
2858 build_constructor_from_list.
2859 (ptr_initializer): Use build_constructor instead of
2860 build_constructor_from_list
2861 (ptm_initializer): Likewise.
2862 (class_initializer): Likewise. Take varargs instead of TRAIL.
2863 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2864 build_constructor instead of build_constructor_from_list.
2866 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2868 * semantics.c: Include bitmap.h.
2869 * Make-lang.in: Update dependencies.
2871 2010-05-22 Jan Hubicka <jh@suse.cz>
2873 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2875 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2877 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2879 * cxx-pretty-print.c: Correct merge error.
2881 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2883 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2884 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2885 (cp_printer): Handle %K here using percent_K_format.
2886 * cxx-pretty-print.c: Include tree-pretty-print.h.
2887 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2890 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2892 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2893 Clean up redundant includes.
2895 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2898 * decl.c (xref_basetypes): Return false in case of ill-formed
2901 2010-05-19 Jason Merrill <jason@redhat.com>
2903 * call.c (reference_binding): Use cp_build_qualified_type_real
2904 and cp_type_quals consistently.
2905 (add_function_candidate): Likewise.
2906 (build_conditional_expr): Likewise.
2907 (convert_like_real): Likewise.
2908 (type_passed_as): Likewise.
2909 * class.c (add_method): Likewise.
2910 (same_signature_p): Likewise.
2911 (layout_class_type): Likewise.
2912 * decl.c (cxx_init_decl_processing): Likewise.
2913 (cp_fname_init): Likewise.
2914 (grokdeclarator): Likewise.
2915 * decl2.c (cp_reconstruct_complex_type): Likewise.
2916 * init.c (build_new_1): Likewise.
2917 * method.c (do_build_copy_constructor): Likewise.
2918 (implicitly_declare_fn): Likewise.
2919 * pt.c (tsubst_aggr_type): Likewise.
2921 * rtti.c (init_rtti_processing): Likewise.
2922 (build_headof): Likewise.
2923 (build_dynamic_cast_1): Likewise.
2924 (tinfo_base_init): Likewise.
2925 (emit_support_tinfos): Likewise.
2926 * semantics.c (capture_decltype): Likewise.
2927 * tree.c (cv_unqualified): Likewise.
2928 * typeck.c (composite_pointer_type): Likewise.
2929 (string_conv_p): Likewise.
2931 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2933 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2934 * decl.c (start_decl): Likewise.
2935 * semantics.c (finish_compound_literal): Likewise.
2936 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2937 (cp_type_readonly): Remove.
2938 * cp-tree.h: Remove declaration.
2940 * typeck.c (merge_types): Preserve memfn quals.
2942 * decl.c (grokdeclarator): Don't check quals on fn type.
2943 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2944 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2947 * typeck.c (type_memfn_quals): New fn.
2948 (apply_memfn_quals): New fn.
2949 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2950 (cp_type_readonly): Use cp_type_quals.
2951 * cp-tree.h: Add declarations.
2952 * tree.c (cp_build_qualified_type_real): Don't set, but do
2953 preserve, quals on FUNCTION_TYPE.
2954 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2955 * decl.c (build_ptrmem_type): Likewise.
2956 (grokdeclarator): Likewise.
2957 (static_fn_type): Likewise.
2958 * decl2.c (change_return_type): Likewise.
2959 (cp_reconstruct_complex_type): Likewise.
2960 * pt.c (tsubst_function_type): Likewise.
2962 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2964 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2966 * tree.c (build_min_non_dep_call_vec): Update comment.
2968 2010-05-17 Jason Merrill <jason@redhat.com>
2970 * call.c (struct z_candidate): Add explicit_targs field.
2971 (add_template_candidate_real): Set it.
2972 (build_over_call): Use it to control init-list warning.
2975 * call.c (build_over_call): Limit init-list deduction warning to
2976 cases where the argument is actually an init-list.
2979 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2981 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2982 Jason Merrill <jason@redhat.com>
2985 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2987 2010-05-15 Jason Merrill <jason@redhat.com>
2989 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2990 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2992 (finish_eh_spec_block): Adjust.
2994 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2997 * pt.c (tsubst): Unshare template argument.
2999 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
3001 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
3002 * Make-lang.in: Fix dependencies accordingly.
3004 2010-05-14 Jason Merrill <jason@redhat.com>
3007 * except.c (build_throw): Simplify, adjust for DR 475.
3010 * except.c (dtor_nothrow): Return nonzero for type with
3014 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
3015 gimple_build_eh_must_not_throw.
3017 2010-05-14 Martin Jambor <mjambor@suse.cz>
3019 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
3022 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
3024 * call.c (build_new_method_call): Change warning text.
3025 * typeck2.c (build_functional_cast): Change error text.
3027 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
3030 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
3031 shadowing the outer parameter or variables by the declaration of
3032 nested function in nested structure or class. Warn the shadowing by
3033 the declaration of nested lambda expression.
3035 2010-05-13 Jason Merrill <jason@redhat.com>
3037 * typeck.c (cp_build_array_ref): Factor out from...
3038 (build_array_ref): ...here. Drop complain parm.
3039 (build_new_op): Adjust.
3040 * class.c (build_vtbl_ref_1): Adjust.
3041 * decl2.c (grok_array_decl): Adjust.
3042 * cp-tree.h: Adjust prototypes.
3044 2010-05-13 Jan Hubicka <jh@suse.cz>
3046 * decl.c (cp_finish_decl): Do not worry about used attribute.
3048 2010-05-12 Jason Merrill <jason@redhat.com>
3050 * typeck.c (build_array_ref): Take complain parm.
3051 * cp-tree.h: Add it to prototype.
3052 * call.c (build_new_op): Pass it.
3053 * class.c (build_vtbl_ref): Pass it.
3054 * decl2.c (grok_array_decl): Pass it.
3058 * cp-tree.def (NULLPTR_TYPE): Remove.
3059 * cp-tree.h (NULLPTR_TYPE_P): New.
3060 (SCALAR_TYPE_P): Use it.
3061 (nullptr_type_node): New.
3062 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
3063 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
3065 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
3066 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
3067 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
3068 * mangle.c (write_type): Likewise.
3069 * name-lookup.c (arg_assoc_type): Likewise.
3070 * typeck.c (build_reinterpret_cast_1): Likewise.
3071 * rtti.c (typeinfo_in_lib_p): Likewise.
3072 (emit_support_tinfos): Remove local nullptr_type_node.
3074 * cp-tree.h (UNKNOWN_TYPE): Remove.
3075 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
3076 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
3077 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
3078 * class.c (instantiate_type): Check unknown_type_node rather than
3080 * name-lookup.c (maybe_push_decl): Likewise.
3081 * rtti.c (get_tinfo_decl_dynamic): Likewise.
3082 (get_typeid): Likewise.
3083 * semantics.c (finish_offsetof): Likewise.
3086 * call.c (add_template_candidate_real): If deduction fails, still
3087 add the template as a non-viable candidate.
3088 (equal_functions): Handle template candidates.
3089 (print_z_candidate): Likewise.
3090 (print_z_candidates): Likewise.
3091 (build_new_function_call): Likewise.
3093 * cp-tree.h (LOOKUP_LIST_ONLY): New.
3094 * call.c (add_candidates): Enforce it.
3095 (build_new_method_call): Try non-list ctor if no viable list ctor.
3096 (build_user_type_conversion_1): Likewise.
3098 * call.c (add_candidates): Distinguish between type(x) and
3100 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
3101 (build_new_method_call): Give better error for conversion op.
3103 * call.c (add_candidates): Add first_arg and return_type parms.
3104 Add special constructor/conversion op handling.
3105 (convert_class_to_reference): Use it.
3106 (build_user_type_conversion_1): Likewise.
3107 (build_op_call): Likewise.
3108 (build_new_method_call): Likewise.
3109 (build_new_op): Adjust.
3110 (perform_overload_resolution): Adjust.
3112 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
3117 * pt.c (process_partial_specialization): Return error_mark_node
3118 in case of unused template parameters in partial specialization.
3120 2010-05-11 Jakub Jelinek <jakub@redhat.com>
3123 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
3124 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
3125 look at its second operand.
3127 2010-05-10 Jason Merrill <jason@redhat.com>
3130 * semantics.c (baselink_for_fns): Revert earlier change.
3133 * typeck.c (cp_build_modify_expr): Complain about assignment to
3134 array from init list.
3136 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
3139 * decl.c (check_initializer): strip array type before checking for
3140 uninitialized const or ref members.
3142 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
3145 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
3146 error count. Emit errors only if compain is true.
3147 (build_new_1): Do not return error_mark_node if
3148 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
3149 errors. Delay the check for user-provided constructor.
3150 (perform_member_init): Adjust.
3151 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
3154 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
3155 Jason Merrill <jason@redhat.com>
3157 Add support for C++0x nullptr.
3158 * cp-tree.def: Add NULLPTR_TYPE.
3159 * cp-tree.h: Add nullptr_node.
3160 (cp_tree_index): Add CPTI_NULLPTR.
3161 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
3162 * call.c (null_ptr_cst_p): Handle nullptr.
3163 (standard_conversion): Likewise.
3164 (convert_arg_to_ellipsis): Likewise.
3165 * mangle.c (write_type): Likewise.
3166 * name-lookup.c (arg_assoc_type): Likewise.
3167 * parser.c (cp_parser_primary_expression): Likewise.
3168 * typeck.c (cp_build_binary_op): Likewise.
3169 (build_reinterpret_cast_1): Likewise.
3170 * error.c (dump_type): Likewise.
3171 (dump_type_prefix, dump_type_suffix): Likewise.
3172 * decl.c (cxx_init_decl_processing): Likewise.
3173 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
3174 * cvt.c (ocp_convert): Likewise.
3175 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
3176 nullptr_t tinfo in libsupc++.
3178 2010-05-06 Jason Merrill <jason@redhat.com>
3180 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
3182 2010-04-22 Jakub Jelinek <jakub@redhat.com>
3183 Dodji Seketeli <dodji@redhat.com>
3186 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
3188 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
3189 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
3190 (decay_conversion, perform_integral_promotions): Call rvalue_use.
3191 (cp_build_unary_op): Call lvalue_use.
3192 * decl.c (unused_but_set_errorcount): New variable.
3193 (poplevel): Issue -Wunused-but-set-variable diagnostics.
3194 (duplicate_decls): Merge DECL_READ_P flags.
3195 (start_cleanup_fn): Set DECL_READ_P flag.
3196 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
3197 * tree.c (rvalue): Call rvalue_use.
3198 * pt.c (convert_nontype_argument): Likewise.
3199 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
3200 finish_decltype_type): Likewise.
3201 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
3202 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
3203 or rvalue_use depending on the expr.
3204 * init.c (build_new, build_delete): Likewise.
3205 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
3207 2010-05-05 Jason Merrill <jason@redhat.com>
3210 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
3211 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
3213 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
3216 * pt.c (unify): Check each elt for error_mark_node.
3218 2010-05-04 Jason Merrill <jason@redhat.com>
3221 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
3223 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
3226 * call.c (build_new_method_call): Return error_mark_node if fns is
3229 2010-05-03 Dodji Seketeli <dodji@redhat.com>
3232 * pt.c (most_specialized_class): Pretend we are processing
3233 a template decl during the call to coerce_template_parms.
3235 2010-05-03 Jason Merrill <jason@redhat.com>
3239 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
3240 from the selected underlying type unless -fstrict-enums. Set
3241 ENUM_UNDERLYING_TYPE to have the restricted range.
3242 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
3243 * class.c (check_bitfield_decl): Likewise.
3245 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
3248 * init.c (build_new_1): Revert the accidental checkin in
3251 2010-04-30 Jason Merrill <jason@redhat.com>
3254 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
3255 (pp_cxx_type_specifier_seq): ...here.
3257 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
3259 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
3260 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
3262 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
3265 * typeck.c (warn_args_num): New function.
3266 (convert_arguments): Use warn_args_num to print the diagnostic
3269 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
3272 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
3273 user-provided constructor while recursing.
3275 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
3278 * error.c (print_instantiation_partial_context_line): Handle
3279 recursive instantiation.
3280 (print_instantiation_partial_context): Likewise.
3282 2010-04-27 Jason Merrill <jason@redhat.com>
3284 * init.c (perform_member_init): Check CLASS_TYPE_P.
3286 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
3289 * init.c (perform_member_init): check for uninitialized const or
3290 reference members, including array types.
3292 2010-04-24 Jason Merrill <jason@redhat.com>
3294 * tree.c (get_fns): Split out from get_first_fn.
3295 * cp-tree.h: Declare it.
3296 * search.c (shared_member_p): Use it.
3297 * semantics.c (finish_qualified_id_expr): Simplify.
3298 (finish_id_expression): Simplify.
3300 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
3301 whenever object is NULL_TREE. Don't do 'this' capture here.
3302 (finish_qualified_id_expr): Pass NULL_TREE.
3303 (finish_id_expression): Likewise.
3304 (lambda_expr_this_capture): Likewise.
3306 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
3307 rather than checking current_class_ref directly.
3308 (finish_call_expr): Likewise.
3311 * name-lookup.c (qualify_lookup): Disqualify lambda op().
3312 * class.c (current_nonlambda_class_type): New fn.
3313 * semantics.c (nonlambda_method_basetype): New.
3314 * cp-tree.h: Declare them.
3315 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
3317 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
3320 * semantics.c (lambda_return_type): Complain about
3324 * tree.c (cv_unqualified): Handle error_mark_node.
3327 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
3328 if we don't want errors.
3331 * class.c (convert_to_base): Add complain parameter. Pass
3332 ba_quiet to lookup_base if we don't want errors.
3333 (build_vfield_ref): Pass complain to convert_to_base.
3334 * call.c (convert_like_real): Likewise.
3335 (initialize_reference): Likewise.
3336 (perform_direct_initialization_if_possible): Pass complain to
3338 * cp-tree.h: Adjust.
3340 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
3341 Jason Merrill <jason@redhat.com>
3344 * decl.c (check_for_uninitialized_const_var): Handle classes that need
3346 (check_initializer): Call it for classes that need constructing, too.
3347 * class.c (in_class_defaulted_default_constructor): New.
3348 * cp-tree.h: Declare it.
3350 2010-04-20 Jason Merrill <jason@redhat.com>
3353 * init.c (constant_value_1): Treat error_mark_node as a constant
3354 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
3355 * cvt.c (ocp_convert): Handle getting error_mark_node from
3356 integral_constant_value.
3357 * decl.c (compute_array_index_type): Likewise.
3359 2010-04-20 Dodji Seketeli <dodji@redhat.com>
3363 * typeck.c (incompatible_dependent_types_p): If one of the
3364 compared types if not a typedef then honour their main variant
3367 2010-04-20 Jakub Jelinek <jakub@redhat.com>
3369 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
3371 2010-04-19 Dodji Seketeli <dodji@redhat.com>
3374 * typeck.c (structural_comptypes): Test dependent typedefs
3375 incompatibility before testing for their main variant based
3378 2010-04-19 Jakub Jelinek <jakub@redhat.com>
3380 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
3381 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
3383 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
3385 * decl.c (cxx_init_decl_processing): Remove second argument in call to
3386 build_common_tree_nodes.
3388 2010-04-14 Jason Merrill <jason@redhat.com>
3391 * parser.c (cp_parser_parenthesized_expression_list): Change
3392 is_attribute_list parm to int to indicate whether or not to
3393 handle initial identifier specially.
3394 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
3396 2010-04-13 Jason Merrill <jason@redhat.com>
3398 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
3400 * parser.c (cp_parser_lambda_expression): Complain about lambda in
3401 unevaluated context.
3402 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
3404 2010-04-12 Jason Merrill <jason@redhat.com>
3407 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
3408 return value directly.
3410 * call.c (type_decays_to): Call cv_unqualified for non-class type.
3412 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
3415 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
3416 * init.c (build_new_1): Check for uninitialized const members and
3417 uninitialized reference members, when using new without
3418 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
3419 (diagnose_uninitialized_cst_or_ref_member): Define, call
3420 diagnose_uninitialized_cst_or_ref_member_1.
3421 (diagnose_uninitialized_cst_or_ref_member_1): New function.
3423 2010-04-12 Richard Guenther <rguenther@suse.de>
3426 * semantics.c (expand_or_defer_fn_1): Do not keep extern
3427 template inline functions.
3429 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3432 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
3435 2010-04-07 Jason Merrill <jason@redhat.com>
3438 * decl.c (start_preparsed_function): Do defer nested functions.
3440 PR c++/11094, DR 408
3441 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
3442 * decl2.c (finish_static_data_member_decl): Set it.
3443 * decl.c (duplicate_decls): Propagate it.
3444 * pt.c (tsubst_decl): Don't substitute the domain of an array
3445 VAR_DECL if it's set.
3446 (regenerate_decl_from_template): Substitute it here.
3447 (type_dependent_expression_p): Return true if it's set.
3448 * semantics.c (finish_decltype_type): Instantiate such a variable.
3449 * typeck.c (cxx_sizeof_expr): Likewise.
3450 (strip_array_domain): New.
3453 * name-lookup.c (current_decl_namespace): Non-static.
3454 (pop_nested_namespace): Sanity check.
3455 * cp-tree.h: Declare current_decl_namespace.
3456 * decl.c (grokvardecl): Use it instead of current_namespace.
3457 (grokfndecl): Likewise.