1 2010-12-01 Joseph Myers <joseph@codesourcery.com>
3 * cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h.
4 * Make-lang.in (cp/lex.o, cp/cp-objcp-common.o, cp/typeck2.o):
7 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com>
9 * decl.c (finish_function): Call objc_finish_function when
10 compiling Objective-C++.
11 * call.c (standard_conversion): Do not call
12 objc_non_volatilized_type().
13 (implicit_conversion): Same change.
14 * typeck.c (comp_ptr_ttypes_real): Same change.
16 2010-11-30 Joseph Myers <joseph@codesourcery.com>
18 * cp-gimplify.c, cp-lang.c, cvt.c, cxx-pretty-print.c, error.c,
19 except.c, expr.c, friend.c, init.c, mangle.c, name-lookup.c,
20 optimize.c, parser.c, rtti.c, tree.c, typeck2.c: Don't include
22 * Make-lang.in: Dependencies for above files changed to remove
25 2010-11-29 Dodji Seketeli <dodji@redhat.com>
28 * call.c (add_builtin_candidate): At this point the resulting type
29 of an indirection operator should be complete.
31 2010-11-29 Dodji Seketeli <dodji@redhat.com>
34 Reverted patch for PR c++/42260
35 * cp-tree.h (lookup_conversions): Reverted "Add new bool parameter to
37 * search.c (lookup_conversion): Reverted "Use new bool parameter in
39 * call.c (add_builtin_candidates): Reverted "Don't lookup template
41 (convert_class_to_reference, build_user_type_conversion_1,
42 build_op_call): Reverted "Adjust".
43 * cvt.c (build_expr_type_conversion): Reverted "Likewise".
45 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
47 * parser.c (cp_parser_objc_try_catch_finally_statement): Parse
48 @catch(...) and pass NULL_TREE to objc_begin_catch_clause() in
49 that case. Improved error recovery. Reorganized code to be
50 almost identical to c_parser_objc_try_catch_finally_statement.
52 2010-11-27 Nicola Pero <nicola.pero@meta-innovation.com>
55 * decl.c (grokdeclarator): Replaced an assert (for a case that can
56 never happen in C++, but could happen in ObjC++ for invalid code)
57 with a check that prints an error message and returns
60 2010-11-23 Jeffrey Yasskin <jyasskin@google.com>
63 * pt.c (instantiate_decl): Propagate the template's location to
66 2010-11-20 Joseph Myers <joseph@codesourcery.com>
68 * name-lookup.c (handle_namespace_attrs): Don't check
69 HANDLE_PRAGMA_VISIBILITY.
70 * parser.c (cp_parser_namespace_definition): Don't check
71 HANDLE_PRAGMA_VISIBILITY.
73 2010-11-20 Nathan Froyd <froydnj@codesourcery.com>
78 * parser.c (cp_lexer_set_token_position): New function.
79 (cp_lexer_previous_token_position): New function.
80 (cp_lexer_previous_token): Call it.
81 (cp_parser_class_specifier): Try to gracefully handle a missing
84 2010-11-20 Jakub Jelinek <jakub@redhat.com>
87 * decl.c (cp_make_fname_decl): Return error_mark_node if
88 current_binding_level has already sk_function_parms kind.
91 * semantics.c (cxx_eval_call_expression): Unshare the result.
93 2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com>
95 * parser.c (cp_parser_objc_protocol_declaration): Pass attributes
96 to objc_declare_protocols.
98 2010-11-18 Nathan Froyd <froydnj@codesourcery.com>
101 * typeck.c (cp_build_unary_op): Call build_real_imag_expr for
102 REALPART_EXPR and IMAGPART_EXPR.
104 2010-11-16 Jason Merrill <jason@redhat.com>
106 * call.c (convert_like_real): Don't make a temp for copy-list-init.
107 (build_over_call): Don't handle that here.
108 (build_new_method_call): Use COMPLETE_OR_OPEN_TYPE_P for error.
111 * call.c (build_over_call): Check for =delete even when trivial.
114 * decl.c (make_unbound_class_template): Handle using
115 injected-type-name as template.
117 2010-11-15 Nicola Pero <nicola.pero@meta-innovation.com>
119 * typeck.c (cp_build_unary_op): Use
120 objc_build_incr_expr_for_property_ref to build the pre/post
121 increment/decrement of an Objective-C property ref.
123 2010-11-13 Jason Merrill <jason@redhat.com>
125 * decl.c (cp_finish_decl): Use resolve_nondeduced_context for auto.
126 * init.c (build_new): Likewise.
127 * pt.c (tsubst_decl): Likewise.
128 (do_auto_deduction): Likewise.
129 (resolve_nondeduced_context): Use build_offset_ref and
132 2010-11-12 Joseph Myers <joseph@codesourcery.com>
134 * Make-lang.in (g++spec.o): Use $(OPTS_H).
136 2010-11-13 Ville Voutilainen <ville.voutilainen@gmail.com> <ville.voutilainen@symbio.com>
138 Core 1135, 1136, 1145, 1149
139 * method.c (defaultable_fn_check): Do not disallow defaulting a
140 non-public or explicit special member function on its first
143 2010-11-12 James Dennett <jdennett@google.com>
146 * typeck.c (build_static_cast_1): Convert to the target type
147 when doing static_cast<cv Derived*>(Base*).
149 2010-11-10 Jason Merrill <jason@redhat.com>
152 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: New case.
153 [CONSTRUCTOR]: Use the tsubsted type.
156 * semantics.c (cxx_eval_bit_field_ref): New.
157 (cxx_eval_constant_expression): Call it.
159 2010-11-10 Joseph Myers <joseph@codesourcery.com>
161 * cvt.c (cp_convert_to_pointer): Use %' in diagnostic.
162 * decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator):
163 Use %' in diagnostics.
164 * decl2.c (check_classfn): Use %' in diagnostic.
165 * init.c (build_java_class_ref): Use %' in diagnostic.
166 (build_delete): Remove trailing '.' from diagnostic.
167 * method.c (do_build_copy_assign, walk_field_subobs): Use %' in
169 * name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic.
170 * parser.c (cp_parser_exception_specification_opt): Remove
171 trailing '.' from diagnostic.
172 (cp_parser_objc_interstitial_code): Use %qs for quoting in
174 * pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in
176 * repo.c (reopen_repo_file_for_write): Use %' in diagnostic.
178 2010-11-10 Nathan Froyd <froydnj@codesourcery.com>
181 * decl.c (poplevel_named_label_1): Use TREE_CHAIN if necessary.
183 2010-11-09 Jakub Jelinek <jakub@redhat.com>
186 * tree.c (lvalue_kind): Don't crash if ref has NULL type.
188 2010-11-08 Jason Merrill <jason@redhat.com>
191 * semantics.c (check_constexpr_ctor_body): New fn.
192 * parser.c (cp_parser_ctor_initializer_opt_and_function_body): Call it.
193 * cp-tree.h: Declare it.
196 * tree.c (bot_manip): Check TREE_SIDE_EFFECTS as well.
198 Correct conversion/overflow behavior.
199 * cvt.c (ignore_overflows): Move here from typeck.c.
200 (ocp_convert): Use it.
201 (cp_fold_convert): Use it. Don't call rvalue.
202 * typeck.c (build_static_cast_1): Don't use it. Do call rvalue.
203 * error.c (location_of): Handle expressions, too.
204 * class.c (check_bitfield_decl): Set input_location around call to
206 * semantics.c (cxx_eval_outermost_constant_expr): Don't
207 print the expression if it already had TREE_OVERFLOW set.
208 (reduced_constant_expression_p): Check TREE_OVERFLOW_P for C++98, too.
209 (verify_constant): Allow overflow with a permerror if we're
211 (cxx_eval_outermost_constant_expr): Use verify_constant.
212 (adjust_temp_type): Use cp_fold_convert.
213 * decl.c (build_enumerator): Don't call constant_expression_warning.
214 * decl2.c (grokbitfield): Likewise.
216 2010-11-06 Jason Merrill <jason@redhat.com>
219 * init.c (perform_member_init): Use build_vec_init_expr for
220 value-init of arrays, too.
221 * cp-gimplify.c (cp_gimplify_expr): Use VEC_INIT_EXPR_VALUE_INIT.
222 * cp-tree.h (VEC_INIT_EXPR_IS_CONSTEXPR): New macro.
223 (VEC_INIT_EXPR_VALUE_INIT): New macro.
224 * semantics.c (potential_constant_expression): No longer static.
225 Check VEC_INIT_EXPR_IS_CONSTEXPR.
226 * tree.c (build_vec_init_expr): Handle value-init. Set
227 VEC_INIT_EXPR_IS_CONSTEXPR and VEC_INIT_EXPR_VALUE_INIT.
229 2010-11-06 Nathan Froyd <froydnj@codesourcery.com>
232 * parser.c (cp_lexer_previous_token): New function.
233 (cp_parser_member_declaration): Use previous token for error
234 messages. Assume semicolon presence rather than grovelling for
237 2010-11-06 Joern Rennecke <amylaar@spamcop.net>
240 * method.c (make_alias_for_thunk):
241 Use targetm.asm_out.generate_internal_label.
243 2010-11-05 Jason Merrill <jason@redhat.com>
246 * search.c (look_for_overrides): A constructor is never virtual.
248 2010-11-05 Jakub Jelinek <jakub@redhat.com>
251 * cp-gimplify.c (cp_gimplify_expr): Drop volatile MEM_REFs
252 on the RHS to avoid infinite recursion with gimplify_expr.
254 2010-11-05 Jason Merrill <jason@redhat.com>
257 * pt.c (tsubst_copy): Handle COMPLEX_CST.
259 2010-11-04 Nicola Pero <nicola.pero@meta-innovation.com>
261 Fixed using the Objective-C 2.0 dot-syntax with class names.
262 * parser.c (cp_parser_primary_expression): Recognize Objective-C
263 2.0 dot-syntax with class names and process it.
264 (cp_parser_nonclass_name): Recognize Objective-C 2.0 dot-syntax
266 (cp_parser_class_name): Same change.
267 (cp_parser_simple_type_specifier): Tidied comments.
269 2010-11-04 Jason Merrill <jason@redhat.com>
272 * semantics.c (build_constexpr_constructor_member_initializers):
273 Handle an enclosing STATEMENT_LIST.
275 * semantics.c (speculative_access_check): New.
276 * cp-tree.h: Declare it.
277 * call.c (build_over_call): Use it.
278 * class.c (type_has_constexpr_default_constructor): Use locate_ctor.
279 * method.c (locate_ctor): Use push/pop_deferring_access_checks.
281 2010-11-03 Jason Merrill <jason@redhat.com>
284 * semantics.c (build_data_member_initialization): Handle
285 value-init of aggregate empty base.
288 * call.c (can_convert_array): New fn.
289 (build_aggr_conv): Use it.
292 * semantics.c (build_constexpr_constructor_member_initializers):
295 2010-11-02 Dodji Seketeli <dodji@redhat.com>
297 * cp-tree.h (enum tsubst_flags)<tf_no_class_instantiations>:
299 * pt.c (tsubst): Remove the use of tf_no_class_instantiations.
301 2010-11-03 Jason Merrill <jason@redhat.com>
304 * init.c (expand_default_init): Avoid ICE if we can't figure out
305 which function is being called.
307 2010-11-02 Nathan Froyd <froydnj@codesourcery.com>
309 * class.c (build_base_path, add_vcall_offset): Use build_zero_cst
310 instead of fold_convert.
311 * init.c (build_zero_init): Likewise.
312 * typeck.c (cp_build_binary_op): Likewise.
314 2010-11-02 Dodji Seketeli <dodji@redhat.com>
318 * pt.c (check_valid_ptrmem_cst_expr): Add a complain parameter to
320 (convert_nontype_argument, convert_nontype_argument): Pass the
321 complain parameter down to check_valid_ptrmem_cst_expr.
323 2010-11-02 Dodji Seketeli <dodji@redhat.com>
326 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
327 (struct template_parm_index_s)<num_siblings>: New field.
328 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
329 (process_template_parm): Extend the API to accept the number of
330 template parms in argument.
331 (cp_set_underlying_type): Remove this.
332 * class.c (build_self_reference): Require canonical type equality
333 back on the self reference of class.
334 * decl2.c (grokfield): Require canonical type equality back on
335 typedef class fields.
336 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
337 equality back on typedefs.
338 * parser.c (cp_parser_template_parameter_list): Do not require
339 canonical type equality on dependent types created during template
341 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
342 (fixup_template_parm, fixup_template_parms): New private
344 (current_template_args): Declare this.
345 (process_template_parm): Pass the total number of template parms
346 to canonical_type_parameter.
347 (build_template_parm_index): Add a new argument to carry the total
348 number of template parms.
349 (reduce_template_parm_level, process_template_parm, make_auto):
351 (current_template_args): Fix this for template template
353 (tsubst_template_parm): Split out of ...
354 (tsubst_template_parms): ... this.
355 (reduce_template_parm_level): Don't loose
356 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
357 (template_parm_to_arg): Extracted this function from
358 current_template_args. Make it represent invalid template parms
359 with an error_mark_node instead of a LIST_TREE containing an
361 (current_template_args): Use template_parm_to_arg.
362 (dependent_template_arg_p): Consider an invalid template argument
364 (end_template_parm_list): Do not update template sibling parms
365 here anymore. Use fixup_template_parms instead.
366 (process_template_parm): Pass the number of template parms to
367 canonical_type_parameter.
368 (make_auto): Require structural equality on auto
369 TEMPLATE_TYPE_PARM for now.
370 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
371 using all the arguments deduced so far.
372 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
373 canonical_type_parameter.
374 * tree.c (cp_set_underlying_type): Remove.
375 * typeck.c (get_template_parms_of_dependent_type)
376 (incompatible_dependent_types_p): Remove.
377 (structural_comptypes): Do not call incompatible_dependent_types_p
379 (comp_template_parms_position): Re-organized. Take the length of
380 template parms list in account.
382 2010-11-01 Jason Merrill <jason@redhat.com>
384 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
385 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
386 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
387 of giving follow-on errors.
388 * error.c (maybe_print_constexpr_context): New.
389 (cp_diagnostic_starter): Call it.
390 * cp-tree.h: Declare cx_error_context.
392 * semantics.c (cxx_eval_constant_expression): Explain
393 unacceptable use of variable better.
395 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
396 Jason Merrill <jason@redhat.com>
398 * call.c (null_ptr_cst_p): Use maybe_constant_value.
399 (set_up_extended_ref_temp): Support constant initialization.
400 (initialize_reference): Adjust.
401 * class.c (check_bitfield_decl): Use cxx_constant_value.
402 * cvt.c (ocp_convert): Don't use integral_constant_value when
403 converting to class type.
404 * decl.c (finish_case_label): Use maybe_constant_value.
405 (build_init_list_var_init): Support constant initialization.
406 (check_initializer): Likewise. Reorganize.
407 (cp_finish_decl): Likewise.
408 (expand_static_init): Likewise.
409 (compute_array_index_type): Use maybe_constant_value.
411 (create_array_type_for_decl, grokdeclarator): Pass it.
412 (build_enumerator): Use cxx_constant_value.
413 * decl2.c (grokfield): Use maybe_constant_init.
414 * except.c (check_noexcept_r): Handle constexpr.
415 (build_noexcept_spec): Use maybe_constant_value.
416 * init.c (expand_default_init): Support constant initialization.
417 (build_vec_init): Likewise.
418 (constant_value_1): Adjust.
419 (build_new_1): Adjust.
420 * parser.c (cp_parser_constant_expression): Allow non-integral
422 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
423 (cp_parser_initializer_clause): Toss folded result if non-constant.
424 * pt.c (fold_decl_constant_value): Remove.
425 (convert_nontype_argument): Use maybe_constant_value. Give clearer
426 error about overflow.
427 (tsubst): Move array bounds handling into compute_array_index_type.
428 (value_dependent_expression_p): Handle constant CALL_EXPR.
429 (tsubst_decl): Don't set
430 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
431 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
432 (instantiate_decl): Here too.
433 * semantics.c (finish_static_assert): Use maybe_constant_value.
434 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
435 (potential_constant_expression): Use maybe_constant_value.
436 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
437 is potentially valid in C++0x.
438 * typeck2.c (store_init_value): Handle constant init.
439 (check_narrowing): Use maybe_constant_value.
440 (build_functional_cast): Set TREE_CONSTANT on literal T().
441 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
442 (LOOKUP_ALREADY_DIGESTED): New.
443 (compute_array_index_type): Adjust prototype.
445 * semantics.c (constexpr_call): New datatype.
446 (constexpr_call_table): New global table.
447 (constexpr_call_hash): New.
448 (constexpr_call_equal): Likewise.
449 (maybe_initialize_constexpr_call_table): Likewise.
450 (lookup_parameter_binding): Likewise.
451 (cxx_eval_builtin_function_call): Likewise.
452 (cxx_bind_parameters_in_call): Likewise.
453 (cxx_eval_call_expression): Likewise.
454 (cxx_eval_unary_expression): Likewise.
455 (cxx_eval_binary_expression): Likewise.
456 (cxx_eval_conditional_expression): Likewise.
457 (cxx_eval_array_reference): Likewise.
458 (cxx_eval_component_reference): Likewise.
459 (cxx_eval_logical_expression): Likewise.
460 (cxx_eval_object_construction): Likewise.
461 (cxx_eval_constant_expression): Likewise.
462 (cxx_eval_indirect_ref): Likewise.
463 (cxx_constant_value): Likewise.
464 (cxx_eval_bare_aggregate): Likewise.
465 (adjust_temp_type): New.
466 (reduced_constant_expression_p): New.
467 (verify_constant): New.
468 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
469 (cxx_eval_outermost_constant_expr): New.
470 (maybe_constant_value, maybe_constant_init): New.
471 (cxx_eval_constant_expression): Use them.
472 * pt.c (iterative_hash_template_arg): No longer static.
473 * cp-tree.h: Declare fns.
475 * cp-tree.h (register_constexpr_fundef): Declare.
476 * decl.c (maybe_save_function_definition): New.
477 (finish_function): Use it.
478 * semantics.c (constexpr_fundef): New datatype.
479 (constexpr_fundef_table): New global table.
480 (constexpr_fundef_equal): New.
481 (constexpr_fundef_hash): Likewise.
482 (retrieve_constexpr_fundef): Likewise.
483 (validate_constexpr_fundecl): Store in the table.
484 (build_data_member_initialization): New fn.
485 (build_constexpr_constructor_member_initializers): New.
486 (register_constexpr_fundef): Define.
487 (is_this_parameter): New.
488 (get_function_named_in_call): Likewise.
489 (get_nth_callarg): Likewise.
490 (check_automatic_or_tls): New.
491 (morally_constexpr_builtin_function_p): New.
492 (potential_constant_expression): New.
494 2010-11-01 Jason Merrill <jason@redhat.com>
496 * decl2.c (decl_constant_var_p): New fn.
497 (decl_maybe_constant_var_p): New fn.
498 (mark_used): Rework instantiation of things needed for constant
500 * cp-tree.h: Declare new fns.
501 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
502 (always_instantiate_p): Use decl_maybe_constant_var_p.
503 (instantiate_decl): Don't defer constexpr functions.
504 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
505 * semantics.c (finish_id_expression): Use decl_constant_var_p.
506 Check for valid name in constant expr after mark_used.
508 2010-10-31 Jason Merrill <jason@redhat.com>
510 * class.c (is_really_empty_class): Work when type is not complete.
511 (synthesized_default_constructor_is_constexpr): New.
512 (add_implicitly_declared_members): Use it.
513 (type_has_constexpr_default_constructor): Likewise.
514 * cp-tree.h: Declare it.
515 * method.c (synthesized_method_walk): Use it.
517 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
518 * typeck.c (convert_for_assignment): Likewise.
520 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
521 message about constexpr without -std=c++0x.
523 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
526 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
528 * class.c (layout_vtable_decl): Call build_array_of_n_type.
529 (build_vtt, build_ctor_vtabl_group): Likewise.
531 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
533 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
534 * parser.c (cp_parser_objc_at_property_declaration): Removed
535 parsing of RID_COPIES and RID_IVAR. Updated call to
536 objc_add_property_declaration.
537 * typecheck.c (finish_class_member_access_expr): Call
538 objc_maybe_build_component_ref instead of objc_build_setter_call.
539 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
540 of objc_build_getter_call.
542 2010-10-27 Jason Merrill <jason@redhat.com>
544 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
545 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
546 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
547 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
548 (cp_parser_trait_expr): Likewise.
550 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
551 Jason Merrill <jason@redhat.com>
553 * decl.c (finish_case_label): Use decl_constant_value.
555 * method.c (synthesized_method_walk): Track constexprness too.
556 (process_subob_fn, walk_field_subobs): Likewise.
557 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
558 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
559 * class.c (add_implicitly_declared_members): Handle
560 constexpr default ctor.
562 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
563 Make sure a constexpr ctor has an empty body.
564 * class.c (type_has_constexpr_default_constructor): New.
565 * cp-tree.h: Declare it.
566 * init.c (perform_member_init): Complain about uninitialized
567 member in constexpr ctor.
568 (emit_mem_initializers): And uninitialized base.
569 * decl.c (check_tag_decl): Fix typo.
571 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
572 (is_valid_constexpr_fn): New fn.
573 (validate_constexpr_fundecl): Use it.
574 * decl.c (validate_constexpr_redeclaration): New.
575 (duplicate_decls): Use it.
576 (cp_finish_decl): Call validate_constexpr_fundecl and
577 ensure_literal_type_for_constexpr_object here.
578 (start_decl): Not here. Don't ICE on constexpr reference.
579 (check_for_uninitialized_const_var): Don't handle constexpr specially.
580 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
581 (check_static_variable_definition): Give friendly message about
583 (grokdeclarator): Complain about typedef and volatile with constexpr.
584 Reorganize. Give sorry about non-static data members in C++0x mode.
585 (start_preparsed_function): Check validate_constexpr_fundecl here.
586 (check_function_type): Not here.
587 * decl2.c (finish_static_data_member_decl): Don't complain about
589 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
590 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
591 (cp_parser_decl_specifier_seq): Handle it.
592 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
594 * class.c (check_bases): Propagate non-literality.
595 (check_field_decls): Likewise.
596 (finalize_literal_type_property): New.
597 (check_bases_and_members): Call it.
598 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
599 (lang_type_class): Add has_constexpr_ctor field.
600 (DECL_DECLARED_CONSTEXPR_P): Strip template.
601 * decl.c (grok_special_member_properties): Set
602 TYPE_HAS_CONSTEXPR_CTOR.
604 2010-10-27 Jason Merrill <jason@redhat.com>
606 * call.c (build_integral_nontype_arg_conv): New.
607 * cp-tree.h: Declare it.
608 * pt.c (convert_nontype_argument): Use it.
610 * error.c (dump_simple_decl): Print constexpr.
612 * cvt.c (build_up_reference): Use target_type for the temporary var.
614 * except.c (build_throw): Set EXPR_LOCATION.
616 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
618 * semantics.c (finish_compound_stmt): Avoid creating an
619 unnecessary BIND_EXPR.
621 * call.c (convert_like_real): Don't check narrowing if the element
622 is also an initializer-list.
624 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
626 * parser.c (cp_parser_objc_at_property_declaration): Recognize
627 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
628 Do not use objc_set_property_attr, but use local variables
629 instead. Detect repeated usage of setter, getter and ivar
630 attributes. Improved error processing when a setter name does not
631 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
632 that the token is a keyword. Updated call to
633 objc_add_property_declaration.
635 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
637 * parser.c (cp_parser_objc_property_decl): Renamed to
638 cp_parser_objc_struct_declaration. Return the parsed trees
639 instead of calling objc_add_property_variable directly. Detect
640 missing or invalid declspecs. Implemented attributes. Do not eat
641 the ';' at the end. Exit loop whenever a non-comma is parsed, not
643 (cp_parser_objc_at_property): Renamed to
644 cp_parser_objc_at_property_declaration. Updated calls to
645 objc_add_property_variable, now objc_add_property_declaration, and
646 to cp_parser_objc_property_decl, now
647 cp_parser_objc_struct_declaration. Rewritten all code to be more
648 robust in dealing with syntax errors, and almost identical to the
649 one in c_parser_objc_at_property_declaration.
650 (cp_parser_objc_property_attrlist): Removed.
651 (cp_parser_objc_method_prototype_list): Updated call to
652 cp_parser_objc_at_property.
653 (cp_parser_objc_method_definition_list): Same change.
654 (cp_parser_objc_class_ivars): Detect a number of invalid
655 declarations of instance variables and produce errors when they
658 2010-10-26 Jason Merrill <jason@redhat.com>
660 * tree.c (build_vec_init_expr): Split out from...
661 (build_array_copy): ...here.
662 * init.c (perform_member_init): Use it.
663 * cp-tree.h: Declare it.
664 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
665 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
666 (cp_gimplify_expr): Handle array default-initialization via
669 * tree.c (stabilize_expr): Handle xvalues properly.
671 * call.c (build_over_call): Use argarray[0] for 'this' argument.
673 * decl.c (finish_function): Don't look at function_depth.
675 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
677 Implement opaque-enum-specifiers for C++0x.
678 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
679 (OPAQUE_ENUM_P): New.
680 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
681 (start_enum): Update prototype.
682 (finish_enum_value_list): New prototype.
683 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
684 "enum class" is used in an elaborated-type-specifier.
685 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
686 * decl.c (copy_type_enum): New.
687 (finish_enum_value_list): New, with code from finish_enum.
688 (finish_enum): A lot of code removed. Added a gcc_assert.
689 (start_enum): Add parameters enumtype and is_new.
690 Rewrite to work with opaque-enum-specifiers.
691 * pt.c (maybe_process_partial_specialization): Allow for template
692 specialization of enumerations, with a pedwarn.
693 (lookup_template_class): Update call to start_enum. Call to
695 (tsubst_enum): Call to begin_scope, finish_scope and
696 finish_enum_value_list.
698 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
700 Removed Objective-C++ specific replacement of cxx_printable_name.
701 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
702 to cxx_printable_name for both C++ and Objective-C++.
703 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
705 * error.c (dump_decl): For Objective-C++, call
706 objc_maybe_printable_name here ...
707 * tree.c (cxx_printable_name_internal): ... instead of here.
709 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
711 * tree.c (cxx_printable_name_internal): In Objective-C++, call
712 objc_maybe_printable_name.
714 2010-10-22 Jason Merrill <jason@redhat.com>
717 * pt.c (instantiate_class_template): Don't instantiate default
721 * init.c (build_vec_init): Handle memberwise move.
723 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
726 * call.c (add_function_candidate): Don't use TREE_VALUE on null
729 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
731 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
732 bool instead of calling objc_set_method_type.
733 (cp_parser_objc_method_signature): Updated calls to
734 cp_parser_objc_method_type and to objc_build_method_signature.
735 (cp_parser_objc_method_prototype_list): Updated calls to
736 objc_add_method_declaration. Use token->type to determine if it
737 is a class method or not.
738 (cp_parser_objc_method_definition_list): Same change.
740 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
743 * parser.c (cp_convert_range_for): Call cp_finish_decl
744 instead of finish_expr_stmt.
746 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
748 * cp-lang.c (finish_file): Removed.
749 * decl2.c (cp_write_global_declarations): Call
750 objc_write_global_declarations when compiling Objective-C++.
752 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
755 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
756 (coerce_template_parms): Likewise for args.
758 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
760 Implemented parsing @synthesize and @dynamic for Objective-C++.
761 * parser.c (cp_parser_objc_method_definition_list): Recognize
762 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
763 (cp_parser_objc_at_dynamic_declaration): New.
764 (cp_parser_objc_at_synthesize_declaration): New.
766 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
768 * parser.c (cp_parser_objc_identifier_list): Check the return
769 value of cp_parser_identifier and react if it is error_mark_node.
771 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
773 Merge from apple/trunk branch on FSF servers.
775 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
778 * call.c (standard_conversion, implicit_conversion): Ignore
779 'volatile' attribute of artificially volatized type in objc when
780 evaluating various conversion weights.
782 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
785 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
786 artiificially 'volatized' type before doing pointer comparison.
788 2010-10-18 Jakub Jelinek <jakub@redhat.com>
791 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
794 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
796 Merge from apple/trunk branch on FSF servers.
798 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
801 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
802 objc object types if type is scope qualified.
804 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
806 Merge from apple/trunk branch on FSF servers.
808 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
811 * lex.c (unqualified_name_lookup_error): Issue diagnostic
812 for private 'ivar' access.
814 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
816 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
817 enum, and handle @package.
819 2010-10-15 Jason Merrill <jason@redhat.com>
822 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
823 with a different typedef variant of the element type.
825 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
827 merge from FSF apple 'trunk' branch.
828 2006 Fariborz Jahanian <fjahanian@apple.com>
830 Radars 4436866, 4505126, 4506903, 4517826
831 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
833 (cp_build_modify_expr): Likewise.
834 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
835 (cp_parser_objc_method_definition_list): Likewise.
836 (cp_parser_objc_property_decl): New.
837 (cp_parser_objc_property_attrlist): New.
838 (cp_parser_objc_at_property): New.
840 2010-10-14 Richard Guenther <rguenther@suse.de>
843 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
844 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
846 * error.c (dump_type): Handle NULLPTR_TYPE.
847 (dump_type_prefix): Likewise.
848 (dump_type_suffix): Likewise.
849 * mangle.c (write_type): Likewise.
850 * name-lookup.c (arg_assoc_type): Likewise.
851 * rtti.c (typeinfo_in_lib_p): Likewise.
852 * pt.c (tsubst): Likewise.
854 2010-10-13 Jason Merrill <jason@redhat.com>
857 * class.c (fixup_attribute_variants): New fn.
858 * cp-tree.h: Declare it.
859 * pt.c (instantiate_class_template): Call it.
860 * semantics.c (begin_class_definition): Call it.
862 2010-10-13 Richard Henderson <rth@redhat.com>
864 * cp-lang.c (cp_eh_personality): Update call to
865 build_personality_function.
866 * except.c (choose_personality_routine): Update function comment.
868 2010-10-13 Richard Guenther <rguenther@suse.de>
870 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
871 clear DECL_CHAIN of NAMESPACE_DECLs.
873 2010-10-11 Martin Jambor <mjambor@suse.cz>
876 * cp-tree.h (current_class_ref): Check that cp_function_chain is
878 * call.c (build_cxx_call): Likewise.
880 2010-10-10 Jason Merrill <jason@redhat.com>
882 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
883 (tsubst_default_arguments): Only do this once for cloned fns.
884 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
886 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
887 (tsubst_copy_and_build): Likewise.
888 (tsubst_initializer_list): Likewise.
889 (tsubst_copy): Change default to gcc_unreachable. Handle
890 OVERLOAD and PTRMEM_CST.
892 2010-10-10 Jason Merrill <jason@redhat.com>
896 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
898 2010-10-07 Andi Kleen <ak@linux.intel.com>
900 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
901 (cc1plus-dummy): Remove.
902 (cc1plus-checksum): Change to run checksum over object files
905 2010-10-08 Joseph Myers <joseph@codesourcery.com>
907 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
909 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
911 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
913 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
915 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
916 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
917 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
918 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
919 * parser.c (cp_parser_objc_encode_expression): Updated comment.
921 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
923 Merge from apple/trunk branch on FSF servers.
925 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
928 * parser.c (cp_parser_objc_interstitial_code): Recognize
929 and parse RID_NAMESPACE keyword.
931 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
933 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
934 finding ellipsis, before checking for attributes.
936 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
938 Merge from apple/trunk branch on FSF servers.
939 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
940 longer existing gcc/c-common.def.
942 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
945 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
946 * parser.c (cp_parser_objc_encode_expression): Build a templatized
947 parse tree for @encode(T).
949 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
952 * c-common.def: Add new expression code AT_ENCODE_EXPR.
954 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
957 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
958 code folding offsetof-like computations.
960 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
963 * parser.c (cp_parser_objc_class_interface): If no identifier
964 follows an @interface token, stop parsing the interface after
966 (cp_parser_objc_class_implementation): If no identifier follows an
967 @implementation token, stop parsing the implementation after
970 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
973 * parser.c (cp_parser_objc_method_keyword_params): If the required
974 colon is not found while parsing parameters, stop parsing them.
976 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
979 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
980 @end after detecting it. Print an error if @end is found without
982 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
983 detecting it. Fixed reading the next token when continuing
984 because of an error in a method signature. Print an error if EOF
985 is found without an '@end'.
986 (cp_parser_objc_method_definition_list): Same change.
988 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
990 Merge from apple/trunk branch on FSF servers:
992 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
995 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
996 method parameters and issue error.
997 (cp_parser_objc_method_definition_list): Check for invalid tokens
998 which cannot start a function definition.
1000 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
1003 * parser.c (cp_parser_objc_message_args): Check for missing message
1004 arguments and syntax error.
1006 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
1009 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
1012 2005-08-15 Ziemowit Laski <zlaski@apple.com>
1015 * parser.c (cp_parser_objc_interstitial_code): Catch stray
1016 '{' and '}' tokens and issue appropriate errors.
1018 2005-08-02 Ziemowit Laski <zlaski@apple.com>
1021 (cp_parser_statement_seq_opt): In addition to '}' and
1022 end-of-file, a statement sequence may also be terminated
1025 2010-10-05 Joseph Myers <joseph@codesourcery.com>
1027 * cp-tree.h (cxx_print_error_function,
1028 cxx_initialize_diagnostics): Declare using diagnostic_context
1031 2010-10-04 Andi Kleen <ak@linux.intel.com>
1033 * Make-lang.in (g++, cc1plus): Add + to build rule.
1035 2010-10-04 Jason Merrill <jason@redhat.com>
1037 * tree.c (decl_storage_duration): New.
1038 * cp-tree.h: Declare it.
1039 (duration_kind): Return values.
1041 2010-10-03 Jason Merrill <jason@redhat.com>
1043 * typeck.c (require_complete_type_sfinae): Add complain parm to...
1044 (require_complete_type): ...this function.
1045 (cp_build_array_ref, convert_arguments): Use it.
1046 (convert_for_initialization, cp_build_modify_expr): Likewise.
1047 * cp-tree.h: Declare it.
1048 * call.c (build_over_call): Use it.
1050 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
1052 merge from FSF 'apple/trunk' branch.
1053 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
1056 * cp/parser.c (cp_parser_objc_interstitial_code): For
1057 @optional/@required set the optional/required flag.
1059 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
1061 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
1062 and indentation when finding an Objective-C++ CPP_AT_NAME token.
1064 2010-09-29 Richard Guenther <rguenther@suse.de>
1066 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
1067 (CP_TYPE_CONTEXT): Similar.
1068 (FROB_CONTEXT): Frob global_namespace to the global
1069 TRANSLATION_UNIT_DECL.
1070 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
1071 set DECL_CONTEXT of global_namespace to it.
1072 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
1073 instead of zeroing context.
1074 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
1075 (grokfndecl): Likewise.
1076 (start_preparsed_function): Likewise.
1077 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
1078 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
1079 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
1080 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
1081 (push_template_decl_real): Likewise.
1082 (tsubst_friend_class): Likewise. Adjust context comparisons.
1083 (instantiate_class_template): Use CP_TYPE_CONTEXT.
1084 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
1085 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
1088 2010-09-29 Yao Qi <yao@codesourcery.com>
1090 * decl.c (get_atexit_node): Fix typo.
1092 2010-09-28 Jason Merrill <jason@redhat.com>
1094 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
1095 (real_lvalue_p): Take const_tree.
1096 * cp-tree.h: Adjust.
1097 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
1098 (cp_build_addr_expr_1): Likewise.
1100 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
1102 Partially merged from apple/trunk branch on FSF servers:
1103 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
1104 Radar 3803157 (method attributes)
1106 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
1107 (cp_parser_objc_method_tail_params_opt): Likewise.
1108 (cp_parser_objc_method_signature): Likewise.
1109 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
1110 (cp_parser_objc_method_prototype_list): Handle attributes.
1111 (cp_parser_objc_method_definition_list): Likewise.
1113 2010-09-28 Richard Henderson <rth@redhat.com>
1115 * cp-lang.c: Include "target.h".
1116 (cp_eh_personality): Use targetm.except_unwind_info.
1117 * Make-lang.in (cp-lang.o): Update deps.
1119 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
1121 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
1122 (cp_parser_declaration): Parse prefix attributes for ObjC++.
1123 (cp_parser_objc_protocol_declaration): Handle attributes.
1124 (cp_parser_objc_class_interface): Likewise.
1125 (cp_parser_objc_declaration): Likewise.
1127 2010-09-27 Jason Merrill <jason@redhat.com>
1129 Require lvalues as specified by the standard.
1130 * typeck.c (lvalue_or_else): Use real_lvalue_p.
1131 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
1132 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
1133 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
1134 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
1135 (build_const_cast_1): Adjust.
1136 * cp-tree.h: Declare new fns.
1137 * call.c (build_this, convert_like_real, build_over_call): Adjust.
1138 (initialize_reference): Adjust.
1139 * class.c (build_base_path, convert_to_base_statically): Adjust.
1140 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
1141 * cvt.c (build_up_reference, convert_to_reference): Adjust.
1142 * decl.c (register_dtor_fn): Adjust.
1143 * decl2.c (build_offset_ref_call_from_tree): Adjust.
1144 * except.c (initialize_handler_parm): Adjust.
1145 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
1146 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
1147 * tree.c (stabilize_expr): Adjust.
1149 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
1151 Merge from apple/trunk branch on FSF servers:
1153 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
1156 * typeck.c (composite_pointer_type): Call objc_have_common_type
1157 when comparing two objective-c pointer types.
1159 2005-07-18 Ziemowit Laski <zlaski@apple.com>
1162 * call.c (standard_conversion): Do not issue warnings when
1163 comparing ObjC pointer types.
1165 2005-06-22 Ziemowit Laski <zlaski@apple.com>
1168 * call.c (standard_conversion): Allow for a pointer conversion
1169 between any two ObjC pointer types.
1170 * typeck.c (composite_pointer_type): Determine common type
1171 for two ObjC pointer types.
1173 2010-09-24 Jan Hubicka <jh@suse.cz>
1175 * decl.c (finish_function): Use decl_replaceable_p
1176 * method.c (make_alias_for_thunk): Update call of
1177 cgraph_same_body_alias.
1179 2010-09-24 Jason Merrill <jason@redhat.com>
1181 * decl.c (compute_array_index_type): Remember type dependence of
1183 * pt.c (dependent_type_p_r): Don't recompute it here.
1185 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
1186 reference and pointer to the same type as "*" or "&".
1188 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
1190 * typeck.c (warn_args_num): Use warning 'too many arguments to
1191 method [methodname]' for an Objective-C method instead of the less
1192 satisfactory 'too many arguments to function' (with no method
1195 2010-09-21 Jason Merrill <jason@redhat.com>
1197 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
1198 special handling if we know the member.
1200 2010-09-18 Jason Merrill <jason@redhat.com>
1202 * call.c (compare_ics): Do lvalue/rvalue reference binding
1203 comparison for ck_list, too.
1205 2010-09-15 Jason Merrill <jason@redhat.com>
1207 * semantics.c (finish_id_expression): Diagnose use of function
1208 parms in evaluated context outside function body.
1210 * decl2.c (grokbitfield): Diagnose non-integral width.
1212 * call.c (convert_like_real): Use the underlying type of the
1213 reference for the temporary.
1215 2010-09-15 Jakub Jelinek <jakub@redhat.com>
1218 * class.c (build_vtbl_initializer): Use fn instead of init's operand
1219 as first argument to FDESC_EXPR.
1221 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
1224 * decl.c (grokdeclarator): Check build_memfn_type return value
1225 for error_mark_node.
1227 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1229 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
1230 (begin_range_for_stmt): Likewise.
1232 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
1234 Implement range-based for-statements.
1235 * cp-tree.def (RANGE_FOR_STMT): New.
1236 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
1237 (cp_convert_range_for): Declare.
1238 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
1239 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
1240 * semantics.c (begin_range_for_stmt): New.
1241 (finish_range_for_decl): New.
1242 (finish_for_stmt): Accept also RANGE_FOR_STMT.
1243 (perform_koenig_lookup): Add extra argument include_std.
1244 * parser.c (cp_parser_c_for): New with code from
1245 cp_parser_iteration_statement().
1246 (cp_parser_range_for): New.
1247 (cp_convert_range_for): New.
1248 (cp_parser_iteration_statement): Add range-for support.
1249 (cp_parser_condition): Adjust comment.
1250 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
1252 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
1253 * cxx-pretty-print.c: Likewise.
1254 * lex.c (cxx_init): Likewise.
1255 * name-lookup.c (lookup_function_nonclass): Add extra argument
1257 (lookup_arg_dependent): Likewise.
1258 * name-lookup.h: Likewise.
1260 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
1263 * error.c (maybe_warn_cpp0x): Add new warning
1264 CPP0X_INLINE_NAMESPACES.
1265 * parser.c (cp_parser_namespace_definition): Likewise.
1266 * cp-tree.h (cpp0x_warn_str): Likewise.
1268 2010-09-10 Richard Guenther <rguenther@suse.de>
1270 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
1271 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
1273 2010-09-10 Jan Hubicka <jh@suse.cz>
1275 PR tree-optimization/45605
1276 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
1279 2010-09-08 Jakub Jelinek <jakub@redhat.com>
1282 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
1283 before calling fold_decl_constant_value.
1285 2010-09-07 Arnaud Charlet <charlet@adacore.com>
1287 * cp-tree.h (build_enumerator): Add new location_t parameter.
1288 (build_lang_decl_loc): New function.
1289 * decl.c (build_enumerator): New parameter loc. Use it when calling
1290 build_decl. Replace build_lang_decl with build_lang_decl_loc.
1291 * pt.c (tsubst_enum): Adjust call to build_enumerator.
1292 * parser.c (cp_parser_enumerator_definition): Ditto.
1293 * lex.c (build_lang_decl_loc): New function.
1295 2010-09-06 Dodji Seketeli <dodji@redhat.com>
1300 * tree.c (strip_typedefs): Strip typedefs from the context of
1303 2010-09-06 Mark Mitchell <mark@codesourcery.com>
1305 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
1306 * call.c (build_conditional_expr): Likewise.
1307 (convert_arg_to_ellipsis): Likewise.
1309 2010-09-06 Arnaud Charlet <charlet@adacore.com>
1311 * parser.c (make_pointer_declarator, make_reference_declarator,
1312 make_call_declarator, make_array_declarator): Set declarator->id_loc.
1313 (cp_parser_init_declarator): Adjust location of decl if appropriate.
1315 2010-09-06 Jason Merrill <jason@redhat.com>
1317 * call.c (implicit_conversion): Fix value-init of enums.
1318 (convert_like_real): Likewise.
1320 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1322 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1323 (fold_non_dependent_expr): ...here.
1324 (convert_nontype_argument): Use it. Take complain parm.
1325 Use perform_implicit_conversion instead of ocp_convert.
1326 Allow cv-qual changes.
1327 (convert_template_argument): Pass complain down.
1328 (tsubst_template_arg): Suppress constant expression warnings.
1331 * method.c (synthesized_method_walk): In constructors, also check
1332 subobject destructors.
1334 * semantics.c (finish_compound_literal): Always build a
1337 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1340 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1342 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1345 * parser.c (cp_parser_omp_atomic): Handle boolean
1346 {PRE,POST}_INCREMENT.
1348 2010-08-29 Jason Merrill <jason@redhat.com>
1351 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1352 after tentative parsing.
1354 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1356 * Make-lang.in (g++spec.o): Update dependencies.
1357 * g++spec.c: Include opts.h
1358 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1359 (lang_specific_driver): Use cl_decoded_option structures.
1361 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1363 * call.c: Use FOR_EACH_VEC_ELT.
1364 * class.c: Likewise.
1366 * decl2.c: Likewise.
1367 * error.c: Likewise.
1368 * except.c: Likewise.
1369 * mangle.c: Likewise.
1370 * method.c: Likewise.
1371 * name-lookup.c: Likewise.
1372 * parser.c: Likewise.
1375 * semantics.c: Likewise.
1376 * typeck2.c: Likewise.
1378 2010-08-19 Jason Merrill <jason@redhat.com>
1380 * call.c (reference_related_p): Check for error_mark_node.
1381 (add_function_candidate): Check it instead of
1382 same_type_ignoring_top_level_qualifiers_p.
1385 * init.c (build_new_1): Don't use build_value_init in a template.
1386 (build_value_init): Make sure we don't.
1389 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1390 of empty class CONSTRUCTOR.
1392 * except.c (pending_noexcept, pending_noexcept_checks): New.
1393 (perform_deferred_noexcept_checks): New.
1394 (maybe_noexcept_warning): Split from...
1395 (finish_noexcept_expr): ...here. Adjust.
1396 * decl2.c (cp_write_global_declarations): Call
1397 perform_deferred_noexcept_checks.
1398 * cp-tree.h: And declare it.
1400 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1403 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1406 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1408 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1409 or if -fms-extensions is enabled check, check permissive.
1411 2010-08-09 Jason Merrill <jason@redhat.com>
1414 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1416 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1418 * call.c (add_builtin_candidates): Use VECs for local variable
1419 `types'. Adjust remainder of function accordingly.
1421 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1423 * name-lookup.c (is_associated_namespace): Convert local variables
1424 to be VECs instead of TREE_LISTs.
1426 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1428 * tree.c (varargs_function_p): Use stdarg_p.
1430 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1432 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1433 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1434 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1435 Change type to a VEC.
1436 (unparsed_funs_with_default_args): Define.
1437 (unparsed_funs_with_definitions): Define.
1438 (push_unparsed_function_queues): New function.
1439 (cp_parser_new): Call it.
1440 (pop_unparsed_function_queues): New function.
1441 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1442 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1443 (cp_parser_save_member_function_body): Likewise.
1444 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1445 and pop_unparsed_function_queues.
1446 (cp_parser_late_parsing_default_args): Likewise.
1447 (cp_parser_save_default_args): Use VEC_safe_push.
1449 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1451 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1453 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1455 * decl.c (poplevel): Adjust for type changes.
1456 (declare_local_label): Likewise.
1458 2010-08-06 Jason Merrill <jason@redhat.com>
1460 * typeck.c (complete_type_or_maybe_complain): Split out from...
1461 (complete_type_or_else): Here.
1462 (build_class_member_access_expr): Call it.
1463 (finish_class_member_access_expr): Likewise.
1464 * call.c (build_special_member_call): Likewise.
1465 * cvt.c (build_expr_type_conversion): Likewise.
1466 * init.c (build_new): Likewise.
1467 * typeck2.c (build_functional_cast): Likewise.
1468 * cp-tree.h: Declare it.
1470 * init.c (build_value_init): Add complain parm.
1471 (build_value_init_noctor): Likewise.
1472 (perform_member_init): Pass it.
1473 (expand_aggr_init_1): Likewise.
1474 (build_new_1): Likewise.
1475 (build_vec_init): Likewise.
1476 * pt.c (tsubst_expr): Likewise.
1477 * typeck2.c (build_functional_cast): Likewise.
1478 * cp-tree.h: Adjust.
1479 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1481 * typeck.c (decay_conversion): Any expression with type nullptr_t
1484 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1487 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1489 2010-07-27 Jason Merrill <jason@redhat.com>
1491 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1492 from build_value_init.
1493 * init.c (build_value_init_noctor): Give error for unknown array
1496 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1498 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1500 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1502 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1503 c_common_initialize_diagnostics.
1504 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1505 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1507 2010-07-21 Jason Merrill <jason@redhat.com>
1509 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1511 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1514 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1517 * pt.c (instantiate_class_template): Propagate the template's
1518 location to its instance.
1520 2010-07-20 Jason Merrill <jason@redhat.com>
1523 * pt.c (tsubst_copy_and_build): Rework last change.
1526 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1529 2010-07-19 Jason Merrill <jason@redhat.com>
1532 * semantics.c (finish_decltype_type): Correct decltype
1533 of parenthesized rvalue reference variable.
1536 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1537 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1539 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1542 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1544 * cp-tree.h: Adjust declaration.
1545 * init.c (perform_member_init): Adjust caller.
1546 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1547 * typeck2.c (store_init_value): Likewise.
1548 (build_functional_cast): Pass complain argument to
1549 build_x_compound_expr_from_list.
1551 2010-07-16 Jason Merrill <jason@redhat.com>
1554 * pt.c (process_partial_specialization): Diagnose partial
1555 specialization after instantiation.
1556 (most_specialized_class): Add complain parm.
1558 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1560 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1562 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1563 cp_build_function_call.
1565 2010-07-15 Jason Merrill <jason@redhat.com>
1568 * call.c (add_function_candidate): If we're working on an implicit
1569 declaration, don't consider candidates that won't match.
1570 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1571 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1574 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1575 (TYPE_HAS_USER_OPEQ): New.
1576 * decl.c (grok_special_member_properties): Set it.
1577 * class.c (add_implicitly_declared_members): Don't lazily declare
1578 constructors/operator= if a base or member has a user-declared one.
1579 (check_bases_and_members, check_bases): Adjust.
1580 (check_field_decls, check_field_decl): Adjust.
1582 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1584 * decl.c (integer_three_node): Remove.
1585 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1586 * cp-tree.h (integer_three_node): Remove.
1588 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1590 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1592 * class.c: Likewise.
1593 * cp-gimplify.c: Likewise.
1595 * decl2.c: Likewise.
1597 * mangle.c: Likewise.
1598 * name-lookup.c: Likewise.
1599 * optimize.c: Likewise.
1600 * parser.c: Likewise.
1603 * search.c: Likewise.
1604 * semantics.c: Likewise.
1605 * typeck.c: Likewise.
1606 * typeck2.c: Likewise.
1608 2010-07-14 Jason Merrill <jason@redhat.com>
1610 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1611 (build_field_list): Cache field type.
1613 Implement C++0x unrestricted unions (N2544)
1614 * class.c (check_field_decl): Loosen union handling in C++0x.
1615 * method.c (walk_field_subobs): Split out from...
1616 (synthesized_method_walk): ...here. Set msg before loops.
1617 (process_subob_fn): Check for triviality in union members.
1618 * init.c (sort_mem_initializers): Splice out uninitialized
1619 anonymous unions and union members.
1620 (push_base_cleanups): Don't automatically destroy anonymous unions
1623 2010-07-13 Jason Merrill <jason@redhat.com>
1626 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1627 (TYPE_HAS_USER_OPEQ): New.
1628 * decl.c (grok_special_member_properties): Set it.
1629 * class.c (add_implicitly_declared_members): Don't lazily declare
1630 constructors/operator= if a base or member has a user-declared one.
1631 (check_bases_and_members, check_bases): Adjust.
1632 (check_field_decls, check_field_decl): Adjust.
1633 * method.c (synthesized_method_walk): Initialize check_vdtor.
1636 * mangle.c (write_type): Canonicalize.
1637 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1638 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1640 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1643 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1645 * typeck.c (get_delta_difference): Update prototype, add a
1646 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1647 add checks for error_mark_node.
1648 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1649 parameter; update lookup_base call.
1650 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1651 parameter; update get_delta_difference call and add check for
1653 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1654 parameter; update get_delta_difference call and add check for
1655 error_mark_node; update build_ptrmemfunc call.
1656 (build_static_cast_1): Adjust convert_ptrmem call.
1657 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1658 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1659 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1660 and build_ptrmemfunc calls.
1661 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1663 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1666 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1667 adjust build_special_member_call call, pass complain.
1668 (convert_like_real): Adjust build_temp call, pass complain.
1670 2010-07-09 Jason Merrill <jason@redhat.com>
1673 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1674 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1675 Set BV_LOST_PRIMARY.
1676 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1678 2010-07-08 Jason Merrill <jason@redhat.com>
1681 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1682 virtual bases for covariant thunks.
1684 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1686 * cp-tree.h: Do not include toplev.h.
1688 2010-07-06 Jason Merrill <jason@redhat.com>
1691 * call.c (is_std_init_list): Look through typedefs.
1694 * init.c (build_offset_ref): If scope isn't dependent,
1695 don't exit early. Look at TYPE_MAIN_VARIANT.
1696 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1698 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1700 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1702 * cp-tree.h (impl_conv_void): New type.
1703 (convert_to_void): Adjust prototype.
1704 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1705 diagnostic for easy translation. Change caller.
1706 * typeck.c: Update call to convert_to_void.
1707 * semantics.c: Likewise.
1710 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1712 * decl.c (cp_finish_decl): Call add_local_decl.
1713 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1715 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1717 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1720 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1723 * parser.c (cp_parser_primary_expression): Error if local template is
1726 2010-07-02 Le-Chun Wu <lcwu@google.com>
1729 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1730 (variable or type) shadows another type.
1732 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1735 * typeck.c (convert_for_assignment): When converting a convertible
1736 vector type or objc++ types, call mark_rvalue_use.
1737 * typeck2.c (build_m_component_ref): Use return values from
1738 mark_rvalue_use or mark_lvalue_use.
1739 * class.c (build_base_path): Likewise.
1740 * call.c (build_conditional_expr): Likewise.
1742 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1745 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1748 2010-07-01 Richard Guenther <rguenther@suse.de>
1750 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1751 predicate we are looking for, allow non-gimplified
1754 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1757 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1758 arg is NULL_TREE too.
1759 * call.c (convert_class_to_reference): Return error_mark_node when
1762 2010-06-30 Michael Matz <matz@suse.de>
1764 * repo.c (finish_repo): Fix typo.
1766 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1768 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1770 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1772 * repo.c (pending_repo): Change type to a VEC.
1773 (finish_repo): Adjust for new type of pending_repo.
1774 (repo_emit_p): Likewise.
1776 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1778 * tree.c: Include gimple.h. Do not include tree-flow.h
1779 * decl.c: Do not include tree-flow.h
1780 * Make-lang.in: Adjust dependencies.
1782 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1784 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1785 (incomplete_vars): Adjust comment. Change type to a VEC.
1786 (maybe_register_incomplete_var): Adjust for new type.
1787 (complete_vars): Adjust iteration over incomplete_vars.
1789 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1791 * decl.c (struct named_label_entry): Change type of bad_decls field
1793 (poplevel_named_label_1): Adjust for new type of bad_decls.
1794 (check_goto): Likewise.
1796 2010-06-29 Jason Merrill <jason@redhat.com>
1798 Enable implicitly declared move constructor/operator= (N3053).
1799 * class.c (add_implicitly_declared_members): A class with no
1800 explicitly declared copy or move constructor gets both declared
1801 implicitly, and similarly for operator=.
1802 (check_bases): A type with no copy ctor does not inhibit
1803 a const copy ctor in a derived class. It does mean the derived
1805 (check_field_decl): Likewise.
1806 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1807 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1808 (trivially_copyable_p): Likewise.
1809 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1810 * class.c (finish_struct_bits): Likewise.
1811 * tree.c (build_target_expr_with_type): Likewise.
1812 * typeck2.c (store_init_value): Likewise.
1814 Enable implicitly deleted functions (N2346)
1815 * class.c (check_bases_and_members): Adjust lambda flags.
1816 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1818 * decl2.c (mark_used): Adjust error for use of deleted function.
1820 Machinery to support implicit delete/move.
1821 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1822 has_complex_move_ctor, has_complex_move_assign bitfields.
1823 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1824 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1825 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1826 (enum special_function_kind): Add sfk_move_assignment.
1827 (LOOKUP_SPECULATIVE): New.
1828 * call.c (build_over_call): Return early if it's set.
1829 (build_over_call): Use trivial_fn_p.
1830 * class.c (check_bases): If the base has no default constructor,
1831 the derived one is non-trivial. Handle move ctor/op=.
1832 (check_field_decl): Likewise.
1833 (check_bases_and_members): Handle move ctor/op=.
1834 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1835 (type_has_move_constructor, type_has_move_assign): New.
1836 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1837 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1838 (trivial_fn_p): New.
1839 (do_build_copy_constructor): Use it.
1840 (do_build_assign_ref): Likewise. Handle move assignment.
1841 (build_stub_type, build_stub_object, locate_fn_flags): New.
1842 (locate_ctor): Use locate_fn_flags.
1843 (locate_copy, locate_dtor): Remove.
1844 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1845 (process_subob_fn, synthesized_method_walk): New.
1846 (maybe_explain_implicit_delete): New.
1847 (implicitly_declare_fn): Use synthesized_method_walk,
1848 type_has_trivial_fn, and type_set_nontrivial_flag.
1849 (defaulted_late_check): Set DECL_DELETED_FN.
1850 (defaultable_fn_check): Handle sfk_move_assignment.
1851 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1852 implicitly deleted move ctor/op=.
1853 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1854 (lookup_fnfields_slot): New.
1855 * semantics.c (omp_clause_info_fndecl): Remove.
1856 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1857 get_copy_assign, trivial_fn_p.
1858 (trait_expr_value): Adjust call to locate_ctor.
1859 * tree.c (special_function_p): Handle sfk_move_assignment.
1861 * class.c (type_has_virtual_destructor): New.
1862 * cp-tree.h: Declare it.
1863 * semantics.c (trait_expr_value): Use it.
1865 * call.c (build_over_call): Only give warnings with tf_warning.
1867 * name-lookup.c (pop_scope): Handle NULL_TREE.
1869 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1870 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1871 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1872 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1873 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1874 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1875 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1876 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1877 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1878 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1879 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1880 * search.c, semantics.c, tree.c: Adjust.
1882 * pt.c (dependent_scope_ref_p): Remove.
1883 (value_dependent_expression_p): Don't call it.
1884 (type_dependent_expression_p): Here either.
1885 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1886 if the scope isn't dependent.
1888 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1892 * pt.c (has_value_dependent_address): New.
1893 (value_dependent_expression_p): Check it.
1894 (convert_nontype_argument): Likewise. Call decay_conversion before
1895 folding if we want a pointer.
1896 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1897 scope is the current instantiation.
1899 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1902 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1905 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1907 * init.c: Do not include except.h.
1910 * cp-lang.c: Likewise.
1912 * semantics.c: Likewise.
1913 * decl2.c: Likewise.
1914 * except.c: Likewise.
1915 (init_exception_processing): Do not set the removed
1916 lang_protect_cleanup_actions here.
1917 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1918 (doing_eh): New, moved from except.c but removed the do_warning flag.
1919 (expand_start_catch_block): Update doing_eh call.
1920 (expand_end_catch_block): Likewise.
1921 (build_throw): Likewise.
1922 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1923 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1924 cp_protect_cleanup_actions.
1925 * Make-lang.in: Update dependencies.
1927 2010-06-26 Jason Merrill <jason@redhat.com>
1929 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1930 constructor called with a single argument that takes a reference
1931 to the constructor's class.
1932 (BAD_CONVERSION_RANK): New.
1933 (compare_ics): Use it to compare bad ICSes.
1935 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1937 * lang-specs.h: Remove +e handling.
1939 2010-06-24 Andi Kleen <ak@linux.intel.com>
1941 * parser.c: (cp_parser_question_colon_clause):
1942 Switch to use cp_lexer_peek_token.
1943 Call warn_for_omitted_condop. Call pedwarn for omitted
1946 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1949 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1950 datum and mark_rvalue_use on component.
1953 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1954 the CALL_EXPR has no arguments.
1956 2010-06-21 Jason Merrill <jason@redhat.com>
1958 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1960 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1963 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1965 * name-lookup.c (struct arg_lookup): Convert namespaces and
1966 classes fields to VEC.
1967 (arg_assoc_namespace): Adjust for new type of namespaces.
1968 (arg_assoc_class): Adjust for new type of classes.
1969 (lookup_arg_dependent): Use make_tree_vector and
1970 release_tree_vector.
1971 * typeck2.c (build_x_arrow): Use vec_member.
1973 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1976 * error.c (dump_decl): Better wording for anonymous namespace.
1978 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1980 * class.c (build_vtbl_initializer): Adjust computation of new_position
1981 and which entry to add padding for.
1983 2010-06-16 Jason Merrill <jason@redhat.com>
1985 * except.c (check_noexcept_r): Return the problematic function.
1986 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1987 * pt.c (tsubst_copy_and_build): Pass it.
1988 * parser.c (cp_parser_unary_expression): Likewise.
1989 * cp-tree.h: Adjust prototype.
1991 * method.c (defaulted_late_check): Give the defaulted method
1992 the same exception specification as the implicit declaration.
1994 2010-06-15 Jason Merrill <jason@redhat.com>
1996 * class.c (add_implicitly_declared_members): Implicit assignment
1997 operators can also be virtual overriders.
1998 * method.c (lazily_declare_fn): Likewise.
2000 * call.c (convert_like_real): Give "initializing argument of"
2001 information for ambiguous conversion. Give source position
2004 * call.c (print_z_candidates): Do print viable deleted candidates.
2005 (joust): Don't choose a deleted function just because its worst
2006 conversion is better than another candidate's worst.
2008 * call.c (convert_like_real): Don't complain about
2009 list-value-initialization from an explicit constructor.
2011 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
2012 DECL_SOURCE_LOCATION directly.
2014 * class.c (type_has_user_provided_default_constructor): Use
2017 * call.c (is_subseq): Handle ck_aggr, ck_list.
2018 (compare_ics): Treat an aggregate or ambiguous conversion to the
2019 same type as involving the same function.
2021 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
2023 * typeck.c (convert_for_assignment): Fix comment. Change message
2024 format from %d to %qP.
2025 (convert_for_initialization): Fix comment.
2027 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
2029 * cp-tree.h (expr_list_kind): New type.
2030 (impl_conv_rhs): New type.
2031 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
2033 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
2034 diagnostics for easy translation. Change caller.
2035 (convert_for_initialization): Use impl_conv_rhs and change caller.
2036 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
2037 diagnostics for easy translation. Change caller.
2038 * decl.c (bad_spec_place): New enum.
2039 (bad_specifiers): Use it and emit the diagnostics for easy
2040 translation. Change caller.
2041 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
2043 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
2045 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
2047 * decl2.c (cp_write_global_declarations): Adjust for new type of
2048 decl_namespace_list.
2049 * name-lookup.c (current_decl_namespace): Likewise.
2050 (push_decl_namespace): Likewise.
2051 (pop_decl_namespace): Likewise.
2053 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
2055 * call.c (build_java_interface_fn_ref): Call build_function_type_list
2056 instead of build_function_type.
2057 * decl.c (cxx_init_decl_processing): Likewise.
2058 (declare_global_var): Likewise.
2059 (get_atexit_node): Likewise.
2060 (expand_static_init): Likewise.
2061 * decl2.c (start_objects): Likewise.
2062 (start_static_storage_duration_function): Likewise.
2063 * except.c (init_exception_processing): Likewise.
2064 (build_exc_ptr): Likewise.
2065 (build_throw): Likewise.
2066 * rtti.c (throw_bad_cast): Likewise.
2067 (throw_bad_typeid): Likewise.
2068 (build_dynamic_cast_1): Likewise.
2070 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
2072 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
2073 (build_op_delete_call): Likewise.
2074 (build_over_call): Likewise.
2075 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
2076 * pt.c (process_partial_specialization): Likewise.
2077 (tsubst_template_args): Likewise.
2078 * semantics.c (finish_asm_stmt): Likewise.
2080 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
2082 * decl.c (record_key_method_defined): New, broken out of ...
2083 (finish_function): ... here. Call it.
2084 (start_decl): Treat aliases as definitions.
2086 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2088 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
2090 * pt.c (maybe_process_partial_specialization): Likewise.
2091 (register_specialization): Likewise.
2092 (add_pending_template): Likewise.
2093 (lookup_template_class): Likewise.
2094 (push_tinst_level): Likewise.
2096 * parser.c (cp_lexer_new_main): Likewise.
2097 (cp_lexer_new_from_tokens): Likewise.
2098 (cp_token_cache_new): Likewise.
2099 (cp_parser_context_new): Likewise.
2100 (cp_parser_new): Likewise.
2101 (cp_parser_nested_name_specifier_opt): Likewise.
2102 (cp_parser_template_id): Likewise.
2104 * name-lookup.c (binding_entry_make): Likewise.
2105 (binding_table_construct): Likewise.
2106 (binding_table_new): Likewise.
2107 (cxx_binding_make): Likewise.
2108 (pushdecl_maybe_friend): Likewise.
2109 (begin_scope): Likewise.
2110 (push_to_top_level): Likewise.
2112 * lex.c (init_reswords): Likewise.
2113 (retrofit_lang_decl): Likewise.
2114 (cxx_dup_lang_specific_decl): Likewise.
2115 (copy_lang_type): Likewise.
2116 (cxx_make_type): Likewise.
2118 * decl.c (make_label_decl): Likewise.
2119 (check_goto): Likewise.
2120 (start_preparsed_function): Likewise.
2121 (save_function_data): Likewise.
2123 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
2125 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
2127 * class.c (finish_struct_1): Likewise.
2129 * cp-tree.h (struct lang_type): Add variable_size GTY option.
2130 (struct lang_decl): Likewise.
2132 * parser.c (cp_parser_new): Update comment to not reference
2135 2010-06-07 Jason Merrill <jason@redhat.com>
2138 * error.c (dump_parameters): Mask out TFF_SCOPE.
2139 (dump_simple_decl): Don't print the scope of a PARM_DECL.
2140 (dump_scope): Remove no-op mask.
2143 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
2145 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
2146 * init.c (build_offset_ref): Use it.
2147 * pt.c (maybe_process_partial_specialization): Use it.
2148 (instantiate_class_template): Use it.
2149 * search.c (lookup_base): Use it.
2151 2010-06-07 Jakub Jelinek <jakub@redhat.com>
2154 * expr.c (mark_exp_read): Handle INDIRECT_REF.
2155 * cvt.c (convert_to_void): Handle INDIRECT_REF like
2156 handled_component_p.
2159 * decl.c (initialize_local_var): If TREE_USED is set on the type,
2160 set also DECL_READ_P on the decl.
2162 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2165 * cp-tree.h (typedef_variant_p): Move this declaration to
2167 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2168 * decl.c (grokdeclarator): Do not rename debug info of an
2169 anonymous tagged type named by a typedef.
2171 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
2174 * class.c (check_field_decls): Move the call to
2175 check_bitfield_decl before trying to set the
2176 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
2178 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
2180 * typeck.c: Update include path for moved files.
2183 * cp-gimplify.c: Likewise.
2184 * cp-lang.c: Likewise.
2186 * semantics.c: Likewise.
2187 * cxx-pretty-print.h: Likewise.
2188 * decl2.c: Likewise.
2189 * parser.c: Likewise.
2190 * cp-objcp-common.c: Likewise.
2191 * cp-tree.h: Likewise.
2192 * name-lookup.c: Likewise.
2194 * name-lookup.h: Likewise.
2195 * config-lang.in: Update paths in gtfiles for files in c-family/.
2196 * Make-lang.in: Likewise.
2198 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
2200 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
2201 * typeck.c (build_ptrmemfunc): Likewise.
2203 2010-06-04 Jason Merrill <jason@redhat.com>
2205 * typeck2.c (merge_exception_specifiers): Adjust merging of
2206 throw() and noexcept(true).
2208 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
2209 using an uninitialized variable.
2211 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
2212 (pp_cxx_expression): Likewise.
2214 Implement noexcept-specification (15.4)
2215 * parser.c (cp_parser_exception_specification_opt): Parse it.
2216 Give -Wdeprecated warning about throw() specs.
2217 * pt.c (tsubst_exception_specification): Handle it.
2218 * error.c (dump_exception_spec): Handle it.
2219 (dump_expr): Handle NOEXCEPT_EXPR.
2220 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
2221 * typeck.c (comp_except_specs): Handle compatibility rules.
2222 Change exact parm to take an enum.
2223 * typeck2.c (merge_exception_specifiers): Handle noexcept.
2224 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
2225 (type_throw_all_p, build_noexcept_spec): New fns.
2226 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
2227 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
2228 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
2229 (noexcept_true_spec, noexcept_false_spec): New macros.
2230 * name-lookup.c (pushdecl_maybe_friend): Adjust.
2231 * search.c (check_final_overrider): Adjust.
2232 * decl.c (check_redeclaration_exception_specification): Adjust.
2233 (use_eh_spec_block): Use type_throw_all_p.
2234 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
2235 Give operator new a noexcept-specification in C++0x mode.
2236 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
2237 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
2239 Implement noexcept operator (5.3.7)
2240 * cp-tree.def (NOEXCEPT_EXPR): New.
2241 * except.c (check_noexcept_r, finish_noexcept_expr): New.
2242 * cp-tree.h: Declare finish_noexcept_expr.
2243 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
2244 * pt.c (tsubst_copy_and_build): And tsubst it.
2245 (type_dependent_expression_p): Handle it.
2246 (value_dependent_expression_p): Handle it.
2248 * call.c (build_conditional_expr): Never fold in unevaluated context.
2249 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
2250 * semantics.c (simplify_aggr_init_expr): Likewise.
2251 * typeck.c (merge_types): Call merge_exception_specifiers.
2252 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
2253 DECL_ANTICIPATED for preferring new type.
2255 2010-06-04 Joseph Myers <joseph@codesourcery.com>
2257 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
2260 2010-06-04 Jakub Jelinek <jakub@redhat.com>
2263 * typeck.c (build_class_member_access_expr): Call mark_exp_read
2264 on object for static data members.
2266 2010-06-04 Jakub Jelinek <jakub@redhat.com>
2267 Jason Merrill <jason@redhat.com>
2270 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
2271 with the same type, call mark_lvalue_use on both.
2273 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
2275 * class.c (struct vtbl_init_data_s): Remove last_init field.
2276 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
2278 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
2280 (build_vtt): Likewise.
2281 (initialize_vtable): Take a VEC instead of a tree.
2282 (build_vtt_inits): Change return type to void. Take a VEC **
2283 instead of a tree *; accumulate results into said VEC.
2284 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
2285 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
2286 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
2288 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
2289 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
2291 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
2292 rather than tree_cons.
2293 (build_vbase_offset_vtbl_entries): Likewise.
2294 (add_vcall_offset): Likewise.
2295 (build_rtti_vtbl_entries): Likewise.
2296 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
2297 * decl.c (initialize_artificial_var): Use build_constructor instead
2298 of build_constructor_from_list.
2300 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
2303 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
2306 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
2308 * parser.c (cp_parser_mem_initializer_list): Change error text.
2310 2010-06-02 Jakub Jelinek <jakub@redhat.com>
2312 * cp-objcp-common.c (shadowed_var_for_decl): Change into
2313 tree_decl_map hashtab from tree_map.
2314 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
2315 (init_shadowed_var_for_decl): Adjust initialization.
2318 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
2319 instead of calling mark_exp_read only when not an assignment.
2322 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2323 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2324 Set DECL_VALUE_EXPR on var.
2326 2010-06-02 Jason Merrill <jason@redhat.com>
2328 * error.c (dump_type): Improve typedef handling.
2333 * name-lookup.c (same_entity_p): New.
2334 (ambiguous_decl): Multiple declarations of the same entity
2337 2010-06-01 Jason Merrill <jason@redhat.com>
2340 * call.c (add_list_candidates): Prefer the default constructor.
2341 (build_aggr_conv): Treat missing initializers like { }.
2342 * typeck2.c (process_init_constructor_record): Likewise.
2343 * init.c (expand_default_init): Use digest_init for
2344 direct aggregate initialization, too.
2346 * call.c (add_list_candidates): Split out...
2347 (build_user_type_conversion_1): ...from here.
2348 (build_new_method_call): And here.
2349 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2352 * call.c (build_list_conv): Set list-initialization flags properly.
2354 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2356 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2358 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2359 Matthew Gingell <gingell@adacore.com>
2361 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2362 * decl2.c: Include langhooks.h and c-ada-spec.h.
2363 (cpp_check, collect_source_refs, collect_ada_namespace,
2364 collect_all_refs): New functions.
2365 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2366 * lang-specs.h: Ditto.
2368 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2370 * cp-tree.h (cp_build_function_call_nary): Declare.
2371 * typeck.c (cp_build_function_call_nary): Define.
2372 * decl.c (register_dtor_fn): Use it instead of
2373 cp_build_function_call.
2374 (cxx_maybe_build_cleanup): Likewise.
2375 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2376 * except.c (do_get_exception_ptr): Likewise.
2377 (do_begin_catch): Likewise.
2378 (do_allocate_exception): Likewise.
2379 (do_free_exception): Likewise.
2380 (build_throw): Likewise. Use cp_build_function_call_vec instead
2381 of cp_build_function_call.
2382 (do_end_catch): Likewise.
2384 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2386 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2387 (struct cp_declarator): Move id_loc field up.
2389 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2391 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2392 this file is included before c-common.h. Define GCC_DIAG_STYLE
2393 before including diagnostic-core.h and toplev.h.
2394 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2395 * pt.c: Include cp-tree.h before c-common.h.
2397 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2399 * tree.c (c_register_addr_space): Add stub.
2401 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2403 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2406 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2408 Revert fix of PR c++/44188
2409 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2411 * tree.c (typedef_variant_p): Revert moving this definition to
2413 * decl.c (grokdeclarator): Revert naming typedef handling.
2415 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2417 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2418 * cp-lang.c: Don't include diagnostic.h
2419 * name-lookup.c: Include diagnostic-core.h instead of
2421 (cp_emit_debug_info_for_using): Use seen_error.
2422 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2423 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2424 * pt.c (iterative_hash_template_arg): Use seen_error.
2425 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2426 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2427 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2428 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2431 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2434 * cp-tree.h (typedef_variant_p): Move this declaration to
2436 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2437 * decl.c (grokdeclarator): Do not rename debug info of an
2438 anonymous tagged type named by a typedef.
2440 2010-05-27 Jason Merrill <jason@redhat.com>
2443 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2446 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2449 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2450 * class.c (layout_class_type): Likewise.
2451 * decl.c (finish_enum): Likewise.
2452 * mangle.c (write_builitin_type): Likewise.
2454 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2456 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2458 * decl.c (grokdeclarator): Handle __int128.
2459 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2460 (cp_parser_simple_type_specifier): Likewise.
2461 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2462 * typeck.c (cp_common_type): Handle __int128.
2463 * mangle.c (integer_type_codes): Add itk_int128 and
2464 itk_unsigned_int128.
2466 2010-05-26 Jason Merrill <jason@redhat.com>
2469 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2472 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2474 * cp-lang.c: Do not include expr.h.
2476 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2478 * decl.c: Do not include rtl.h
2479 * semantics.c: Likewise.
2481 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2483 * cp-tree.h: Do not include splay-tree.h.
2484 (struct prtmem_cst): Remove unused field and false comment.
2485 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2486 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2487 * init.c: Do not include rtl.h and expr.h.
2488 * class.c: Do not include rtl.h. Include splay-tree.h.
2489 (build_clone): Use plain NULL instead of NULL_RTX.
2490 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2491 included. Include splay-tree.h.
2492 * method.c: Do not include rtl.h and expr.h.
2493 (use_thunk): Use plain NULL instead of NULL_RTX.
2494 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2495 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2496 and target.h. Include splay-tree.h.
2497 * expr.c: Do not include rtl.h and expr.h.
2498 * pt.c: Do not include obstack.h and rtl.h.
2499 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2500 (tsubst_decl): Likewise.
2501 (instantiate_decl): Likewise.
2502 * semantics.c: Do not include exprt.h and debug.h. Explain why
2503 rtl.h has to be included.
2504 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2505 * call.c: Do not include rtl.h and expr.h.
2506 * search.c: Do not include obstack.h and rtl.h.
2507 * friend.c: Do not include rtl.h and expr.h.
2508 * Make-lang.in: Update dependencies.
2510 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2513 * parser.c (non_integral_constant): Add NIC_NONE.
2514 (required_token): Add RT_NONE.
2515 (cp_parser_unary_expression): Initialize non_constant_p
2517 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2518 (cp_parser_primary_expression, cp_parser_postfix_expression,
2519 cp_parser_cast_expression, cp_parser_binary_expression,
2520 cp_parser_functional_cast): Fix formatting.
2522 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2525 * parser.c: Remove inclusion of dyn-string.h.
2526 (non_integral_constant): New enum.
2527 (name_lookup_error): New enum.
2528 (required_token): New enum.
2529 (cp_parser_required_error): New function.
2530 (cp_parser_require): Change the type of variable token_desc to
2531 required_token and use cp_parser_required_error.
2532 (cp_parser_require_keyword): Likewise.
2533 (cp_parser_error): Use gmsgid as parameter.
2534 (cp_parser_name_lookup_error): Change the type of variable desired to
2535 name_lookup_error and put the diagnostic in the full sentences. Change
2537 (cp_parser_non_integral_constant_expression): Change the type of the
2538 variable thing to non_integral_constant and put the diagnostics in
2539 full sentences. Change caller.
2541 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2544 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2546 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2548 * error.c (cp_diagnostic_starter): Update call to
2549 diagnostic_build_prefix.
2550 (cp_print_error_function,
2551 print_instantiation_partial_context_line): Check show_column flag
2554 2010-05-24 Jason Merrill <jason@redhat.com>
2557 * decl.c (check_initializer): Don't wrap an init-list in a
2559 * init.c (build_aggr_init): Don't assume copy-initialization if
2560 init has CONSTRUCTOR_IS_DIRECT_INIT.
2561 * call.c (build_new_method_call): Sanity check.
2563 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2565 * rtti.c (tinfo_base_init): Use build_constructor instead of
2566 build_constructor_from_list. Don't cons a tree node for
2568 (generic_initializer): Use build_constructor_single instead of
2569 build_constructor_from_list.
2570 (ptr_initializer): Use build_constructor instead of
2571 build_constructor_from_list
2572 (ptm_initializer): Likewise.
2573 (class_initializer): Likewise. Take varargs instead of TRAIL.
2574 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2575 build_constructor instead of build_constructor_from_list.
2577 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2579 * semantics.c: Include bitmap.h.
2580 * Make-lang.in: Update dependencies.
2582 2010-05-22 Jan Hubicka <jh@suse.cz>
2584 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2586 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2588 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2590 * cxx-pretty-print.c: Correct merge error.
2592 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2594 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2595 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2596 (cp_printer): Handle %K here using percent_K_format.
2597 * cxx-pretty-print.c: Include tree-pretty-print.h.
2598 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2601 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2603 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2604 Clean up redundant includes.
2606 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2609 * decl.c (xref_basetypes): Return false in case of ill-formed
2612 2010-05-19 Jason Merrill <jason@redhat.com>
2614 * call.c (reference_binding): Use cp_build_qualified_type_real
2615 and cp_type_quals consistently.
2616 (add_function_candidate): Likewise.
2617 (build_conditional_expr): Likewise.
2618 (convert_like_real): Likewise.
2619 (type_passed_as): Likewise.
2620 * class.c (add_method): Likewise.
2621 (same_signature_p): Likewise.
2622 (layout_class_type): Likewise.
2623 * decl.c (cxx_init_decl_processing): Likewise.
2624 (cp_fname_init): Likewise.
2625 (grokdeclarator): Likewise.
2626 * decl2.c (cp_reconstruct_complex_type): Likewise.
2627 * init.c (build_new_1): Likewise.
2628 * method.c (do_build_copy_constructor): Likewise.
2629 (implicitly_declare_fn): Likewise.
2630 * pt.c (tsubst_aggr_type): Likewise.
2632 * rtti.c (init_rtti_processing): Likewise.
2633 (build_headof): Likewise.
2634 (build_dynamic_cast_1): Likewise.
2635 (tinfo_base_init): Likewise.
2636 (emit_support_tinfos): Likewise.
2637 * semantics.c (capture_decltype): Likewise.
2638 * tree.c (cv_unqualified): Likewise.
2639 * typeck.c (composite_pointer_type): Likewise.
2640 (string_conv_p): Likewise.
2642 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2644 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2645 * decl.c (start_decl): Likewise.
2646 * semantics.c (finish_compound_literal): Likewise.
2647 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2648 (cp_type_readonly): Remove.
2649 * cp-tree.h: Remove declaration.
2651 * typeck.c (merge_types): Preserve memfn quals.
2653 * decl.c (grokdeclarator): Don't check quals on fn type.
2654 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2655 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2658 * typeck.c (type_memfn_quals): New fn.
2659 (apply_memfn_quals): New fn.
2660 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2661 (cp_type_readonly): Use cp_type_quals.
2662 * cp-tree.h: Add declarations.
2663 * tree.c (cp_build_qualified_type_real): Don't set, but do
2664 preserve, quals on FUNCTION_TYPE.
2665 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2666 * decl.c (build_ptrmem_type): Likewise.
2667 (grokdeclarator): Likewise.
2668 (static_fn_type): Likewise.
2669 * decl2.c (change_return_type): Likewise.
2670 (cp_reconstruct_complex_type): Likewise.
2671 * pt.c (tsubst_function_type): Likewise.
2673 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2675 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2677 * tree.c (build_min_non_dep_call_vec): Update comment.
2679 2010-05-17 Jason Merrill <jason@redhat.com>
2681 * call.c (struct z_candidate): Add explicit_targs field.
2682 (add_template_candidate_real): Set it.
2683 (build_over_call): Use it to control init-list warning.
2686 * call.c (build_over_call): Limit init-list deduction warning to
2687 cases where the argument is actually an init-list.
2690 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2692 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2693 Jason Merrill <jason@redhat.com>
2696 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2698 2010-05-15 Jason Merrill <jason@redhat.com>
2700 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2701 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2703 (finish_eh_spec_block): Adjust.
2705 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2708 * pt.c (tsubst): Unshare template argument.
2710 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2712 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2713 * Make-lang.in: Fix dependencies accordingly.
2715 2010-05-14 Jason Merrill <jason@redhat.com>
2718 * except.c (build_throw): Simplify, adjust for DR 475.
2721 * except.c (dtor_nothrow): Return nonzero for type with
2725 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2726 gimple_build_eh_must_not_throw.
2728 2010-05-14 Martin Jambor <mjambor@suse.cz>
2730 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2733 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2735 * call.c (build_new_method_call): Change warning text.
2736 * typeck2.c (build_functional_cast): Change error text.
2738 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2741 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2742 shadowing the outer parameter or variables by the declaration of
2743 nested function in nested structure or class. Warn the shadowing by
2744 the declaration of nested lambda expression.
2746 2010-05-13 Jason Merrill <jason@redhat.com>
2748 * typeck.c (cp_build_array_ref): Factor out from...
2749 (build_array_ref): ...here. Drop complain parm.
2750 (build_new_op): Adjust.
2751 * class.c (build_vtbl_ref_1): Adjust.
2752 * decl2.c (grok_array_decl): Adjust.
2753 * cp-tree.h: Adjust prototypes.
2755 2010-05-13 Jan Hubicka <jh@suse.cz>
2757 * decl.c (cp_finish_decl): Do not worry about used attribute.
2759 2010-05-12 Jason Merrill <jason@redhat.com>
2761 * typeck.c (build_array_ref): Take complain parm.
2762 * cp-tree.h: Add it to prototype.
2763 * call.c (build_new_op): Pass it.
2764 * class.c (build_vtbl_ref): Pass it.
2765 * decl2.c (grok_array_decl): Pass it.
2769 * cp-tree.def (NULLPTR_TYPE): Remove.
2770 * cp-tree.h (NULLPTR_TYPE_P): New.
2771 (SCALAR_TYPE_P): Use it.
2772 (nullptr_type_node): New.
2773 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2774 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2776 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2777 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2778 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2779 * mangle.c (write_type): Likewise.
2780 * name-lookup.c (arg_assoc_type): Likewise.
2781 * typeck.c (build_reinterpret_cast_1): Likewise.
2782 * rtti.c (typeinfo_in_lib_p): Likewise.
2783 (emit_support_tinfos): Remove local nullptr_type_node.
2785 * cp-tree.h (UNKNOWN_TYPE): Remove.
2786 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2787 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2788 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2789 * class.c (instantiate_type): Check unknown_type_node rather than
2791 * name-lookup.c (maybe_push_decl): Likewise.
2792 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2793 (get_typeid): Likewise.
2794 * semantics.c (finish_offsetof): Likewise.
2797 * call.c (add_template_candidate_real): If deduction fails, still
2798 add the template as a non-viable candidate.
2799 (equal_functions): Handle template candidates.
2800 (print_z_candidate): Likewise.
2801 (print_z_candidates): Likewise.
2802 (build_new_function_call): Likewise.
2804 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2805 * call.c (add_candidates): Enforce it.
2806 (build_new_method_call): Try non-list ctor if no viable list ctor.
2807 (build_user_type_conversion_1): Likewise.
2809 * call.c (add_candidates): Distinguish between type(x) and
2811 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2812 (build_new_method_call): Give better error for conversion op.
2814 * call.c (add_candidates): Add first_arg and return_type parms.
2815 Add special constructor/conversion op handling.
2816 (convert_class_to_reference): Use it.
2817 (build_user_type_conversion_1): Likewise.
2818 (build_op_call): Likewise.
2819 (build_new_method_call): Likewise.
2820 (build_new_op): Adjust.
2821 (perform_overload_resolution): Adjust.
2823 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2828 * pt.c (process_partial_specialization): Return error_mark_node
2829 in case of unused template parameters in partial specialization.
2831 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2834 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2835 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2836 look at its second operand.
2838 2010-05-10 Jason Merrill <jason@redhat.com>
2841 * semantics.c (baselink_for_fns): Revert earlier change.
2844 * typeck.c (cp_build_modify_expr): Complain about assignment to
2845 array from init list.
2847 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2850 * decl.c (check_initializer): strip array type before checking for
2851 uninitialized const or ref members.
2853 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2856 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2857 error count. Emit errors only if compain is true.
2858 (build_new_1): Do not return error_mark_node if
2859 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2860 errors. Delay the check for user-provided constructor.
2861 (perform_member_init): Adjust.
2862 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2865 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2866 Jason Merrill <jason@redhat.com>
2868 Add support for C++0x nullptr.
2869 * cp-tree.def: Add NULLPTR_TYPE.
2870 * cp-tree.h: Add nullptr_node.
2871 (cp_tree_index): Add CPTI_NULLPTR.
2872 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2873 * call.c (null_ptr_cst_p): Handle nullptr.
2874 (standard_conversion): Likewise.
2875 (convert_arg_to_ellipsis): Likewise.
2876 * mangle.c (write_type): Likewise.
2877 * name-lookup.c (arg_assoc_type): Likewise.
2878 * parser.c (cp_parser_primary_expression): Likewise.
2879 * typeck.c (cp_build_binary_op): Likewise.
2880 (build_reinterpret_cast_1): Likewise.
2881 * error.c (dump_type): Likewise.
2882 (dump_type_prefix, dump_type_suffix): Likewise.
2883 * decl.c (cxx_init_decl_processing): Likewise.
2884 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2885 * cvt.c (ocp_convert): Likewise.
2886 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2887 nullptr_t tinfo in libsupc++.
2889 2010-05-06 Jason Merrill <jason@redhat.com>
2891 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2893 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2894 Dodji Seketeli <dodji@redhat.com>
2897 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2899 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2900 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2901 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2902 (cp_build_unary_op): Call lvalue_use.
2903 * decl.c (unused_but_set_errorcount): New variable.
2904 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2905 (duplicate_decls): Merge DECL_READ_P flags.
2906 (start_cleanup_fn): Set DECL_READ_P flag.
2907 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2908 * tree.c (rvalue): Call rvalue_use.
2909 * pt.c (convert_nontype_argument): Likewise.
2910 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2911 finish_decltype_type): Likewise.
2912 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2913 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2914 or rvalue_use depending on the expr.
2915 * init.c (build_new, build_delete): Likewise.
2916 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2918 2010-05-05 Jason Merrill <jason@redhat.com>
2921 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2922 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2924 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2927 * pt.c (unify): Check each elt for error_mark_node.
2929 2010-05-04 Jason Merrill <jason@redhat.com>
2932 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2934 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2937 * call.c (build_new_method_call): Return error_mark_node if fns is
2940 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2943 * pt.c (most_specialized_class): Pretend we are processing
2944 a template decl during the call to coerce_template_parms.
2946 2010-05-03 Jason Merrill <jason@redhat.com>
2950 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2951 from the selected underlying type unless -fstrict-enums. Set
2952 ENUM_UNDERLYING_TYPE to have the restricted range.
2953 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2954 * class.c (check_bitfield_decl): Likewise.
2956 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2959 * init.c (build_new_1): Revert the accidental checkin in
2962 2010-04-30 Jason Merrill <jason@redhat.com>
2965 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2966 (pp_cxx_type_specifier_seq): ...here.
2968 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2970 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2971 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2973 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2976 * typeck.c (warn_args_num): New function.
2977 (convert_arguments): Use warn_args_num to print the diagnostic
2980 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2983 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2984 user-provided constructor while recursing.
2986 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2989 * error.c (print_instantiation_partial_context_line): Handle
2990 recursive instantiation.
2991 (print_instantiation_partial_context): Likewise.
2993 2010-04-27 Jason Merrill <jason@redhat.com>
2995 * init.c (perform_member_init): Check CLASS_TYPE_P.
2997 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
3000 * init.c (perform_member_init): check for uninitialized const or
3001 reference members, including array types.
3003 2010-04-24 Jason Merrill <jason@redhat.com>
3005 * tree.c (get_fns): Split out from get_first_fn.
3006 * cp-tree.h: Declare it.
3007 * search.c (shared_member_p): Use it.
3008 * semantics.c (finish_qualified_id_expr): Simplify.
3009 (finish_id_expression): Simplify.
3011 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
3012 whenever object is NULL_TREE. Don't do 'this' capture here.
3013 (finish_qualified_id_expr): Pass NULL_TREE.
3014 (finish_id_expression): Likewise.
3015 (lambda_expr_this_capture): Likewise.
3017 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
3018 rather than checking current_class_ref directly.
3019 (finish_call_expr): Likewise.
3022 * name-lookup.c (qualify_lookup): Disqualify lambda op().
3023 * class.c (current_nonlambda_class_type): New fn.
3024 * semantics.c (nonlambda_method_basetype): New.
3025 * cp-tree.h: Declare them.
3026 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
3028 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
3031 * semantics.c (lambda_return_type): Complain about
3035 * tree.c (cv_unqualified): Handle error_mark_node.
3038 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
3039 if we don't want errors.
3042 * class.c (convert_to_base): Add complain parameter. Pass
3043 ba_quiet to lookup_base if we don't want errors.
3044 (build_vfield_ref): Pass complain to convert_to_base.
3045 * call.c (convert_like_real): Likewise.
3046 (initialize_reference): Likewise.
3047 (perform_direct_initialization_if_possible): Pass complain to
3049 * cp-tree.h: Adjust.
3051 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
3052 Jason Merrill <jason@redhat.com>
3055 * decl.c (check_for_uninitialized_const_var): Handle classes that need
3057 (check_initializer): Call it for classes that need constructing, too.
3058 * class.c (in_class_defaulted_default_constructor): New.
3059 * cp-tree.h: Declare it.
3061 2010-04-20 Jason Merrill <jason@redhat.com>
3064 * init.c (constant_value_1): Treat error_mark_node as a constant
3065 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
3066 * cvt.c (ocp_convert): Handle getting error_mark_node from
3067 integral_constant_value.
3068 * decl.c (compute_array_index_type): Likewise.
3070 2010-04-20 Dodji Seketeli <dodji@redhat.com>
3074 * typeck.c (incompatible_dependent_types_p): If one of the
3075 compared types if not a typedef then honour their main variant
3078 2010-04-20 Jakub Jelinek <jakub@redhat.com>
3080 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
3082 2010-04-19 Dodji Seketeli <dodji@redhat.com>
3085 * typeck.c (structural_comptypes): Test dependent typedefs
3086 incompatibility before testing for their main variant based
3089 2010-04-19 Jakub Jelinek <jakub@redhat.com>
3091 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
3092 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
3094 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
3096 * decl.c (cxx_init_decl_processing): Remove second argument in call to
3097 build_common_tree_nodes.
3099 2010-04-14 Jason Merrill <jason@redhat.com>
3102 * parser.c (cp_parser_parenthesized_expression_list): Change
3103 is_attribute_list parm to int to indicate whether or not to
3104 handle initial identifier specially.
3105 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
3107 2010-04-13 Jason Merrill <jason@redhat.com>
3109 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
3111 * parser.c (cp_parser_lambda_expression): Complain about lambda in
3112 unevaluated context.
3113 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
3115 2010-04-12 Jason Merrill <jason@redhat.com>
3118 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
3119 return value directly.
3121 * call.c (type_decays_to): Call cv_unqualified for non-class type.
3123 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
3126 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
3127 * init.c (build_new_1): Check for uninitialized const members and
3128 uninitialized reference members, when using new without
3129 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
3130 (diagnose_uninitialized_cst_or_ref_member): Define, call
3131 diagnose_uninitialized_cst_or_ref_member_1.
3132 (diagnose_uninitialized_cst_or_ref_member_1): New function.
3134 2010-04-12 Richard Guenther <rguenther@suse.de>
3137 * semantics.c (expand_or_defer_fn_1): Do not keep extern
3138 template inline functions.
3140 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3143 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
3146 2010-04-07 Jason Merrill <jason@redhat.com>
3149 * decl.c (start_preparsed_function): Do defer nested functions.
3151 PR c++/11094, DR 408
3152 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
3153 * decl2.c (finish_static_data_member_decl): Set it.
3154 * decl.c (duplicate_decls): Propagate it.
3155 * pt.c (tsubst_decl): Don't substitute the domain of an array
3156 VAR_DECL if it's set.
3157 (regenerate_decl_from_template): Substitute it here.
3158 (type_dependent_expression_p): Return true if it's set.
3159 * semantics.c (finish_decltype_type): Instantiate such a variable.
3160 * typeck.c (cxx_sizeof_expr): Likewise.
3161 (strip_array_domain): New.
3164 * name-lookup.c (current_decl_namespace): Non-static.
3165 (pop_nested_namespace): Sanity check.
3166 * cp-tree.h: Declare current_decl_namespace.
3167 * decl.c (grokvardecl): Use it instead of current_namespace.
3168 (grokfndecl): Likewise.
3171 * pt.c (tsubst_friend_function): Instatiate a friend that has already
3174 * pt.c (print_template_statistics): New.
3175 * cp-tree.h: Declare it.
3176 * tree.c (cxx_print_statistics): Call it.
3179 * decl.c (grokvardecl): Tweak warning message.
3180 (grokfndecl): Likewise.
3182 2010-04-07 Dodji Seketeli <dodji@redhat.com>
3185 *pt.c (tsubst_decl): Get the arguments of a specialization from
3186 the specialization template, not from the most general template.
3188 2010-04-07 Dodji Seketeli <dodji@redhat.com>
3191 * typeck2.c (process_init_constructor_record):
3192 value-initialize members that are are not explicitely
3195 2010-04-07 Jie Zhang <jie@codesourcery.com>
3198 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
3199 when all of its elements are non-constant and have been split out.
3201 2010-04-06 Taras Glek <taras@mozilla.com>
3202 Jason Merrill <jason@redhat.com>
3204 * parser.c (cp_parser_class_specifier): Set class location to that
3205 of IDENTIFIER_NODE instead of '{' when possible.
3206 * semantics.c (begin_class_definition): Do not overide locations
3207 with less precise ones.
3209 2010-04-06 Jason Merrill <jason@redhat.com>
3212 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
3215 * pt.c (maybe_update_decl_type): Check the return value from
3218 2010-04-01 Jason Merrill <jason@redhat.com>
3220 * decl.c (next_initializable_field): No longer static.
3221 * cp-tree.h: Declare it.
3222 * call.c (build_aggr_conv): Fail if there are more initializers
3223 than initializable fields.
3225 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
3226 instead of void_zero_node.
3228 2010-03-31 Dodji Seketeli <dodji@redhat.com>
3231 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
3232 * pt.c (end_template_parm_list): Store sibling template parms of
3233 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
3234 (push_template_decl_real): Don't store the containing template decl
3235 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
3236 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
3237 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
3240 2010-03-30 Jason Merrill <jason@redhat.com>
3243 * pt.c (push_template_decl_real): Deal better with running out of
3244 scopes before running out of template parms.
3248 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
3249 function parameter context. Don't print an error if parsing
3253 * pt.c (more_specialized_fn): Don't control cv-qualifier check
3256 2010-03-26 Jason Merrill <jason@redhat.com>
3259 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
3260 c++0x mode, but not other type-names.
3262 2010-03-26 Dodji Seketeli <dodji@redhat.com>
3265 * pt.c (add_to_template_args): Support NULL ARGS;
3266 (most_specialized_class): call coerce_template_parms on
3267 template arguments passed to get_class_bindings. Use
3268 add_to_template_args.
3269 (unify): Handle VAR_DECLs.
3271 2010-03-26 Dodji Seketeli <dodji@redhat.com>
3273 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
3275 * pt.c (get_template_parms_at_level): Adjust.
3277 2010-03-25 Dodji Seketeli <dodji@redhat.com>
3280 * cp-tree.h (get_template_parms_at_level): Declare ...
3281 * pt.c (get_template_parms_at_level): ... new function.
3282 * typeck.c (get_template_parms_of_dependent_type): If a template
3283 type parm's DECL_CONTEXT isn't yet set, get its siblings from
3284 current_template_parms. Use get_template_parms_at_level. Remove
3286 (incompatible_dependent_types_p): If we get empty parms from just one
3287 of the template type parms we are comparing then the template parms are
3290 2010-03-24 Jason Merrill <jason@redhat.com>
3293 * parser.c (make_declarator): Initialize id_loc.
3294 (cp_parser_lambda_declarator_opt): And set it.
3296 2010-03-23 Jason Merrill <jason@redhat.com>
3298 Make lambda conversion op and op() non-static.
3299 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
3300 Also add the thunk function returned by the conversion op.
3301 Mark the conversion deleted if the op() is variadic.
3302 * decl2.c (mark_used): Give helpful message about deleted conversion.
3303 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
3304 * semantics.c (finish_this_expr): Adjust.
3305 * mangle.c (write_closure_type_name): Adjust.
3306 * decl.c (grok_op_properties): Don't allow it.
3307 * call.c (build_user_type_conversion_1): No static conversion ops.
3308 (build_op_call): Or op().
3310 * decl2.c (change_return_type): Fix 'this' quals.
3312 2010-03-22 Jason Merrill <jason@redhat.com>
3315 * tree.c (pod_type_p): Use old meaning in C++98 mode.
3318 * pt.c (contains_auto_r): New fn.
3319 (do_auto_deduction): Use it.
3320 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3322 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
3325 * decl2.c (grokfield): Handle invalid initializers for member
3328 2010-03-20 Dodji Seketeli <dodji@redhat.com>
3331 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3333 * decl2.c (vague_linkage_p): Likewise.
3335 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3338 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3339 false, in the cp_parser_expression_statement call.
3341 2010-03-05 Jason Merrill <jason@redhat.com>
3343 * mangle.c (mangle_decl): Give name collision error even without
3346 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
3348 * pt.c (process_partial_specialization): Use error_n instead of
3351 2010-03-03 Jason Merrill <jason@redhat.com>
3354 * mangle.c (mangle_decl): Handle VAR_DECL, too.
3356 2010-03-03 Jason Merrill <jason@redhat.com>
3359 * mangle.c: Include cgraph.h.
3360 (mangle_decl): If the mangled name will change in a later
3361 ABI version, make the later mangled name an alias.
3362 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3363 * Make-lang.in (mangle.o): Depend on cgraph.h.
3364 * method.c (make_alias_for): Handle VAR_DECL, too.
3365 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3366 * tree.c (no_linkage_check): Adjust.
3367 * decl.c (maybe_commonize_var): Adjust.
3368 * cp-tree.h: Adjust.
3370 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
3372 * pt.c (redeclare_class_template): Use error_n and inform_n.
3374 2010-02-27 Mark Mitchell <mark@codesourcery.com>
3377 * cp-tree.h (push_tinst_level): Declare.
3378 (pop_tinst_level): Likewise.
3379 * pt.c (push_tinst_level): Give it external linkage.
3380 (pop_tinst_level): Likewise.
3381 * mangle.c (mangle_decl_string): Set the source location to that
3382 of the decl while mangling.
3384 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3387 * pt.c (redeclare_class_template): Return false if there are erroneous
3388 template parameters.
3390 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3392 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3395 2010-02-24 Jason Merrill <jason@redhat.com>
3398 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3400 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3401 in a previous ABI version.
3403 2010-02-23 Jason Merrill <jason@redhat.com>
3406 * typeck2.c (digest_init_r): Accept value init of array.
3408 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3411 * typeck.c (convert_arguments): Update error message.
3413 2010-02-22 Mike Stump <mikestump@comcast.net>
3416 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3418 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3421 * error.c (print_instantiation_partial_context_line): New.
3422 (print_instantiation_partial_context): Print at most 12 contexts,
3423 skip the rest with a message.
3425 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3428 * pt.c (lookup_template_class): Better support of specialization
3429 of member of class template implicit instantiation.
3431 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3434 * call.c (conversion_null_warnings): Replace -Wconversion with
3436 * cvt.c (build_expr_type_conversion): Likewise.
3438 2010-02-18 Jason Merrill <jason@redhat.com>
3441 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3444 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3446 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3447 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3450 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3454 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3455 (maybe_update_decl_type): New fn.
3456 * parser.c (cp_parser_init_declarator): Use it.
3459 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3461 2010-02-17 Jason Merrill <jason@redhat.com>
3464 * call.c (build_over_call): Don't create zero-sized assignments.
3465 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3466 * cp-objcp-common.c (cp_expr_size): Remove.
3467 * cp-tree.h: Remove prototype.
3470 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3471 decl we looked up doesn't match.
3474 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3475 have an INIT_EXPR anymore.
3478 * pt.c (convert_nontype_argument): Change assert to test.
3480 2010-02-16 Jason Merrill <jason@redhat.com>
3482 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3485 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3486 VIEW_CONVERT_EXPR for conversions between structural equality types
3487 that the back end can't tell are the same.
3490 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3491 cv-quals from element here.
3492 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3494 2010-02-14 Jason Merrill <jason@redhat.com>
3497 * semantics.c (finish_compound_literal): Use
3498 cp_apply_type_quals_to_decl when creating a static variable.
3500 2010-02-12 Jason Merrill <jason@redhat.com>
3503 * name-lookup.h (current_binding_level): Check for null
3506 2010-02-12 Jason Merrill <jason@redhat.com>
3509 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3511 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3514 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3517 2010-02-10 Jason Merrill <jason@redhat.com>
3520 * semantics.c (outer_lambda_capture_p): Revert.
3521 (add_capture): Only finish_member_declaration if
3522 we're in the lambda class.
3523 (register_capture_members): New.
3524 * cp-tree.h: Declare it.
3525 * parser.c (cp_parser_lambda_expression): Call it.
3527 2010-02-10 Jason Merrill <jason@redhat.com>
3530 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3531 instead of current_class_type.
3533 2010-02-10 Jason Merrill <jason@redhat.com>
3535 PR c++/42983, core issue 906
3536 * method.c (defaultable_fn_check): Check virtualness.
3538 2010-02-10 Jason Merrill <jason@redhat.com>
3541 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3543 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3545 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3546 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3548 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3549 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3550 (cp_parser_parameter_declaration)
3551 (cp_parser_exception_specification_opt)
3552 (cp_parser_exception_declaration): Likewise.
3553 * pt.c (check_default_tmpl_args): Likewise.
3554 * search.c (lookup_field_r): Likewise.
3556 2010-02-09 Jason Merrill <jason@redhat.com>
3559 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3561 2010-02-09 Jason Merrill <jason@redhat.com>
3564 * decl2.c (change_return_type): New fn.
3565 * semantics.c (apply_lambda_return_type): Use it.
3566 * cp-tree.h: Declare it.
3568 2010-02-05 Richard Guenther <rguenther@suse.de>
3570 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3571 * cp-lang.c: Include gt-cp-cp-lang.h.
3572 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3574 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3577 * typeck.c (get_template_parms_of_dependent_type): Try getting
3578 the template parameters fromt the type itself first.
3580 2010-02-03 Jason Merrill <jason@redhat.com>
3584 * mangle.c (write_unqualified_id): Split out from write_expression.
3585 (write_unqualified_name): Call it.
3586 (write_member_name): Likewise.
3587 (write_expression): Support TEMPLATE_ID_EXPR.
3588 Disambiguate operator names.
3591 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3594 2010-02-02 Jason Merrill <jason@redhat.com>
3597 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3598 * optimize.c (clone_body): Remap their initializers when making base
3600 (maybe_clone_body): Complain if multiple clones aren't safe.
3602 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3609 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3610 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3611 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3612 * pt.c (coerce_template_parms, type_unification_real,
3613 expand_template_argument_pack, coerce_template_parameter_pack):
3614 Set the non default template args count.
3615 (current_template_args): Always set non defaulted
3616 template args count when compiled with --enable-checking
3617 (tsubst_template_args, type_unification_real): Propagate the non
3618 defaulted template args count.
3619 * error.c (get_non_default_template_args_count): Renamed
3620 count_non_default_template_args into this. Don't calculate the
3621 non default template argument count anymore. Use the new
3622 accessor macros above to get it.
3623 (dump_template_argument_list, dump_type, dump_decl,
3624 dump_template_parms): Adjust.
3625 * parser.c (cp_parser_template_argument_list): Always set defaulted
3626 template args count when compiled with --enable-checking.
3628 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3630 * decl.c (redeclaration_error_message): Wrap the return messages into
3631 G_() for easy translation.
3633 2010-01-28 Jason Merrill <jason@redhat.com>
3636 * semantics.c (begin_class_definition): Don't use type_as_string.
3638 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3642 * typeck.c (get_template_parms_of_dependent_type): Factorized
3643 this out of incompatible_template_type_parms_p
3644 (incompatible_dependent_types_p): Renamed
3645 incompatible_template_type_parms_p into this. Make it detect
3646 two incompatible dependent typedefs too.
3647 (structural_comptypes): Use incompatible_dependent_types_p.
3648 * pt.c (get_template_info):
3649 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3651 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3652 Jason Merrill <jason@redhat.com>
3654 * mangle.c (write_type): Mangle transparent record as member type.
3655 * semantics.c (begin_class_definition): Recognize decimal classes
3656 and set TYPE_TRANSPARENT_AGGR.
3658 2010-01-20 Jason Merrill <jason@redhat.com>
3661 * mangle.c (write_expression): Handle tree codes that have extra
3662 arguments in the middle-end.
3664 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3667 * except.c (expand_start_catch_block): Deal correctly with
3668 do_begin_catch returning error_mark_node.
3670 2010-01-20 Jason Merrill <jason@redhat.com>
3673 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3677 * semantics.c (build_lambda_object): Call mark_used on captured
3681 * decl.c (grokdeclarator): Clear type_quals for a member function
3682 declared using a typedef. Don't complain about adding cv-quals
3683 to a function typedef in C++0x mode.
3685 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3687 * decl.c (create_array_type_for_decl): Remove set but not used
3688 variable error_msg. Remove break stmts after return stmts.
3690 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3692 * error.c (dump_template_parms, count_non_default_template_args):
3693 Revert fix of PR c++/42634.
3695 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3698 * error.c (dump_template_parms): Use innermost template
3699 arguments before calling count_non_default_template_args.
3700 (count_non_default_template_args): We are being called with
3701 template innermost arguments now. There is no need to ensure
3704 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3707 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3709 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3712 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3714 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3717 *pt.c (tsubst_decl): Get the arguments of a specialization from
3718 the specialization template, not from the most general template.
3720 2010-01-16 Jason Merrill <jason@redhat.com>
3723 * semantics.c (finish_decltype_type): Within a template, treat
3724 unresolved CALL_EXPR as dependent.
3726 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3728 * error.c (dump_template_parms,count_non_default_template_args):
3729 Revert changes of PR c++/42634.
3731 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3734 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3735 functions with noreturn attribute.
3737 2010-01-14 Jason Merrill <jason@redhat.com>
3740 * call.c (build_new_method_call): Don't free the vec here.
3743 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3745 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3748 * error.c (dump_template_parms): Use innermost template
3749 arguments before calling count_non_default_template_args.
3750 (count_non_default_template_args): We are being called with
3751 template innermost arguments now. There is no need to ensure
3754 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3757 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3758 arguments that were previously deduced.
3760 2010-01-05 Jason Merrill <jason@redhat.com>
3762 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3763 * call.c (build_over_call): Don't complain about it.
3765 2010-01-04 Jason Merrill <jason@redhat.com>
3768 * pt.c (tsubst_decl): Don't apply type attributes in place.
3771 * semantics.c (describable_type): Remove decltype comment and
3776 Copyright (C) 2010 Free Software Foundation, Inc.
3778 Copying and distribution of this file, with or without modification,
3779 are permitted in any medium without royalty provided the copyright
3780 notice and this notice are preserved.