aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-08cgraph.c (cgraph_add_to_same_comdat_group): New.Jason Merrill1-6/+7
gcc/ * cgraph.c (cgraph_add_to_same_comdat_group): New. * cgraph.h: Declare it. * ipa.c (function_and_variable_visibility): Make sure thunks have the right visibility. gcc/cp/ * method.c (use_thunk): Use cgraph_add_to_same_comdat_group. * optimize.c (maybe_clone_body): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. From-SVN: r176071
2011-07-06re PR c++/49568 (g++.dg/torture/pr41257-2.C FAILs to link on Tru64 UNIX)Jason Merrill1-2/+4
PR c++/49568 * method.c (make_thunk, use_thunk): Copy DECL_COMDAT. From-SVN: r175938
2011-06-30re PR c++/49569 (-std=gnu++0x causes segmentation fault)Jason Merrill1-2/+5
PR c++/49569 * method.c (implicitly_declare_fn): Set DECL_PARM_LEVEL and DECL_PARM_INDEX on rhs parm. From-SVN: r175738
2011-06-29re PR c++/45923 (constexpr diagnostics, more more)Jason Merrill1-5/+39
PR c++/45923 * class.c (explain_non_literal_class): New. (finalize_literal_type_property): Call it. * cp-tree.h: Declare it. * semantics.c (ensure_literal_type_for_constexpr_object): Call it. (is_valid_constexpr_fn): Likewise. (massage_constexpr_body): Split out from... (register_constexpr_fundef): ...here. (is_instantiation_of_constexpr): New. (expand_or_defer_fn_1): Leave DECL_SAVED_TREE alone in that case. (explain_invalid_constexpr_fn): New. (cxx_eval_call_expression): Call it. (potential_constant_expression_1): Likewise. Avoid redundant errors. * method.c (process_subob_fn): Diagnose non-constexpr. (walk_field_subobs): Likewise. (synthesized_method_walk): Don't shortcut if we want diagnostics. (explain_implicit_non_constexpr): New. (defaulted_late_check): Use it. * call.c (build_cxx_call): Remember location. From-SVN: r175646
2011-06-29method.c (maybe_explain_implicit_delete): Use pointer_set instead of htab.Jason Merrill1-8/+4
* method.c (maybe_explain_implicit_delete): Use pointer_set instead of htab. From-SVN: r175645
2011-06-29class.c (finalize_literal_type_property): Update conditions.Jason Merrill1-4/+8
* class.c (finalize_literal_type_property): Update conditions. * method.c (defaulted_late_check): Set TYPE_HAS_CONSTEXPR_CTOR. From-SVN: r175644
2011-06-14re PR c++/49107 ([C++0x][4.7 Regression] incomplete type regression with ↵Jason Merrill1-13/+12
std::pair) PR c++/49107 * cp-tree.h (DEFERRED_NOEXCEPT_SPEC_P): Handle overload. * method.c (defaulted_late_check): Only maybe_instantiate_noexcept if the declaration had an exception-specifier. (process_subob_fn): Don't maybe_instantiate_noexcept. * pt.c (maybe_instantiate_noexcept): Handle overload. * typeck2.c (nothrow_spec_p_uninst): New. (merge_exception_specifiers): Add 'fn' parm. Build up overload. * typeck.c (merge_types): Adjust. From-SVN: r175073
2011-06-15target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h.Joseph Myers1-1/+2
* target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-08re PR c++/49107 ([C++0x][4.7 Regression] incomplete type regression with ↵Jason Merrill1-2/+6
std::pair) PR c++/49107 * cp-tree.def (DEFERRED_NOEXCEPT): New. * cp-tree.h (struct tree_deferred_noexcept): New. (DEFERRED_NOEXCEPT_PATTERN, DEFERRED_NOEXCEPT_ARGS): New. (DEFERRED_NOEXCEPT_SPEC_P): New. (enum cp_tree_node_structure_enum): Add TS_CP_DEFERRED_NOEXCEPT. (union lang_tree_node): Add tree_deferred_noexcept. (maybe_instantiate_noexcept): Declare. * cp-objcp-common.c (cp_tree_size): Handle DEFERRED_NOEXCEPT. * error.c (dump_exception_spec): Likewise. * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise. * ptree.c (cxx_print_xnode): Likewise. * tree.c (cp_tree_equal): Likewise. * decl.c (cp_tree_node_structure): Likewise. (duplicate_decls): Call maybe_instantiate_noexcept. * except.c (build_noexcept_spec): Handle DEFERRED_NOEXCEPT. (nothrow_spec_p, type_noexcept_p, type_throw_all_p): Check DEFERRED_NOEXCEPT_SPEC_P. * typeck2.c (merge_exception_specifiers): Likewise. * decl2.c (mark_used): Call maybe_instantiate_noexcept. * method.c (process_subob_fn, defaulted_late_check): Likewise. * pt.c (tsubst_exception_specification): Add defer_ok parm. Build DEFERRED_NOEXCEPT. (maybe_instantiate_noexcept): New. (tsubst, regenerate_decl_from_template, instantiate_decl): Adjust. * search.c (check_final_overrider): Call maybe_instantiate_noexcept. From-SVN: r174820
2011-05-19re PR c++/48869 (OpenMP task construct fails to instantiate copy ↵Jakub Jelinek1-5/+5
constructor(same as Bug 36523)) PR c++/48869 * method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument, pass it down to locate_fn_flags. * cp-tree.h (get_dtor, get_copy_ctor): Adjust prototypes. * semantics.c (cxx_omp_create_clause_info): Adjust callers. * cp-gimplify.c: Include splay-tree.h. (splay_tree_compare_decl_uid, omp_var_to_track, omp_cxx_notice_variable): New functions. (struct cp_genericize_omp_taskreg): New type. (struct cp_genericize_data): Add omp_ctx field. (cp_genericize_r): Attempt to determine implicitly determined firstprivate class type variables. (cp_genericize): Clear omp_ctx. * Make-lang.in (cp/cp-gimplify.o): Depend on $(SPLAY_TREE_H). * testsuite/libgomp.c++/pr48869.C: New test. From-SVN: r173888
2011-05-02revert: re PR c++/40975 (ICE in copy_tree_r on array new)Jason Merrill1-8/+2
Revert: PR c++/40975 * cp-tree.def (VEC_INIT_EXPR): Add third operand. * cp-tree.h (VEC_INIT_EXPR_NELTS): New. * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it. * tree.c (build_vec_init_expr): Handle getting pointer/nelts. (build_vec_init_elt): Don't expect an array type. (build_array_copy): Adjust. * init.c (perform_member_init): Adjust. (build_new_1): Use build_vec_init_expr. From-SVN: r173274
2011-04-27re PR c++/40975 (ICE in copy_tree_r on array new)Jason Merrill1-2/+8
PR c++/40975 * cp-tree.def (VEC_INIT_EXPR): Add third operand. * cp-tree.h (VEC_INIT_EXPR_NELTS): New. * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it. * tree.c (build_vec_init_expr): Handle getting pointer/nelts. (build_vec_init_elt): Don't expect an array type. (build_array_copy): Adjust. * init.c (perform_member_init): Adjust. (build_new_1): Use build_vec_init_expr. From-SVN: r173056
2011-04-12class.c (cp_fold_obj_type_ref): Call cgraph_get_node instead of ↵Martin Jambor1-4/+8
cgraph_get_create_node. 2011-04-12 Martin Jambor <mjambor@suse.cz> gcc/cp/ * class.c (cp_fold_obj_type_ref): Call cgraph_get_node instead of cgraph_get_create_node. * decl2.c (cp_write_global_declarations): Call cgraph_get_node instead of cgraph_get_create_node. * method.c (make_alias_for_thunk): Call cgraph_get_node instead of cgraph_get_create_node, assert it returns non-NULL. (use_thunk): Likewise. * optimize.c (maybe_clone_body): Call cgraph_same_body_alias only when flag_syntax_only is not set. Call cgraph_get_node instead of cgraph_get_create_node. (maybe_clone_body): Call cgraph_get_node instead of cgraph_get_create_node. From-SVN: r172308
2011-04-12cgraph.h (cgraph_node): Remove function declaration.Martin Jambor1-3/+4
2011-04-12 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_node): Remove function declaration. (cgraph_create_node): Declare. (cgraph_get_create_node): Likewise. * cgraph.c (cgraph_create_node): Renamed to cgraph_create_node_1. Updated all callers. (cgraph_node): Renamed to cgraph_create_node, assert that a node for the decl does not already exist. Call cgraph_get_create_node instead of cgraph_node. (cgraph_get_create_node): New function. (cgraph_same_body_alias): Update comment. (cgraph_set_call_stmt): Call cgraph_get_node instead of cgraph_node, assert it does not return NULL. (cgraph_update_edges_for_call_stmt): Likewise. (cgraph_clone_edge): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_update_edges_for_call_stmt_node): Call cgraph_get_create_node instead of cgraph_node. (cgraph_add_new_function): Call cgraph_create_node or cgraph_get_create_node instead of cgraph_node. * cgraphbuild.c (record_reference): Call cgraph_get_create_node instead of cgraph_node. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (build_cgraph_edges): Call cgraph_get_create_node instead of cgraph_node. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (cgraph_finalize_function): Call cgraph_get_create_node instead of cgraph_node. (cgraph_copy_node_for_versioning): Call cgraph_create_node instead of cgraph_node. * lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Call cgraph_create_node instead of cgraph_node. * c-decl.c (finish_function): Call cgraph_get_create_node instead of cgraph_node. * lto-cgraph.c (input_node): Likewise. * lto-streamer-in.c (input_function): Likewise. * varasm.c (mark_decl_referenced): Likewise. (assemble_alias): Likewise. gcc/c-family/ * c-gimplify.c (c_genericize): Call cgraph_get_create_node instead of cgraph_node. gcc/cp/ * cp/class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node instead of cgraph_node. * cp/decl2.c (cxx_callgraph_analyze_expr): Likewise. (cp_write_global_declarations): Likewise. * cp/optimize.c (maybe_clone_body): Likewise. * cp/semantics.c (maybe_add_lambda_conv_op): Likewise. * cp/mangle.c (mangle_decl): Likewise. * cp/method.c (make_alias_for_thunk): Likewise. (use_thunk): Likewise. gcc/ada/ * gcc-interface/utils.c (end_subprog_body): Call cgraph_get_create_node instead of cgraph_node. gcc/fortran/ * trans-decl.c (gfc_generate_function_code): Call cgraph_get_create_node instead of cgraph_node. gcc/objc/ * objc-act.c (mark_referenced_methods): Call cgraph_get_create_node instead of cgraph_node. From-SVN: r172307
2011-03-31re PR c++/48280 ([C++0x] ICE: tree check: expected var_decl or ↵Jason Merrill1-0/+6
function_decl, have template_decl in check_bases_and_members, at cp/class.c:4695) PR c++/48280 * method.c (defaultable_fn_check): Templates are not defaultable. From-SVN: r171797
2011-03-25Core 1135Jason Merrill1-8/+7
Core 1135 * method.c (defaulted_late_check): Check for exception spec mismatch. (defaultable_fn_check): Allow exception spec and virtual. * class.c (check_for_override): A virtual dtor is non-trivial. From-SVN: r171462
2011-03-15Core 1191Jason Merrill1-21/+9
Core 1191 * method.c (synthezized_method_walk): Cleanups don't affect the triviality of a constructor, but do affect deletion and exception specification. From-SVN: r171011
2011-03-09re PR tree-optimization/47714 (verify_ssa fails with error: invalid argument ↵Martin Jambor1-0/+1
to gimple call) 2011-03-09 Martin Jambor <mjambor@suse.cz> PR tree-optimization/47714 * cp/method.c (use_thunk): Clear addressable flag of thunk arguments. * testsuite/g++.dg/torture/pr47714.C: New test. From-SVN: r170822
2011-03-04re PR lto/47497 (SPEC CPU 2006 failed to link with LTO -fuse-linker-plugin ↵Jan Hubicka1-2/+3
-fwhole-program) PR lto/47497 * lto-symtab.c (lto_cgraph_replace_node): Do not set thunk.alias. (lto_symtab_merge_cgraph_nodes_1): Update thunk.alias pointers here. * cgraph.h (cgraph_same_body_alias, cgraph_add_thunk): Add node pointers. * cgraph.c (cgraph_same_body_alias_1, cgraph_same_body_alias, cgraph_add_thunk): Add node pointers. * lto-cgraph.c (lto_output_node): Verify that thunks&aliases are associated to right node. (input_node): Update use of cgraph_same_body_alias and cgraph_add_thunk. * optimize.c (maybe_clone_body): Update call of cgraph_same_body_alias and cgraph_add_thunk. * method.c (make_alias_for_thunk, use_thunk): Likewise. * mangle.c (mangle_decl): Likewise. From-SVN: r170682
2011-02-20re PR c++/46472 ([C++0X] constexpr is not constexpr)Jason Merrill1-2/+11
PR c++/46472 * method.c (process_subob_fn): Instantiate constexpr templates. * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P. From-SVN: r170348
2011-02-15re PR c++/46807 (internal compiler error: in synthesized_method_walk)Jason Merrill1-11/+4
PR c++/46807 * method.c (synthesized_method_walk): Always exit early for trivial fn in C++98 mode. From-SVN: r170207
2011-01-03Update Copyright years for files modified in 2010.Jakub Jelinek1-1/+1
From-SVN: r168438
2010-12-08re PR c++/45822 (Qt 4.7.0 build fails)Jason Merrill1-3/+4
PR c++/45822 * cp-tree.h (LOOKUP_DEFAULTED): New. * call.c (add_function_candidate): Check it. * method.c (synthesized_method_walk): Set it. (do_build_copy_assign): Likewise. * init.c (perform_member_init): Likewise. (emit_mem_initializers): Likewise. From-SVN: r167602
2010-12-08re PR c++/46736 ([c++0x] move constructor is not implicitly deleted when it ↵Jason Merrill1-2/+1
should be) PR c++/46736 * decl.c (cp_finish_decl): Complain about an implicitly deleted method defaulted outside the class. * method.c (maybe_explain_implicit_delete): Don't check DECL_INITIAL. From-SVN: r167601
2010-11-12Core 1135, 1136, 1145, 1149Ville Voutilainen1-6/+0
Core 1135, 1136, 1145, 1149 * method.c (defaultable_fn_check): Do not disallow defaulting a non-public or explicit special member function on its first declaration. From-SVN: r166685
2010-11-10cfgloop.c (verify_loop_structure): Use %' in diagnostics.Joseph Myers1-4/+4
* cfgloop.c (verify_loop_structure): Use %' in diagnostics. Start diagnostics with lowercase letters. * cgraphunit.c (verify_cgraph_node): Start diagnostics with lowercase letters. * collect2.c (maybe_run_lto_and_relink): Remove trailing '.' from diagnostic. * config/alpha/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/arm/arm.c (arm_get_pcs_model): Start diagnostics with lowercase letters. * config/arm/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. Remove trailing ' ' from diagnostic. * config/avr/avr.c (print_operand_address): Start diagnostic with a lowercase letter and remove trailing '.'. * config/avr/avr.opt (mpmem-wrap-around): Fix typo in help text. * config/bfin/bfin.c (bfin_option_override): Start diagnostics with lowercase letters. Use %' in diagnostics. Remove trailing '.' from diagnostics. (bfin_handle_longcall_attribute): Use %' in diagnostic. * config/cris/cris.c (cris_split_movdx, cris_expand_pic_call_address): Start diagnostics with lowercase letters. (cris_asm_output_label_ref): Use %' in diagnostic. * config/cris/cris.h (ASM_SPEC): Start diagnostic with a lowercase letter. * config/crx/crx.h (FUNCTION_PROFILER): Start diagnostic with a lowercase letter. * config/darwin-c.c (version_as_macro): Start diagnostic with a lowercase letter. * config/darwin-driver.c (darwin_default_min_version): Use %' in diagnostic. * config/host-darwin.c (darwin_gt_pch_use_address): Use %' in diagnostic. * config/i386/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/i386/host-cygwin.c (cygwin_gt_pch_get_address): Use %' in diagnostics. * config/i386/i386.c (ix86_option_override_internal): Write diagnostic as a single sentence without trailing '.'. Use %' in diagnostics. (ix86_function_sseregparm, classify_argument): Start diagnostics with lowercase letters. (ix86_expand_prologue): Use %' in diagnostic. * config/i386/i386.h (CC1_CPU_SPEC_1): Remove trailing '.' from diagnostic. * config/i386/nwld.h (LINK_SPEC): Start diagnostic with a lowercase letter. * config/i386/winnt.c (i386_pe_determine_dllimport_p): Use %' in diagnostic. * config/ia64/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/ia64/ia64.opt (msched-max-memory-insns-hard-limit): Avoid '`' in help text. * config/lm32/lm32.c (lm32_print_operand): Start diagnostic with a lowercase letter. * config/mep/mep.c (mep_validate_vliw): Start diagnostics with lowercase letters. * config/microblaze/microblaze.c (microblaze_handle_option): Remove trailing '.' from diagnostic. (print_operand): Start diagnostic with a lowercase letter. * config/pa/pa-hpux10.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa-hpux11.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa64-hpux.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/picochip/picochip.c (picochip_option_override, picochip_emit_save_register, picochip_function_arg, picochip_output_label, picochip_output_internal_label, picochip_asm_output_opcode, picochip_output_cbranch, picochip_output_compare, picochip_output_branch, picochip_get_vliw_alu_id): Remove trailing '.' and '\n' from diagnostics. Start diagnostics with lowercase letters. Use %' in diagnostics. * config/rs6000/rs6000.c (rs6000_option_override_internal): Use "SPE" capitalization. Start diagnostic with a lowercase letter. (rs6000_handle_option): Start diagnostics with lowercase letters. (def_builtin): Remove trailing '.' from diagnostic. (rs6000_savres_routine_name): Start diagnostic with a lowercase letter. * config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Avoid '`' in diagnostic. * config/rx/rx.c (rx_handle_option): Start diagnostic with a lowercase letter. * config/s390/s390.c (s390_option_override) Start diagnostics with lowercase letters. Use %' in diagnostic. * config/sh/sh.c (sh_output_mi_thunk): Start diagnostics with lowercase letters. * config/sh/symbian-base.c (sh_symbian_mark_dllimport): Use %' in diagnostic. * config/sh/symbian-c.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sh/symbian-cxx.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sparc/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/spu/spu.c (spu_option_override): Start diagnostics with lowercase letters. Use %qs for quoting in diagnostics. (spu_check_builtin_parm): Remove trailing '.' from diagnostics. Use %wd instead of HOST_WIDE_INT_PRINT_DEC in diagnostic . * config/v850/v850.c (construct_save_jarl): Remove trailing '\n' from diagnostic. * convert.c (convert_to_integer, convert_to_vector): Use %' in diagnostics. * dbgcnt.c (dbg_cnt_process_opt): Start diagnostic with lowercase letter and use "cannot" spelling. * expmed.c (extract_fixed_bit_field): Start diagnostic with lowercase letter and format as a single sentence without '.'. * ggc-common.c (write_pch_globals, gt_pch_save, gt_pch_restore): Use %' in diagnostics. * ggc-page.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * ggc-zone.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * graph.c (clean_graph_dump_file): Use %' in diagnostic. * graphite-poly.c (graphite_read_scop_file): Start diagnostics with lowercase letters and remove tailing '.' and '\n'. * lto-cgraph.c (input_profile_summary): Start diagnostic with lowercase letter and remove trailing '.'. (input_cgraph): Start diagnostics with lowercase letters and remove trailing '\n'. * opts.c (finish_options, common_handle_option): Start diagnostics with lowercase letters and remove trailing '.'. Fix typo in diagnostic. * passes.c (position_pass): Start diagnostic with lowercase letter. * plugin.c (add_new_plugin, parse_plugin_arg_opt, register_callback, try_init_one_plugin): Start diagnostics with lowercase letters. * reload1.c (spill_failure): Use %' in diagnostic. (gen_reload): Start diagnostic with a lowercase letter. * stor-layout.c (place_field): Start diagnostic with a lowercase letter. * toplev.c (open_auxiliary_file): Use %' in diagnostic. * tree-cfg.c (verify_expr, verify_types_in_gimple_reference, verify_gimple_call, verify_gimple_phi, verify_eh_throw_stmt_node): Start diagnostics with lowercase letters, remove trailing '.' and use %' in diagnostics. * tree-ssa.c (verify_def): Remove trailing '.' from diagnostic. (verify_ssa): Don't split diagnostic across two error calls. Spell out "number" and use %' in diagnostic. * value-prof.c (visit_hist, check_counter): Start diagnostics with lowercase letters. c-family: * c-common.c (handle_mode_attribute): Use %' and word "signedness" in diagnostic. * c-opts.c (c_common_parse_file): Start diagnostics with lowercase letter. * c-pragma.c (handle_pragma_target, handle_pragma_optimize): Remove trailing '.' from diagnostics. * c.opt (Wwrite-strings_: Avoid '`' in help text. cp: * cvt.c (cp_convert_to_pointer): Use %' in diagnostic. * decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator): Use %' in diagnostics. * decl2.c (check_classfn): Use %' in diagnostic. * init.c (build_java_class_ref): Use %' in diagnostic. (build_delete): Remove trailing '.' from diagnostic. * method.c (do_build_copy_assign, walk_field_subobs): Use %' in diagnostics. * name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic. * parser.c (cp_parser_exception_specification_opt): Remove trailing '.' from diagnostic. (cp_parser_objc_interstitial_code): Use %qs for quoting in diagnostic. * pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in diagnostic. * repo.c (reopen_repo_file_for_write): Use %' in diagnostic. fortran: * trans-array.c (gfc_trans_deferred_array): Use "front-end" spelling in diagnostic. * trans.c (gfc_allocate_array_with_status): Add missing space in diagnostic. java: * expr.c (expand_java_field_op): Use %' in diagnostic. * jcf-parse.c (java_parse_file): Use %' in diagnostics. * jvspec.c (lang_specific_driver): Use %' in diagnostic. * lang.c (java_post_options): Use %' in diagnostics. lto: * lto.c (lto_resolution_read): Start diagnostics with lowercase letters and remove trailing '.'. (lto_file_finalize): Start diagnostic with a lowercase letter. objc: * objc-act.c (objc_init): Use %' in diagnostic. (objc_set_method_opt): Remove trailing '.' from diagnostic. From-SVN: r166570
2010-11-06re PR middle-end/46314 (frontends use ASM_GENERATE_INTERNAL_LABEL)Joern Rennecke1-1/+1
PR middle-end/46314 gcc: * target.def (generate_internal_label): New asm_out hook. * output.h (default_generate_internal_label): Declare. * varasm.c (default_generate_internal_label): Define. gcc/cp: * method.c (make_alias_for_thunk): Use targetm.asm_out.generate_internal_label. gcc/java: * class.c: Include target.h. (make_local_function_alias): Use targetm.asm_out.generate_internal_label. * expr.c (lookup_label, generate_name): Likewise. From-SVN: r166404
2010-11-04semantics.c (speculative_access_check): New.Jason Merrill1-2/+6
* semantics.c (speculative_access_check): New. * cp-tree.h: Declare it. * call.c (build_over_call): Use it. * class.c (type_has_constexpr_default_constructor): Use locate_ctor. * method.c (locate_ctor): Use push/pop_deferring_access_checks. From-SVN: r166317
2010-10-31class.c (is_really_empty_class): Work when type is not complete.Jason Merrill1-1/+5
* class.c (is_really_empty_class): Work when type is not complete. (synthesized_default_constructor_is_constexpr): New. (add_implicitly_declared_members): Use it. (type_has_constexpr_default_constructor): Likewise. * cp-tree.h: Declare it. * method.c (synthesized_method_walk): Use it. From-SVN: r166124
2010-10-27method.c (synthesized_method_walk): Track constexprness too.Gabriel Dos Reis1-43/+90
* method.c (synthesized_method_walk): Track constexprness too. (process_subob_fn, walk_field_subobs): Likewise. (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P. (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P. * class.c (add_implicitly_declared_members): Handle constexpr default ctor. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r166014
2010-09-24lto-symtab.c (lto_symtab_entry_def): Add guessed field.Jan Hubicka1-2/+2
* lto-symtab.c (lto_symtab_entry_def): Add guessed field. (lto_symtab_resolve_symbols): Set it. (lto_symtab_merge_decls_1): Do not compute used_from_object_file; store resolution field in cgraph/varpool. * cgraph.c (cgraph_same_body_alias, cgraph_add_thunk): Return node. (cgraph_get_node_or_alias, cgraph_get_node_or_alias): Constify. (cgraph_dump_node): Drop used_from_object_file. (cgraph_clone_node, cgraph_create_virtual_clone): Likewise. (cgraph_function_body_availability): Use decl_replaceable_p. (cgraph_make_node_local): Set resolution to LDPR_PREVAILING_DEF_IRONLY. (cgraph_can_remove_if_no_direct_calls_and_refs): Use cgraph_used_from_object_file_p. (cgraph_will_be_removed_from_program_if_no_direct_calls): Use cgraph_used_from_object_file_p. (resolution_used_from_other_file_p): New functoin. (cgraph_used_from_object_file_p): New predicate. * cgraph.h: Include plugin-api.h (struct cgraph_local_info): Remove used_from_object_file. (struct cgraph_node): Add resolution field. (struct varpool_node): Likewise; remove used_from_object_file; reove const_value_known. (cgraph_get_node, cgraph_get_node_or_alias, cgraph_node, cgraph_same_body_alias, cgraph_add_thunk): Update prototypes. (resolution_used_from_other_file_p, cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Declare. (varpool_get_node, varpool_extra_name_alias): Update prototype. * tree.h (DECL_REPLACEABLE_P): Remove. (decl_replaceable_p, decl_binds_to_current_def_p): Declare. * final.c (rest_of_clean_state): Use decl_binds_to_current_def_p. * lto-cgraph.c (lto_output_node, lto_output_varpool_node, input_overwrite_node, input_node, input_varpool_node): Stream resolution. * expr.c (expand_expr_real_1): Use const_value_known_p * ipa.c (ipa_discover_readonly_nonaddressable_var): Do not set const_value_known. (cgraph_externally_visible_p): Use cgraph_used_from_object_file_p. (function_and_variable_visibility): Set resolution for local vars and functions. use varpool_used_from_object_file_p. * varasm.c (resolution_to_local_definition_p, resolution_local_p): New static functions. (default_binds_local_p_1): Use resolutoin info. (decl_binds_to_current_def_p, decl_replaceable_p): New functions. * varpool.c (varpool_get_node): Constify. (const_value_known_p): Do not use vnode->const_value_known; use decl_replaceable_p. (varpool_finalize_decl): Do not set const_value_known. (cgraph_variable_initializer_availability): Use decl_replaceable_p (varpool_extra_name_alias): Return new node. (varpool_used_from_object_file_p): New function. * decl.c (finish_function): Use decl_replaceable_p * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias. * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. From-SVN: r164610
2010-09-06method.c (synthesized_method_walk): In constructors, also check subobject ↵Jason Merrill1-5/+44
destructors. * method.c (synthesized_method_walk): In constructors, also check subobject destructors. From-SVN: r163894
2010-08-20vec.h (FOR_EACH_VEC_ELT): Define.Nathan Froyd1-1/+1
gcc/ * vec.h (FOR_EACH_VEC_ELT): Define. * c-decl.c: Use it. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/bfin/bfin.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * dbxout.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * ggc-common.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * ipa-prop.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * lambda-code.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-opts.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-symtab.c: Likewise. * matrix-reorg.c: Likewise. * opts.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-data-ref.c: Likewise. * tree-emutls.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Use FOR_EACH_VEC_ELT. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. gcc/c-family/ * c-common.c: Use FOR_EACH_VEC_ELT. * c-gimplify.c: Likewise. * c-pragma.c: Likewise. gcc/cp/ * call.c: Use FOR_EACH_VEC_ELT. * class.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * error.c: Likewise. * except.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * repo.c: Likewise. * semantics.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * trans-openmp.c: Use FOR_EACH_VEC_ELT. gcc/java/ * class.c: Use FOR_EACH_VEC_ELT. * expr.c: Likewise. * jcf-parse.c: Likewise. * resource.c: Likewise. gcc/lto/ * lto.c: Use FOR_EACH_VEC_ELT. From-SVN: r163401
2010-07-15tree.h (DECL_CHAIN): Define.Nathan Froyd1-11/+11
gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-14Implement C++0x unrestricted unions (N2544)Jason Merrill1-108/+140
Implement C++0x unrestricted unions (N2544) * class.c (check_field_decl): Loosen union handling in C++0x. * method.c (walk_field_subobs): Split out from... (synthesized_method_walk): ...here. Set msg before loops. (process_subob_fn): Check for triviality in union members. * init.c (sort_mem_initializers): Splice out uninitialized anonymous unions and union members. (push_base_cleanups): Don't automatically destroy anonymous unions and union members. From-SVN: r162187
2010-07-13re PR c++/44909 ([C++0x] Copy constructors implicitly deleted)Jason Merrill1-0/+1
PR c++/44909 * cp-tree.h (struct lang_type_class): Add has_user_opeq. (TYPE_HAS_USER_OPEQ): New. * decl.c (grok_special_member_properties): Set it. * class.c (add_implicitly_declared_members): Don't lazily declare constructors/operator= if a base or member has a user-declared one. (check_bases_and_members, check_bases): Adjust. (check_field_decls, check_field_decl): Adjust. * method.c (synthesized_method_walk): Initialize check_vdtor. From-SVN: r162159
2010-06-29Enable implicitly deleted functions (N2346)Jason Merrill1-0/+2
Enable implicitly deleted functions (N2346) * class.c (check_bases_and_members): Adjust lambda flags. * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate. From-SVN: r161581
2010-06-29Machinery to support implicit delete/move.Jason Merrill1-159/+598
* cp-tree.h: (struct lang_type_class): Add lazy_move_assign, has_complex_move_ctor, has_complex_move_assign bitfields. (CLASSTYPE_LAZY_MOVE_ASSIGN): New. (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New. (TYPE_HAS_COMPLEX_MOVE_CTOR): New. (enum special_function_kind): Add sfk_move_assignment. (LOOKUP_SPECULATIVE): New. * call.c (build_over_call): Return early if it's set. (build_over_call): Use trivial_fn_p. * class.c (check_bases): If the base has no default constructor, the derived one is non-trivial. Handle move ctor/op=. (check_field_decl): Likewise. (check_bases_and_members): Handle move ctor/op=. (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN. (type_has_move_constructor, type_has_move_assign): New. * decl.c (grok_special_member_properties): Handle move ctor/op=. * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New. (trivial_fn_p): New. (do_build_copy_constructor): Use it. (do_build_assign_ref): Likewise. Handle move assignment. (build_stub_type, build_stub_object, locate_fn_flags): New. (locate_ctor): Use locate_fn_flags. (locate_copy, locate_dtor): Remove. (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New. (process_subob_fn, synthesized_method_walk): New. (maybe_explain_implicit_delete): New. (implicitly_declare_fn): Use synthesized_method_walk, type_has_trivial_fn, and type_set_nontrivial_flag. (defaulted_late_check): Set DECL_DELETED_FN. (defaultable_fn_check): Handle sfk_move_assignment. (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare implicitly deleted move ctor/op=. * search.c (lookup_fnfields_1): Handle sfk_move_assignment. (lookup_fnfields_slot): New. * semantics.c (omp_clause_info_fndecl): Remove. (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor, get_copy_assign, trivial_fn_p. (trait_expr_value): Adjust call to locate_ctor. * tree.c (special_function_p): Handle sfk_move_assignment. From-SVN: r161579
2010-06-29cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.Jason Merrill1-17/+17
* cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN. (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN. (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR. (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR. (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN. (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR. (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN. (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR. (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN. (sfk_assignment_operator): Rename to sfk_copy_assignment. * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust. * search.c, semantics.c, tree.c: Adjust. From-SVN: r161577
2010-06-16method.c (defaulted_late_check): Give the defaulted method the same ↵Jason Merrill1-0/+9
exception specification as the implicit... * method.c (defaulted_late_check): Give the defaulted method the same exception specification as the implicit declaration. From-SVN: r160841
2010-06-15class.c (add_implicitly_declared_members): Implicit assignment operators can ↵Jason Merrill1-1/+2
also be virtual overriders. * class.c (add_implicitly_declared_members): Implicit assignment operators can also be virtual overriders. * method.c (lazily_declare_fn): Likewise. From-SVN: r160810
2010-05-25Makefile.in (EXCEPT_H): Fix typo.Steven Bosscher1-3/+1
gcc/ChangeLog: * Makefile.in (EXCEPT_H): Fix typo. objc/ChangeLog: * objc-act.h: Do not include gimple.h. * objc-act.c: Do not include rtl.h, expr.h, libfuncs.h, and tm_p.h. Include gimple.h. Explain why except.h has to be included. * objc-lang.c: Do not include diagnostics.h. * Make-lang.in: Update dependencies. objcp/ChangeLog: * objcp-decl.c: Do not include tm.h, rtl.h, expr.h, c-common.h, flags.h, input.h, except.h, output.h, toplev.h, cpplib.h, debug.h, and target.h. * objcp-lang.c: Do not include tm.h, toplev.h, diagnostics.h, and debug.h. Explain why except.h has to be included. * Make-lang.in: Update dependencies. cp/ChangeLog: * cp-tree.h: Do not include splay-tree.h. (struct prtmem_cst): Remove unused field and false comment. * typeck.c: Do not include rtl.h, expr.h, and tm_p.h. * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h. * init.c: Do not include rtl.h and expr.h. * class.c: Do not include rtl.h. Include splay-tree.h. (build_clone): Use plain NULL instead of NULL_RTX. * decl.c: Do not include expr.h. Explain why rtl.h has to be included. Include splay-tree.h. * method.c: Do not include rtl.h and expr.h. (use_thunk): Use plain NULL instead of NULL_RTX. * except.c: Do not include rtl.h, expr.h, and libfuncs.h. * tree.c: Do not include rtl.h, insn-config.h, integrate.h, and target.h. Include splay-tree.h. * expr.c: Do not include rtl.h and expr.h. * pt.c: Do not include obstack.h and rtl.h. (tsubst_friend_function): Use plain NULL instead of NULL_RTX. (tsubst_decl): Likewise. (instantiate_decl): Likewise. * semantics.c: Do not include exprt.h and debug.h. Explain why rtl.h has to be included. * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h. * call.c: Do not include rtl.h and expr.h. * search.c: Do not include obstack.h and rtl.h. * friend.c: Do not include rtl.h and expr.h. * Make-lang.in: Update dependencies. From-SVN: r159839
2010-05-19call.c (reference_binding): Use cp_build_qualified_type_real and ↵Jason Merrill1-2/+2
cp_type_quals consistently. * call.c (reference_binding): Use cp_build_qualified_type_real and cp_type_quals consistently. (add_function_candidate): Likewise. (build_conditional_expr): Likewise. (convert_like_real): Likewise. (type_passed_as): Likewise. * class.c (add_method): Likewise. (same_signature_p): Likewise. (layout_class_type): Likewise. * decl.c (cxx_init_decl_processing): Likewise. (cp_fname_init): Likewise. (grokdeclarator): Likewise. * decl2.c (cp_reconstruct_complex_type): Likewise. * init.c (build_new_1): Likewise. * method.c (do_build_copy_constructor): Likewise. (implicitly_declare_fn): Likewise. * pt.c (tsubst_aggr_type): Likewise. (tsubst): Likewise. * rtti.c (init_rtti_processing): Likewise. (build_headof): Likewise. (build_dynamic_cast_1): Likewise. (tinfo_base_init): Likewise. (emit_support_tinfos): Likewise. * semantics.c (capture_decltype): Likewise. * tree.c (cv_unqualified): Likewise. * typeck.c (composite_pointer_type): Likewise. (string_conv_p): Likewise. * mangle.c (write_CV_qualifiers_for_type): Tweak. * call.c (initialize_reference): Use CP_TYPE_CONST_P. * decl.c (start_decl): Likewise. * semantics.c (finish_compound_literal): Likewise. * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P. (cp_type_readonly): Remove. * cp-tree.h: Remove declaration. From-SVN: r159599
2010-03-20re PR c++/43375 (ICE during compiling SSE code)Dodji Seketeli1-3/+6
Fix for PR c++/43375 gcc/cp/ChangeLog: PR c++/43375 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC is NULL. * decl2.c (vague_linkage_p): Likewise. gcc/testsuite/g++.dg/ChangeLog: PR c++/43375 * g++.dg/abi/mangle42.C: New test. From-SVN: r157590
2010-03-03re PR c++/12909 (ambiguity in mangling vector types)Jason Merrill1-15/+19
PR c++/12909 * method.c (make_alias_for): Handle VAR_DECL, too. * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p. * tree.c (no_linkage_check): Adjust. * decl.c (maybe_commonize_var): Adjust. * mangle.c (mangle_decl): Adjust. * cp-tree.h: Adjust. From-SVN: r157202
2010-03-03re PR c++/12909 (ambiguity in mangling vector types)Jason Merrill1-0/+1
PR c++/12909 * mangle.c: Include cgraph.h. (mangle_decl): If the mangled name will change in a later ABI version, make the later mangled name an alias. * method.c (make_alias_for): Copy DECL_ARGUMENTS. * Make-lang.in (mangle.o): Depend on cgraph.h. From-SVN: r157201
2010-02-10PR c++/42983, core issue 906Jason Merrill1-0/+3
PR c++/42983, core issue 906 * method.c (defaultable_fn_check): Check virtualness. * include/std/thread (~_Impl_base): Move default out of line. * libsupc++/nested_exception.h (~nested_exception): Likewise. From-SVN: r156672
2009-11-29cgraph.c (same_body_alias_1): Break out ofJan Hubicka1-150/+14
* cgraph.c (same_body_alias_1): Break out of (same_body_alias): ... here; remove comdat check; it is handled in cp already. (cgraph_add_thunk): New. (dump_cgraph_node): Dump aliases and thunks. * cgraph.h (cgraph_thunk_info): New structure. (struct cgraph_node): Add thunk info. (cgraph_add_thunk): New. * cgraphunit.c (cgraph_emit_thunks): Remove. (cgraph_finalize_compilation_unit): Do not call cgraph_emit_thunks. (assemble_thunk): New function. (cgraph_expand_function): Handle thunks. (thunk_adjust): New. (init_lowered_empty_function): New. * optimize.c (maybe_clone_body): Emit thunks associated to alias. * Make-lang.in (method.o): Add dependency on gimple.h. * method.c: Include gimple.h (make_alias_for_thunk): Use same body alias instead of assemble_alias. (use_thunk): Drop codegen; use cgraph_add_thunk; gimplify generic thunks. * semantics.c (expand_or_defer_fn): Emit associated thunks. * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove. * lto-cgraph.c (lto_output_node): Stream thunk info. (input_node): Likewise. * langhooks.h (lang_hooks_for_callgraph): Remove emit_associated_thunks. * langhooks-def.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove. (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update. * i386.c (x86_output_mi_thunk): Make output prettier. From-SVN: r154736
2009-11-05re PR c++/34180 (Default copy constructor copies const auto_ptr members)Jason Merrill1-0/+1
PR c++/34180 * method.c (do_build_copy_constructor): Don't drop cv-quals from the field type. From-SVN: r153960
2009-11-04re PR c++/15882 (Check for return type of overloaded operator new too early)Jason Merrill1-1/+1
PR c++/15882 * method.c (use_thunk): Check DECL_WEAK as well as DECL_ONE_ONLY. From-SVN: r153909