1 2012-07-20 Jason Merrill <jason@redhat.com>
4 * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
5 canonical array type rather than mess with its TYPE_*_VARIANT.
7 2012-07-19 Jason Merrill <jason@redhat.com>
10 * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
13 * call.c (build_cxx_call): Set optimize when folding
14 __builtin_constant_p in a constexpr function.
16 2012-07-18 Jason Merrill <jason@redhat.com>
18 * pt.c (instantiate_decl): Don't recheck substitutions.
20 2012-07-18 Paolo Carlini <paolo.carlini@oracle.com>
21 Jason Merrill <jason@redhat.com>
25 * semantics.c (perform_access_checks): Add complain parm, return bool.
26 (perform_deferred_access_checks): Likewise.
27 (perform_or_defer_access_check): Likewise.
28 (speculative_access_check): Remove.
29 * call.c (enforce_access): Add complain parm, return bool.
30 * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
31 * search.c: Adjust callers.
32 * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
33 (FNDECL_RECHECK_ACCESS_P): New macro.
34 * method.c (synthesized_method_walk): Stop deferring access checks.
35 * pt.c (recheck_decl_substitution): New.
36 (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
38 2012-07-18 Jason Merrill <jason@redhat.com>
40 * method.c (process_subob_fn): Make sure no_implicit_p is non-null
41 before trying to store through it.
43 2012-07-17 Jason Merrill <jason@redhat.com>
46 * decl.c (finish_enum_value_list): Only call
47 insert_late_enum_def_into_classtype_sorted_fields in class scope.
50 * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
51 to the list of variants.
53 * decl.c (xref_basetypes): Complain about incomplete template base.
54 * class.c (finish_struct): Adjust variants in templates, too.
57 * parser.c (cp_parser_class_head): Call xref_basetypes here.
58 (cp_parser_class_specifier_1): Not here.
59 * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
60 as well as DECL_DEPENDENT_P.
62 2012-07-16 Jason Merrill <jason@redhat.com>
64 * cp-tree.h (struct deferred_access_check): Add location.
65 * semantics.c (perform_access_checks): Use it.
66 (perform_or_defer_access_check): Store it.
68 2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
70 * dump.c (dump_stmt): Moved here from c-dump.c.
71 * optimize.c: Include dumpfile.h instead of tree-dump.h.
74 * Make-lang.in: Fix dependencies.
76 2012-07-13 Jason Merrill <jason@redhat.com>
79 * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
81 2012-07-12 Jason Merrill <jason@redhat.com>
83 * pt.c (instantiate_decl): Check typedefs access here.
84 (instantiate_template_1): Not here.
86 * pt.c (deduction_tsubst_fntype): Just suppress access checking.
87 (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
88 (push_deduction_access_scope, pop_deduction_access_scope): Remove.
90 2012-07-11 Jason Merrill <jason@redhat.com>
93 * method.c (synthesized_method_walk): Replace uses of msg with diag.
94 Correct handling of virtual bases with move operations.
95 (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
97 2012-07-11 Steven Bosscher <steven@gcc.gnu.org>
99 * method.c: Do not include tree-pass.h.
101 2012-07-10 Jason Merrill <jason@redhat.com>
105 * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
106 (struct lang_decl_fn): Add suppress_implicit_decl field.
107 * method.c (implicitly_declare_fn): Check it.
108 (process_subob_fn): Add no_implicit_p parm.
109 (walk_field_subobs, synthesized_method_walk): Likewise.
110 (maybe_explain_implicit_delete): Adjust.
111 (explain_implicit_non_constexpr): Adjust.
113 * method.c (synthesized_method_walk): Avoid changing
114 EH spec based on cleanups in other places, too.
116 2012-07-09 Sterling Augustine <saugustine@google.com>
118 * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
120 2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
122 * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
124 2012-07-06 Jason Merrill <jason@redhat.com>
127 * pt.c (tsubst_arg_types): Add "end" parameter.
128 (check_undeduced_parms): Use it.
130 * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
133 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
135 2012-07-05 Jason Merrill <jason@redhat.com>
138 * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
141 * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
142 (struct template_parm_index_s): Remove num_siblings.
143 * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
144 (fixup_template_type_parm_type): Remove.
145 (build_template_parm_index): Remove num_siblings parm.
146 (process_template_parm): Likewise.
147 * parser.c (cp_parser_template_parameter_list): Adjust.
148 * tree.c (cp_tree_equal): Don't compare num_siblings.
149 * typeck.c (comp_template_parms_position): Likewise.
153 * tree.c (strip_typedefs_expr): New.
154 * cp-tree.h: Declare it.
155 * pt.c (convert_template_argument, unify): Use it.
156 * parser.c (cp_parser_template_declaration_after_export): Don't call
157 fixup_template_parms.
159 2012-07-04 Jason Merrill <jason@redhat.com>
163 * decl.c (build_enumerator): Don't use build_lang_decl_loc.
165 2012-07-03 Jakub Jelinek <jakub@redhat.com>
168 * semantics.c (finish_goto_stmt): Surround computed goto argument
169 with CLEANUP_POINT_EXPR if needed.
171 2012-07-02 Jason Merrill <jason@redhat.com>
174 * pt.c (in_template_function): New.
175 * cp-tree.h: Declare it.
176 * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
179 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
180 for LAMBDA_EXPR_EXTRA_SCOPE.
183 * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
186 * class.c (resolves_to_fixed_type_p): Check uses_template_parms
187 (current_function_decl) instead of processing_template_decl.
190 * semantics.c (maybe_add_lambda_conv_op): Don't set
191 DECL_INTERFACE_KNOWN.
194 * call.c (build_conditional_expr_1): Don't warn about comparison of
195 two enumerators before their enumeration is complete.
196 (build_new_op_1): Call decay_conversion before warn_logical_operator.
197 * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
199 * decl2.c (mark_used): Call used_types_insert for enums.
200 * semantics.c (finish_id_expression): Don't decay CONST_DECL.
201 (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
202 * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
203 * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
204 (build_class_member_access_expr): Look through unscoped enums.
205 * search.c (context_for_name_lookup): Look through unscoped enums.
206 * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
207 (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
208 * tree.c (decl_linkage): Likewise.
209 * cvt.c (ocp_convert): Check decayed expr for enum range warning.
211 2012-06-29 Steven Bosscher <steven@gcc.gnu.org>
213 * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
215 2012-06-27 Jason Merrill <jason@redhat.com>
217 * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
218 (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
219 (cp_parser_elaborated_type_specifier): Adjust.
220 * decl.c (duplicate_decls): Return error_mark_node on template
224 * parser.c (cp_parser_template_id): Add tag_type parm.
225 (cp_parser_template_name): Likewise.
226 (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
227 (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
228 (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
229 (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
231 2012-06-27 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
234 * semantics.c (constexpr_call): Fix typo in comment.
235 (cxx_eval_vec_perm_expr): New.
236 (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
238 2012-06-26 Richard Guenther <rguenther@suse.de>
241 * mangle.c (write_array_type): Truncate the number-of-elements
244 2012-06-25 Jason Merrill <jason@redhat.com>
248 * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
249 if cp_unevaluated_operand is set.
250 (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
253 * typeck.c (decay_conversion): Don't discard side-effects from
254 expressions of nullptr_t.
256 2012-06-25 Florian Weimer <fweimer@redhat.com>
258 * init.c (build_new_1): Warn about (T[N]) for variable N, and
261 * parser.c (cp_parser_direct_new_declarator): Accept non-constant
262 expressions. Handled now in build_new_1.
264 2012-06-25 Jason Merrill <jason@redhat.com>
267 * semantics.c (build_data_member_initialization): Always keep
268 initializer for empty base.
269 (cxx_eval_bare_aggregate): Discard it here.
272 * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
273 (tsubst_expr) [OMP_FOR]: Here, too.
275 2012-06-25 Jakub Jelinek <jakub@redhat.com>
278 * class.c (check_bases_and_members): Avoid -Wuninitialized
279 diagnostics for non-static const members or references if they
282 2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
284 * parser.c (cp_parser_direct_declarator): Move virt-specifier
285 parsing after late-specified return type parsing.
287 2012-06-14 Jason Merrill <jason@redhat.com>
290 * name-lookup.c (constructor_name_p): Don't try to look at the
291 name of a DECLTYPE_TYPE.
293 2012-06-18 Lawrence Crowl <crowl@google.com>
295 * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
298 2012-06-18 Steven Bosscher <steven@gcc.gnu.org>
300 * decl.c (finish_function): Remove code conditional on VMS_TARGET.
302 2012-06-15 Marc Glisse <marc.glisse@inria.fr>
305 * semantics.c (literal_type_p): Handle VECTOR_TYPE.
306 (potential_constant_expression_1): Handle VEC_PERM_EXPR.
307 * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
309 2012-06-09 Jason Merrill <jason@redhat.com>
311 * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
312 * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
313 * decl2.c (finish_static_data_member_decl): Avoid redundant error.
316 * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
317 * semantics.c (finish_cond): Build a COMPOUND_EXPR.
318 * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
319 [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
320 Don't return the decl.
322 2012-06-11 Richard Guenther <rguenther@suse.de>
325 * mangle.c (write_array_type): Use double-ints for array domain
328 2012-06-07 Fabien ChĂȘne <fabien@gcc.gnu.org>
331 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
333 * class.c (insert_into_classtype_sorted_fields): New.
334 (add_enum_fields_to_record_type): New.
335 (count_fields): Adjust the comment.
336 (add_fields_to_record_type): Likewise.
337 (finish_struct_1): Move the code that inserts the fields for the
338 sorted case, into insert_into_classtype_sorted_fields, and call
340 (insert_late_enum_def_into_classtype_sorted_fields): Define.
341 * decl.c (finish_enum_value_list): Call
342 insert_late_enum_def_into_classtype_sorted_fields if a late enum
343 definition is encountered.
345 2012-06-06 Paolo Carlini <paolo.carlini@oracle.com>
348 * typeck.c (cp_perform_integral_promotions): New, like
349 perform_integral_promotions but also takes a tsubst_flags_t parameter.
350 (pointer_diff): Add tsubst_flags_t parameter.
351 (decay_conversion, cp_default_conversion, cp_build_array_ref,
352 cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
353 build_reinterpret_cast_1, cp_build_modify_expr,
354 convert_for_assignment): Adjust.
355 * optimize.c (build_delete_destructor_body): Adjust.
356 * init.c (expand_virtual_init, expand_default_init, build_new_1,
357 build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
358 (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
359 * class.c (build_base_path): Adjust.
360 * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
361 * method.c (synthesized_method_walk): Adjust flag and complain.
362 * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
363 (build_typeid, build_dynamic_cast_1): Adjust.
364 * except.c (initialize_handler_parm): Likewise.
365 * typeck2.c (process_init_constructor_record): Likewise.
366 * pt.c (tsubst_friend_class): Don't change flags.
367 * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
368 finish_static_assert): Likewise.
369 * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
371 * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
372 (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
374 (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
375 (implicit_conversion): Mask out tf_error with a FIXME.
376 (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
377 complain & tf_error instead of flags & LOOKUP_COMPLAIN.
378 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
379 build_up_reference, convert_to_reference, cp_convert,
380 cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
382 (convert_to_reference, ocp_convert): Use complain & tf_error instead
383 of flags & LOOKUP_COMPLAIN.
384 (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
385 * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
386 lookup_name_real, lookup_function_nonclass, lookup_name,
387 lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
388 * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
390 2012-06-06 Steven Bosscher <steven@gcc.gnu.org>
392 * decl.c: Do not include output.h.
393 (start_decl): Remove code for flag_conserve_space.
395 2012-06-06 Fabien ChĂȘne <fabien@gcc.gnu.org>
398 * parser.c (cp_parser_alias_declaration): Return earlier
401 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
404 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
405 to control enumeral mismatch in conditional expression too.
407 2012-06-04 Sterling Augustine <saugustine@google.com>
409 * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
410 * cp-lang.c (cxx_dwarf_name): Call them.
412 2012-06-04 Steven Bosscher <steven@gcc.gnu.org>
414 * semantics.c: Do not include output.h.
416 * friend.c: Likewise.
417 * typeck.c: Likewise.
418 * typeck2.c: Likewise.
419 * Make-lang.in: Fix dependencies.
421 2012-06-01 Jason Merrill <jason@redhat.com>
424 * parser.c (cp_parser_class_head): Apply attributes here.
425 * semantics.c (begin_class_definition): Not here.
429 * parser.c (cp_parser_binary_expression): Bail early if we're parsing
430 tentatively and the LHS has a parse error.
433 * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
434 (instantiate_decl): Don't push_to_top_level for local class methods.
435 (instantiate_class_template_1): Or for local classes.
438 * pt.c (do_auto_deduction): Don't try to deduce from a
439 type-dependent initializer.
441 2012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
444 * name-lookup.c (push_namespace): When error recovery is
445 impossible just error out in duplicate_decls.
447 2012-05-31 Steven Bosscher <steven@gcc.gnu.org>
449 * call.c: Do not include output.h.
451 * except.c: Likewise.
452 * friend.c: Likewise.
455 * method.c: Likewise.
456 * parser.c: Likewise.
459 * search.c: Likewise.
461 2012-05-30 Jason Merrill <jason@redhat.com>
464 * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
465 representing a bitwise copy of a glvalue.
467 * tree.c (stabilize_expr): Tweak logic.
470 * tree.c (stabilize_init): Side effects make the init unstable.
472 2012-05-28 Paolo Carlini <paolo.carlini@oracle.com>
475 * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
477 2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
480 * tree.c (stabilize_expr): Handle exp of void type.
482 2012-05-26 Jason Merrill <jason@redhat.com>
485 * call.c (convert_like_real) [ck_list]: Take array address directly.
486 * typeck.c (decay_conversion): Reject decay of an array compound
489 2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
492 * parser.c (cp_parser_member_declaration): A storage class is not
493 allowed in a declaration of an anonymous aggregate in a class scope.
495 2012-05-24 Uros Bizjak <ubizjak@gmail.com>
498 * decl.c (grokdeclarator): Check that current_class_type is non-NULL
499 before calling constructor_name_p.
501 2012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
504 * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
505 cp_parser_function_body): Add a bool parameter, true when parsing
506 a function-try-block.
507 (cp_parser_function_try_block): Pass true to the above.
508 (cp_parser_function_definition_after_declarator,
509 cp_parser_function_transaction): Adjust.
511 2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
514 * decl2.c (delete_sanity): Extend 'deleting array' warning to
517 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
520 * decl.c (grokdeclarator): Diagnose functions returning abstract
521 class types as TYPENAME.
522 * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
523 * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
524 * pt.c (tsubst): Likewise.
525 * semantics.c (trait_expr_value): Likewise.
527 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
530 * parser.c (cp_parser_attributes_opt): Enforce error checking of
531 unbalanced parentheses in the presence of tentative parsing.
533 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
536 * parser.c (cp_parser_new_type_id): Early return error_mark_node
537 if the cp_parser_type_specifier_seq call has type_specifier_seq.type
538 error_mark_node; tidy.
539 (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
540 avoid uninitialized warnings.
541 (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
542 Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
543 returns error_mark_node.
545 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
548 * except.c (is_admissible_throw_operand): Rename to
549 is_admissible_throw_operand_or_catch_parameter and handle
551 (expand_start_catch_block): Use it.
552 (build_throw): Adjust.
554 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
557 * typeck.c (build_x_array_ref, build_x_conditional_expr,
558 build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
559 (finish_class_member_access_expr, build_x_indirect_ref,
560 build_x_binary_op, build_x_compound_expr_from_list,
561 build_x_compound_expr_from_vec): Adjust callers.
562 * tree.c (build_min_nt_loc): New.
563 (build_min_nt): Remove.
564 * typeck2.c (build_x_arrow): Adjust callers.
565 * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
566 tsubst_copy_and_build): Likewise.
567 * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
568 finish_omp_atomic): Likewise.
569 * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
570 * parser.c (cp_parser_question_colon_clause,
571 cp_parser_assignment_expression, cp_parser_expression,
572 cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
575 2012-05-16 Dodji Seketeli <dodji@redhat.com>
578 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
579 the possible declarator specifiers so far.
580 (struct cp_decl_specifier_seq::locations): Declare new member.
581 (cp_decl_specifier_seq::{specs, type_location}): Remove.
582 (decl_spec_seq_has_spec_p): Declare new function.
583 * parser.c (cp_parser_check_decl_spec): Remove.
584 (set_and_check_decl_spec_loc): Define new static function.
585 (decl_spec_seq_has_spec_p): Define new public function.
586 (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
587 (cp_parser_type_specifier, cp_parser_simple_type_specifier)
588 (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
589 (cp_parser_alias_declaration): Set the locations for each
590 declspec, using set_and_check_decl_spec_loc.
591 (cp_parser_explicit_instantiation, cp_parser_init_declarator)
592 (cp_parser_member_declaration, cp_parser_init_declarator): Use the
593 new declspec location for specifiers. Use the new
594 decl_spec_seq_has_spec_p.
595 (cp_parser_type_specifier_seq): Use the new
596 set_and_check_decl_spec_loc. Stop using
597 cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
598 (, cp_parser_init_declarator): Use the new
599 set_and_check_decl_spec_loc.
600 (cp_parser_single_declaration, cp_parser_friend_p)
601 (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
602 Use the new decl_spec_seq_has_spec_p.
603 * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
604 the more precise ds_redefined_builtin_type_spec location for
605 diagnostics about re-declaring C++ built-in types.
606 (start_decl, grokvardecl, grokdeclarator): Use the new
607 decl_spec_seq_has_spec_p.
609 2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
612 * pt.c (tsubst_copy_and_build): Increase / decrease
613 c_inhibit_evaluation_warnings around build_x_binary_op call.
615 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
617 * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
618 (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
619 (TYPE_PTR_OR_PTRMEM_P): Add.
620 * typeck.c (composite_pointer_type_r, composite_pointer_type,
621 common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
622 cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
623 build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
624 casts_away_constness_r, casts_away_constness): Adjust.
625 * init.c (build_zero_init_1): Adjust.
626 * class.c (check_field_decls): Likewise.
627 * decl.c (check_default_argument): Likewise.
628 * rtti.c (target_incomplete_p): Likewise.
629 * tree.c (zero_init_p): Likewise.
630 * cxx-pretty-print.c (pp_cxx_ptr_operator,
631 pp_cxx_abstract_declarator): Likewise.
632 * typeck2.c (build_m_component_ref): Likewise.
633 * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
634 dependent_type_p_r): Likewise.
635 * call.c (null_member_pointer_value_p, standard_conversion,
636 add_builtin_candidate, build_conditional_expr_1, compare_ics):
638 * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
639 * cvt.c (cp_convert_to_pointer, ocp_convert,
640 perform_qualification_conversions): Likewise.
641 * mangle.c (write_type): Likewise.
642 * name-lookup.c (arg_assoc_type): Likewise.
644 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
646 * parser.c (struct cp_parser_expression_stack_entry): Add location_t
648 (cp_parser_binary_expression): Rework to always update at the same
649 time tree_type and loc.
650 * call.c (print_z_candidate): Add location_t parameter.
651 (print_z_candidates, convert_like_real, joust): Adjust.
653 2012-05-11 Alexandre Oliva <aoliva@redhat.com>
656 * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
658 2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
661 * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
662 tsubst_decl returns NULL_TREE.
663 * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
664 BOUND_TEMPLATE_TEMPLATE_PARM.
666 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
669 * cvt.c (ocp_convert): Error out early for void -> bool conversions.
670 * typeck.c (decay_conversion): Use error_at.
671 * call.c (build_integral_nontype_arg_conv, convert_like_real,
672 convert_arg_to_ellipsis, perform_implicit_conversion_flags,
673 initialize_reference): Likewise.
674 * cvt.c (warn_ref_binding): Add location_t parameter.
675 (cp_convert_to_pointer, convert_to_reference, ocp_convert,
676 convert_to_void, ): Use error_at and warning_at.
678 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
681 * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
682 instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
684 2012-05-06 Paolo Carlini <paolo.carlini@oracle.com>
687 * call.c (op_error, build_new_op_1, build_new_op): Add location_t
689 (build_conditional_expr_1): Adjust.
690 * typeck.c (build_x_indirect_ref, build_x_binary_op,
691 build_x_unary_op): Add location_t parameter.
692 (rationalize_conditional_expr, build_x_array_ref,
693 build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
695 * typeck2.c (build_x_arrow): Add location_t parameter.
696 * semantics.c (finish_unary_op_expr): Likewise.
697 (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
698 * decl2.c (grok_array_decl): Add location_t parameter.
699 * parser.c (cp_parser_postfix_open_square_expression,
700 cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
701 cp_parser_binary_expression, cp_parser_builtin_offsetof,
702 do_range_for_auto_deduction, cp_convert_range_for,
703 cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
705 * pt.c (tsubst_copy_and_build): Adjust.
706 * tree.c (maybe_dummy_object): Likewise.
707 * cp-tree.h: Update declarations.
709 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
711 * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
713 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
716 * pt.c (instantiate_class_template_1): Increase / decrease
717 c_inhibit_evaluation_warnings around the tsubst_expr call
718 for STATIC_ASSERT_CONDITION.
719 (tsubst_expr, case STATIC_ASSERT): Likewise.
720 * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
721 c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
723 2012-05-03 Paolo Carlini <paolo.carlini@oracle.com>
726 * call.c (build_over_call): Handle final member functions
728 (build_new_method_call_1): Do not handle here.
730 2012-05-02 Richard Guenther <rguenther@suse.de>
732 * decl.c (grokdeclarator): Properly check for sizes that
733 cover more than half of the address-space.
735 2012-04-30 Marc Glisse <marc.glisse@inria.fr>
738 * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
739 * decl2.c (grok_array_decl): Likewise.
742 * parser.c (cp_parser_sizeof_operand): Require parentheses for
745 2012-04-30 Dodji Seketeli <dodji@redhat.com>
747 Fix location for static class members
748 * decl.c (grokdeclarator): Use the location carried by the
749 declarator for the DECL of the static class member.
751 Fix va_arg type location
752 * cp-tree.h (build_x_va_arg): Take an additional location
754 * call.c (build_x_va_arg): Take a loc parameter for the location
755 of the type of the va_arg expression.
756 * parser.c (cp_parser_primary_expression): Pass the type of the
757 type in the va_arg expression to build_x_va_arg.
758 * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
760 Make conversion warnings work on NULL with -ftrack-macro-expansion
761 * call.c (conversion_null_warnings): Use the new
762 expansion_point_location_if_in_system_header.
763 * cvt.c (build_expr_type_conversion): Likewise.
764 * typeck.c (cp_build_binary_op): Likewise.
766 2012-04-30 Manuel López-Ibåñez <manu@gcc.gnu.org>
768 * typeck.c (convert_for_assignment): Replace
769 Wmissing-format-attribute with Wsuggest-attribute=format.
770 * call.c (convert_for_arg_passing): Likewise.
772 2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
775 * class.c (check_bases_and_members): Implement core/1333, do not
776 disallow defaulted in the class body non-const ref special members.
778 2012-04-24 Paolo Carlini <paolo.carlini@oracle.com>
781 * call.c (tourney, perform_overload_resolution,
782 build_operator_new_call, build_user_type_conversion_1,
783 build_user_type_conversion, perform_overload_resolution,
784 add_template_candidate, add_template_candidate_real,
785 add_template_conv_candidate, add_builtin_candidates,
786 add_builtin_candidate, build_builtin_candidate,
787 add_conv_candidate, add_function_candidate, implicit_conversion,
788 reference_binding, build_list_conv, conditional_conversion,
789 add_candidates, can_convert_array, build_aggr_conv,
790 build_array_conv, build_complex_conv, conditional_conversion):
791 Add tsubst_flags_t parameter.
792 (joust): Likewise, use it to handle SFINAE as if pedantic.
793 (add_list_candidates, build_integral_nontype_arg_conv,
794 perform_overload_resolution, build_new_function_call,
795 build_operator_new_call, build_op_call_1,
796 build_conditional_expr_1, build_new_op_1, convert_like_real,
797 convert_arg_to_ellipsis, convert_default_arg,
798 convert_for_arg_passing, build_over_call,
799 build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
800 perform_implicit_conversion_flags,
801 perform_direct_initialization_if_possible,
802 initialize_reference): Adjust.
803 * typeck.c (casts_away_constness, casts_away_constness_r):
804 Add tsubst_flags_t parameter.
805 (convert_arguments, check_for_casting_away_constness,
806 build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
808 * decl.c (reshape_init_r, check_default_argument): Likewise.
809 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
810 * pt.c (convert_nontype_argument, check_non_deducible_conversion):
812 * init.c (build_new_1): Likewise.
813 * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
814 build_expr_type_conversion, ): Likewise.
815 * search.c (check_final_overrider): Likewise.
816 * cp-tree.h (build_user_type_conversion,
817 build_operator_new_call, can_convert, can_convert_arg,
818 can_convert_arg_bad, convert_default_arg,
819 convert_arg_to_ellipsis, convert_for_arg_passing):
822 2012-04-22 Jan Hubicka <jh@suse.cz>
824 * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
827 2012-04-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
830 * typeck.c (composite_pointer_type): Likewise.
831 (cxx_sizeof_or_alignof_type): Likewise.
832 (cp_build_array_ref): Likewise.
833 (cp_build_function_call_vec): Likewise.
834 (cp_build_addr_expr_1): Likewise.
835 (convert_member_func_to_ptr): Likewise.
836 * decl.c (check_tag_decl): Likewise.
837 (check_static_variable_definition): Likewise.
838 (compute_array_index_type): Likewise.
839 (create_array_type_for_decl): Likewise.
840 (grokdeclarator): Likewise.
841 (grok_op_properties): Likewise.
842 * error.c (maybe_warn_cpp0x): Likewise.
843 * pt.c (maybe_process_partial_specialization): Likewise.
844 (convert_template_argument): Likewise.
845 (do_decl_instantiation): Likewise.
846 (do_type_instantiation): Likewise.
847 * parser.c (cp_parser_primary_expression): Likewise.
848 (cp_parser_postfix_expression): Likewise.
849 (cp_parser_unary_expression): Likewise.
850 (cp_parser_question_colon_clause): Likewise.
851 (cp_parser_lambda_introducer): Likewise.
852 (cp_parser_lambda_declarator_opt): Likewise.
853 (cp_parser_compound_statement): Likewise.
854 (cp_parser_jump_statement): Likewise.
855 (cp_parser_declaration_seq_opt): Likewise.
856 (cp_parser_enum_specifier): Likewise.
857 (cp_parser_enumerator_list): Likewise.
858 (cp_parser_initializer_list): Likewise.
859 (cp_parser_member_declaration): Likewise.
860 * call.c (build_conditional_expr_1): Likewise.
861 * friend.c (make_friend_class): Likewise.
862 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
864 2012-04-21 Jan Hubicka <jh@suse.cz>
866 * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
867 * decl2.c (mark_needed): Likewise.
868 (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
870 * decl2.c (cxx_callgraph_analyze_expr): Remove.
871 * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
872 * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
874 2012-04-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
877 * typeck.c (cp_build_function_call_vec): Do not pretty-print
878 expressions when caret is enabled.
880 2012-04-20 Jan Hubicka <jh@suse.cz>
883 * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
884 list when target has no support for it.
886 2012-04-20 Michael Matz <matz@suse.de>
888 * error.c (pedwarn_cxx98): Move va_end call after user
891 2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
894 * cp-tree.h (build_addr_func, decay_conversion,
895 get_member_function_from_ptrfunc,
896 build_m_component_ref, convert_member_func_to_ptr):
897 Add tsubst_flags_t parameter.
898 * typeck.c (cp_default_conversion): Add.
899 (decay_conversion, default_conversion,
900 get_member_function_from_ptrfunc, convert_member_func_to_ptr):
901 Add tsubst_flags_t parameter and use it throughout.
902 (cp_build_indirect_ref, cp_build_array_ref,
903 cp_build_function_call_vec, convert_arguments, build_x_binary_op,
904 cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
905 build_const_cast_1, expand_ptrmemfunc_cst,
906 convert_for_initialization): Adjust.
907 * init.c (build_vec_init): Adjust.
908 * decl.c (grok_reference_init, get_atexit_node): Likewise.
909 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
910 * except.c (build_throw): Likewise.
911 * typeck2.c (build_x_arrow): Likewise.
912 (build_m_component_ref): Add tsubst_flags_t parameter and
914 * pt.c (convert_nontype_argument): Adjust.
915 * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
916 * decl2.c (build_offset_ref_call_from_tree): Likewise.
917 * call.c (build_addr_func): Add tsubst_flags_t parameter and
919 (build_call_a, build_conditional_expr_1, build_new_op_1,
920 convert_like_real, convert_arg_to_ellipsis, build_over_call,
921 build_special_member_call): Adjust.
922 * cvt.c (cp_convert_to_pointer, force_rvalue,
923 build_expr_type_conversion): Likewise.
925 2012-04-17 Tom de Vries <tom@codesourcery.com>
927 * cp-gimplify.c (begin_bc_block): Add location parameter and use as
928 location argument to create_artificial_label.
929 (finish_bc_block): Change return type to void. Remove body_seq
930 parameter, and add block parameter. Append label to STMT_LIST and
932 (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
933 (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
934 (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
935 (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
936 (genericize_break_stmt, genericize_omp_for_stmt): New function.
937 (cp_gimplify_omp_for): Remove bc_continue processing.
938 (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
939 (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
940 CONTINUE_STMT, and BREAK_STMT as unreachable.
941 (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
942 SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
943 (cp_genericize_tree): New function, factored out of ...
944 (cp_genericize): ... this function.
946 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
949 * semantics.c (build_constexpr_constructor_member_initializers):
950 Check for function-try-block as function-body.
952 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
955 * parser.c (cp_parser_member_declaration): Check that
956 initializer_token_start is non null before dereferencing it.
958 2012-04-16 Jason Merrill <jason@redhat.com>
961 * pt.c (determine_specialization): Instead of comparing the number
962 of parms, check that tsubst gives the right answer.
965 * pt.c (process_partial_specialization): Complain about a partial
966 specialization with fewer args than primary template parms.
969 * pt.c (convert_template_argument): Handle template template
973 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
976 2012-04-16 Paolo Carlini <paolo.carlini@oracle.com>
979 * call.c (op_error): Print types; when flag_diagnostics_show_caret
980 is false print expressions too.
981 (op_error_string): Add.
983 2012-04-16 Jason Merrill <jason@redhat.com>
986 * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
988 2012-04-16 Jan Hubicka <jh@suse.cz>
990 * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
991 walkers to walk cgraph and varpool.
993 2012-04-15 Jason Merrill <jason@redhat.com>
996 * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
1000 * pt.c (coerce_template_parms): Even if we aren't converting we
1001 want to expand argument packs.
1004 * mangle.c (write_type): nullptr_t is a builtin type.
1006 2012-04-14 Jan Hubicka <jh@suse.cz>
1008 * tree.c: Update field referenced for new cgraph/varpool layout.
1009 * decl2.c: Likewise.
1011 2012-04-13 Jason Merrill <jason@redhat.com>
1014 * pt.c (any_pack_expanson_args_p): New.
1015 (coerce_template_parms): Use it.
1018 * call.c (joust): Handle comparing list and non-list ctors.
1021 * decl2.c (finish_anon_union): Use cp_finish_decl.
1022 * error.c (dump_function_name): Avoid showing anonymous "name".
1024 2012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
1027 * parser.c (cp_parser_class_name): Call strip_using_decl and
1028 return the target decl.
1029 * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
1030 to be stripped is NULL_TREE.
1031 (qualify_lookup): Call strip_using_decl and perform some checks on
1034 2012-04-11 Jason Merrill <jason@redhat.com>
1037 * decl.c (grokdeclarator): Strip the injected-class-name typedef
1038 if we are building a declaration or compound type.
1041 * decl.c (check_tag_decl): Don't complain about attributes if we
1042 don't even have a type.
1044 2012-04-10 Manuel López-Ibåñez <manu@gcc.gnu.org>
1046 * cvt.c (convert_to_void): Update comment.
1048 2012-04-05 Jason Merrill <jason@redhat.com>
1051 * semantics.c (finish_non_static_data_member): In templates, pass
1052 the decl to build_qualified_name.
1053 * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
1055 2012-04-04 Jason Merrill <jason@redhat.com>
1058 * decl.c (finish_function): Update fntype after deducing return type.
1060 2012-04-03 Jason Merrill <jason@redhat.com>
1063 * pt.c (tsubst_initializer_list): A pack expansion with no elements
1064 means value-initialization.
1066 2012-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1069 * class.c (deduce_noexcept_on_destructor,
1070 deduce_noexcept_on_destructors): New.
1071 (check_bases_and_members): Call the latter.
1072 * decl.c (grokfndecl): Call the former.
1073 * method.c (implicitly_declare_fn): Not static.
1074 * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
1077 2012-03-29 Paolo Carlini <paolo.carlini@oracle.com>
1080 * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
1081 warn for a zero as null pointer constant default argument.
1083 2012-03-29 Jason Merrill <jason@redhat.com>
1086 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
1088 2012-03-29 Jakub Jelinek <jakub@redhat.com>
1091 * decl.c (start_decl): Don't call maybe_apply_pragma_weak
1092 if processing_template_decl.
1094 2012-03-29 Jason Merrill <jason@redhat.com>
1097 * call.c (compare_ics): Handle ck_aggr like ck_list.
1099 2012-03-28 Jason Merrill <jason@redhat.com>
1102 * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
1103 we didn't get an explicit scope.
1104 * pt.c (tsubst_baselink): Likewise.
1106 2012-03-28 Richard Guenther <rguenther@suse.de>
1108 * typeck2.c (process_init_constructor_array): Use the proper
1109 type for computing the array length.
1111 2012-03-27 Meador Inge <meadori@codesourcery.com>
1114 * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
1115 stripped child trees that are not pointer types.
1117 2012-03-21 Jason Merrill <jason@redhat.com>
1119 Implement return type deduction for normal functions with -std=c++1y.
1120 * cp-tree.h (FNDECL_USED_AUTO): New macro.
1121 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
1122 (dependent_lambda_return_type_node): Remove.
1123 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
1124 (struct language_function): Add x_auto_return_pattern field.
1125 (current_function_auto_return_pattern): New.
1126 (enum tsubst_flags): Add tf_partial.
1127 * decl.c (decls_match): Handle auto return comparison.
1128 (duplicate_decls): Adjust error message for auto return.
1129 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
1130 (cp_finish_decl): Don't do auto deduction for functions.
1131 (grokdeclarator): Allow auto return without trailing return type in
1133 (check_function_type): Defer checking of deduced return type.
1134 (start_preparsed_function): Set current_function_auto_return_pattern.
1135 (finish_function): Set deduced return type to void if not previously
1137 * decl2.c (change_return_type): Handle error_mark_node.
1138 (mark_used): Always instantiate functions with deduced return type.
1139 Complain about use if deduction isn't done.
1140 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
1141 initial return type.
1142 (cp_parser_lambda_body): Don't deduce return type in a template.
1143 (cp_parser_conversion_type_id): Allow auto in C++1y.
1144 * pt.c (instantiate_class_template_1): Don't mess with
1145 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
1146 (tsubst_copy_and_build): Likewise.
1147 (fn_type_unification, tsubst): Don't reduce the template parm level
1148 of 'auto' during deduction.
1149 (unify): Compare 'auto' specially.
1150 (get_bindings): Change test.
1151 (always_instantiate_p): Always instantiate functions with deduced
1153 (do_auto_deduction): Handle error_mark_node and lambda context.
1154 Don't check for use in initializer.
1155 (contains_auto_r): Remove.
1156 * search.c (lookup_conversions_r): Handle auto conversion function.
1157 * semantics.c (lambda_return_type): Handle null return. Don't mess
1158 with dependent_lambda_return_type_node.
1159 (apply_deduced_return_type): Rename from apply_lambda_return_type.
1160 * typeck.c (merge_types): Handle auto.
1161 (check_return_expr): Do auto deduction.
1162 * typeck2.c (add_exception_specifier): Fix complain check.
1164 2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
1167 * class.c (check_field_decls): Call literal_type_p only
1170 2012-03-22 Jakub Jelinek <jakub@redhat.com>
1173 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
1174 on CLASS_TYPE_P types.
1176 2012-03-20 Jason Merrill <jason@redhat.com>
1178 * lex.c (init_reswords): Use >= for cxx_dialect test.
1179 * parser.c (cp_parser_exception_specification_opt): Likewise.
1181 * mangle.c (write_type): Handle 'auto'.
1182 * init.c (build_new): Don't do auto deduction where it might
1183 affect template mangling.
1186 * decl.c (reshape_init_class): Handle repeated reshaping.
1187 * search.c (lookup_field_1): Add sanity check.
1189 2012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
1192 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
1193 * tree.c (xvalue_p): Define.
1194 * typeck.c (maybe_warn_about_useless_cast): Define.
1195 (build_reinterpret_cast, build_const_cast,
1196 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
1197 * rtti.c (build_dynamic_cast): Likewise.
1198 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
1199 c_inhibit_evaluation_warnings before/after the build_* calls.
1201 2012-03-15 Jason Merrill <jason@redhat.com>
1204 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
1206 2012-03-15 Manuel López-Ibåñez <manu@gcc.gnu.org>
1209 * error.c (print_instantiation_partial_context): Use
1210 template_backtrace_limit.
1212 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1214 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
1216 2012-03-14 Jakub Jelinek <jakub@redhat.com>
1219 * parser.c (lookup_literal_operator): Return fn only if
1220 processed all arguments from args vector and argtypes is
1223 2012-01-30 Dodji Seketeli <dodji@redhat.com>
1226 * cp-tree.h (template_type_parameter_p): Declare new function.
1227 (parameter_of_template_p): Remove.
1228 * pt.c (template_type_parameter_p): Define new function.
1229 (parameter_of_template_p): Remove.
1230 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
1231 on parameter_of_template_p anymore. Compare the level of the
1232 template parameter to the depth of the template.
1234 2011-12-15 Dodji Seketeli <dodji@redhat.com>
1236 * call.c (standard_conversion, build_integral_nontype_arg_conv)
1237 (build_new_op_1, convert_like_real, is_subseq)
1238 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
1239 (joust): Use next_conversion instead of accessing fields of struct
1240 conversion directly.
1242 2012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
1245 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
1246 division by zero warnings.
1248 2012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1250 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
1251 build_ptrmemfunc): Consistently forward the tsubst_flags_t
1253 * call.c (resolve_args): Likewise.
1255 2012-03-07 Jason Merrill <jason@redhat.com>
1258 * mangle.c (write_literal_operator_name): The length comes after the
1261 2012-03-05 Jakub Jelinek <jakub@redhat.com>
1263 * pt.c (local_specializations): Change from htab_t into
1264 struct pointer_map_t *.
1265 (retrieve_local_specializations, register_local_specialization,
1266 tsubst_pack_expansion, instantiate_decl): Adjust users.
1267 (eq_local_specializations, hash_local_specialization): Remove.
1269 2012-03-05 Jason Merrill <jason@redhat.com>
1272 * decl2.c (determine_visibility): Correct calculation of class
1274 * decl.c (check_tag_decl): Adjust warning.
1276 * method.c (synthesized_method_walk): Cleanups don't affect the EH
1279 2012-03-03 Jason Merrill <jason@redhat.com>
1281 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
1284 * call.c (build_aggr_conv): Call reshape_init.
1285 (convert_like_real): Likewise.
1286 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
1289 * mangle.c (write_nested_name): Use decl_mangling_context.
1290 (write_prefix, write_template_prefix): Likewise.
1293 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
1295 * class.c (add_method): Always build an OVERLOAD for using-decls.
1296 * search.c (lookup_member): Handle getting an OVERLOAD for a
1299 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
1302 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
1304 * cp-tree.h (build_x_arrow): Adjust prototype.
1305 * pt.c (tsubst_copy_and_build): Adjust call.
1306 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1308 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
1310 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
1312 2012-02-29 Jason Merrill <jason@redhat.com>
1315 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
1316 (shadow_tag): From here.
1317 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
1319 2012-02-21 Jakub Jelinek <jakub@redhat.com>
1322 * typeck.c (check_literal_operator_args): Initialize *long_double_p
1323 and *long_long_unsigned_p even if processing_template_decl.
1325 2012-02-16 Jason Merrill <jason@redhat.com>
1328 * decl.c (define_label): Use timevar_cond_start/stop.
1330 2012-02-16 Fabien ChĂȘne <fabien@gcc.gnu.org>
1333 * decl.c (xref_basetypes): call dependent_scope_p instead of
1336 2012-02-16 Jason Merrill <jason@redhat.com>
1339 * error.c (dump_expr): Handle lambda closures specifically.
1341 2012-02-14 Jason Merrill <jason@redhat.com>
1343 * parser.c (cp_parser_explicit_instantiation): Give a warning
1344 for ignored attributes on explicit class instantiation.
1346 2012-02-14 Jakub Jelinek <jakub@redhat.com>
1349 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
1350 lookup_label on label's name and set TREE_USED.
1352 2012-02-14 Jason Merrill <jason@redhat.com>
1355 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
1357 2012-02-14 Jakub Jelinek <jakub@redhat.com>
1360 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
1361 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
1363 2012-02-07 Jason Merrill <jason@redhat.com>
1366 * semantics.c (cx_check_missing_mem_inits): Handle unions.
1367 Fix constexpr default constructor logic.
1370 * pt.c (tsubst): Strip uninstantiated typedef.
1372 2012-02-06 Jason Merrill <jason@redhat.com>
1375 * cvt.c (build_expr_type_conversion): Check for template conversion.
1377 2012-01-31 Jason Merrill <jason@redhat.com>
1380 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
1381 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
1382 (tsubst_pack_expansion): Check it.
1384 2012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1387 * class.c (explain_non_literal_class): Correctly handle implicitly
1388 deleted constructors.
1390 2012-01-27 Jakub Jelinek <jakub@redhat.com>
1393 * pt.c (tsubst_pack_expansion): Delete and restore
1394 local_specialization whenever need_local_specialization, not just
1395 when saved_local_specializations is non-NULL.
1397 2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
1400 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
1401 as TREE_OPERAND (t, 1).
1403 2012-01-24 Jason Merrill <jason@redhat.com>
1406 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
1409 * tree.c (called_fns_equal): Check template args.
1410 (cp_tree_equal): Call it.
1412 2012-01-24 Aldy Hernandez <aldyh@redhat.com>
1413 Patrick Marlier <patrick.marlier@gmail.com>
1416 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
1417 thunk for set_one_vmethod_tm_attributes.
1419 2012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
1422 * call.c (build_over_call): Check for error_mark_node as
1423 TREE_VALUE when default arguments are processed.
1425 2012-01-23 Jason Merrill <jason@redhat.com>
1428 * decl2.c (determine_visibility): Check for visibility attribute
1429 on template specialization.
1431 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1434 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
1436 2012-01-23 Jason Merrill <jason@redhat.com>
1439 * class.c (add_method): Set OVL_USED for using-decls.
1440 * tree.c (ovl_scope): New.
1441 * cp-tree.h: Declare it.
1442 * parser.c (cp_parser_template_name): Use it.
1443 * semantics.c (baselink_for_fns): Likewise.
1444 * name-lookup.c (set_inherited_value_binding_p): Likewise.
1446 2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1449 * pt.c (lookup_template_class_1): Check context returned by
1450 tsubst for error_mark_node.
1452 2012-01-19 Kai Tietz <ktietz@redhat.com>
1455 * decl2.c (save_template_attributes): Use merge_attributes
1456 instead of chaining up via TREE_CHAIN.
1458 2012-01-19 Jason Merrill <jason@redhat.com>
1461 * class.c (finish_struct): Call add_method here for function usings.
1462 * semantics.c (finish_member_declaration): Not here.
1464 2012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
1467 * typeck2.c (store_init_value): Within a template guard
1468 cxx_constant_value with require_potential_constant_expression.
1469 * pt.c (convert_nontype_argument): Likewise.
1471 2012-01-16 Jakub Jelinek <jakub@redhat.com>
1474 * mangle.c (write_template_arg_literal): Handle complex.
1476 2012-01-16 Jason Merrill <jason@redhat.com>
1479 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
1482 * typeck.c (build_static_cast_1): Handle bit-fields properly.
1484 2012-01-13 Ian Lance Taylor <iant@google.com>
1487 * typeck.c (enum_cast_to_int): New static function.
1488 (cp_build_binary_op): When handling warn_sign_compare, don't test
1489 for TREE_NO_WARNING. Do call enum_cast_to_int.
1490 * call.c (avoid_sign_compare_warnings): Remove static function.
1491 (build_new_op_1): Don't call avoid_sign_compare_warnings.
1493 2012-01-13 Steven Bosscher <steven@gcc.gnu.org>
1495 * decl2.c: Do not include tree-mudflap.h
1496 * semantics.c: Likewise.
1498 2012-01-13 Jason Merrill <jason@redhat.com>
1501 * semantics.c (finish_break_stmt): Avoid adding an unreachable
1505 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
1506 when reducing the visibility.
1509 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
1511 2012-01-12 Jason Merrill <jason@redhat.com>
1514 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
1517 2012-01-13 Dodji Seketeli <dodji@redhat.com>
1520 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
1521 Set the pointer to the last block of the constructor to the
1523 (build_constexpr_constructor_member_initializers): Get
1524 build_data_member_initialization a chance to deal with more
1525 statements before we choke.
1527 2012-01-12 Jason Merrill <jason@redhat.com>
1530 * mangle.c (write_expression): Mangle BASELINK scope if
1531 BASELINK_QUALIFIED_P.
1532 * search.c (adjust_result_of_qualified_name_lookup): Set
1533 BASELINK_QUALIFIED_P.
1534 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
1535 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
1536 adjust_result_of_qualified_name_lookup for non-qualified names.
1539 * pt.c (unify): Handle error_mark_node.
1541 2012-01-11 Jason Merrill <jason@redhat.com>
1544 * call.c (standard_conversion): For ptrmemfuncs, compare the
1548 * mangle.c (find_substitution): A type is only a substitution
1549 match if we're looking for a type.
1550 (write_nested_name): Use decl_mangling_context.
1552 * decl.c (decls_match): Assert that the arguments are decls.
1555 * pt.c (resolve_overloaded_unification): Compare types with
1556 same_type_p, not decls_match.
1558 2012-01-10 Jason Merrill <jason@redhat.com>
1561 * class.c (build_base_path): Diagnose ambiguous base.
1564 * semantics.c (cxx_eval_call_expression): Always retry previously
1565 non-constant expressions.
1567 2012-01-06 Jason Merrill <jason@redhat.com>
1571 * parser.c (cp_parser_new_expression): Set
1572 type_definition_forbidden_message.
1578 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
1579 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
1581 (write_template_arg): Fix mangling of class-scope functions and
1583 (mangle_decl): Update suggested -fabi-version argument.
1584 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
1585 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
1586 * tree.c (dependent_name): No longer static.
1587 * cp-tree.h: Declare it.
1588 * pt.c (unify): Defer handling of unconverted functions.
1590 * mangle.c (mangle_decl): Don't generate mangling aliases
1591 for maybe-in-charge [cd]tors.
1593 * error.c (dump_expr): Print type of CONSTRUCTOR.
1595 2012-01-05 Dodji Seketeli <dodji@redhat.com>
1598 * parser.c (cp_parser_alias_declaration): Get out early upon
1599 errors in the identifier or the attributes.
1601 2012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1604 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
1605 the tree returned by build_x_binary_op.
1607 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1610 * parser.c (cp_parser_postfix_open_square_expression): Handle
1611 postfix-expression [ braced-init-list ].
1613 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1616 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
1617 call decay_conversion on v.
1619 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1622 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
1623 declaration followed by specialization.
1625 2012-01-03 Jakub Jelinek <jakub@redhat.com>
1628 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
1629 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
1631 2012-01-02 Jason Merrill <jason@redhat.com>
1635 * method.c (walk_field_subobs): Don't check for uninitialized
1637 (synthesized_method_walk): Check here.
1641 * parser.c (cp_parser_cache_defarg): Split out...
1642 (cp_parser_parameter_declaration): ...from here.
1643 (cp_parser_save_nsdmi): Use it.
1644 (cp_parser_cache_group): Remove CPP_COMMA support.
1646 2012-01-02 Dodji Seketeli <dodji@redhat.com>
1649 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
1652 2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
1655 * typeck2.c (digest_init_r): Use copy_init when initializing
1658 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
1661 * decl.c (build_enumerator): Don't call perform_integral_promotions
1664 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
1667 * typeck.c (build_reinterpret_cast_1): Implement resolution of
1670 2012-01-01 Fabien ChĂȘne <fabien@gcc.gnu.org>
1672 * parser.c (cp_parser_using_declaration): Add a warning about
1673 deprecated access declarations when no errors were encountered
1674 while parsing the access declaration. Save the first token in
1675 order to emit the warning at the right place.
1677 Copyright (C) 2012 Free Software Foundation, Inc.
1679 Copying and distribution of this file, with or without modification,
1680 are permitted in any medium without royalty provided the copyright
1681 notice and this notice are preserved.