diff options
author | dgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-25 13:53:58 +0000 |
---|---|---|
committer | dgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-25 13:53:58 +0000 |
commit | ebd21de42b0a7eb70c064adaf4cdd0f8a47e4b08 (patch) | |
tree | 3ef47d27df52cfcaa5644727ec9e934a79cad636 /gcc/cp/except.c | |
parent | bc1c54209ff80e00c5c5870eba988d3a32d3bbee (diff) | |
download | gcc-ebd21de42b0a7eb70c064adaf4cdd0f8a47e4b08.tar.gz |
2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
* typeck.c (composite_pointer_type_r): Add SFINAE support.
(composite_pointer_type): Ditto.
(common_type): Fix call to composite_pointer_type.
(cxx_sizeof_nowarn): New; used to be a macro.
(cxx_sizeof_expr): Add SFINAE support.
(cxx_alignof_expr): Ditto.
(decay_conversion): Fix calls for SFINAE support.
(rationalize_conditional_expr): Add SFINAE support.
(build_class_member_access_expr): Ditto.
(finish_class_member_access_expr): Ditto.
(build_x_indirect_ref): Ditto.
(build_indirect_ref): Original version renamed to
cp_build_indirect_ref; new version provides a bridge from
c-common.
(cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
support.
(get_member_function_from_ptrfunc): Fix calls for SFINAE support.
(build_function_call): Original version renamed to
cp_build_function_call; new version provides a bridge from
c-common.
(cp_build_function_call): Was build_function_call; added SFINAE
support.
(convert_arguments): Add SFINAE support.
(build_x_binary_op): Ditto.
(build_binary_op): Original version renamed to cp_build_binary_op;
new version provides a bridge from c-common.
(cp_build_binary_op): Was build_binary_op; added SFINAE support.
(pointer_diff): Fix calls for SFINAE.
(build_x_unary_op): Add SFINAE support.
(condition_conversion): Fix calls for SFINAE.
(build_unary_op): Original version renamed to cp_build_unary_op;
new version provides a bridge from c-common.
(cp_build_unary_op): Was build_unary_op; added SFINAE support.
(unary_complex_lvalue): Fix calls for SFINAE.
(build_x_conditional_expr): Add SFINAE support.
(build_x_compound_expr_from_list): Fix calls for SFINAE.
(build_x_compound_expr): Add SFINAE support.
(convert_ptrmem): Fix calls for SFINAE.
(build_static_cast_1): Add SFINAE support.
(build_static_cast): Ditto.
(build_reinterpret_cast_1): Ditto.
(build_reinterpret_cast): Ditto.
(build_const_cast_1): Ditto.
(build_const_cast): Ditto.
(build_c_cast): Ditto.
(build_modify_expr): Original version renamed to
cp_build_modify_expr; new version provides a bridge from c-common.
(cp_build_modify_expr): Was build_modify_expr; added SFINAE
support.
(build_x_modify_expr): Add SFINAE support.
(build_ptrmemfunc): Fix calls for SFINAE.
(convert_for_assignment): Add SFINAE support.
(convert_for_initialization): Ditto.
(check_return_expr): Fix calls for SFINAE.
(lvalue_or_else): Add SFINAE support.
* init.c (perform_member_init): Fix calls for SFINAE.
(emit_mem_initializers): Ditto.
(expand_virtual_init): Ditto.
(expand_cleanup_for_base): Ditto.
(build_aggr_init): Add SFINAE support.
(expand_default_init): Ditto.
(expand_aggr_init_1): Fix calls for SFINAE.
(build_offset_ref): Ditto.
(build_new_1): Add SFINAE support.
(build_new): Ditto.
(build_vec_delete_1): Fix calls for SFINAE.
(get_temp_regvar): Ditto.
(build_vec_init): Add SFINAE support.
(build_dtor_call): Fix calls for SFINAE.
(build_delete): Ditto.
(push_base_cleanups): Ditto.
(build_vec_delete_1): Ditto.
* class.c (build_base_path): Fix calls for SFINAE.
(build_simple_base_path): Ditto.
(convert_to_base_statically): Ditto.
(build_vfn_ref): Ditto.
(resolve_address_of_overloaded_function): Ditto.
* decl.c (check_initializer): Fix calls for SFINAE.
(register_dtor_fn): Ditto.
(compute_array_index_type): Ditto.
(finish_enum): Ditto.
(start_preparsed_function): Ditto.
(cxx_maybe_build_cleanup): Ditto.
* call.c (convert_like): Add COMPLAIN argument.
(convert_like_with_context): Ditto.
(build_this): Fix calls for SFINAE.
(build_user_type_conversion): Ditto.
(resolve_args): Ditto.
(build_new_function_call): Add SFINAE support.
(build_operator_new_call): Fix calls for SFINAE.
(build_object_call): Add SFINAE support.
(build_conditional_expr): Ditto.
(build_new_op): Ditto.
(build_op_delete_call): Fix calls for SFINAE.
(build_temp): Ditto.
(convert_like_real): Add SFINAE support.
(build_x_va_arg): Fix calls for SFINAE.
(convert_default_arg): Ditto.
(build_over_call): Add SFINAE support.
(build_java_interface_fn_ref): Fix calls for SFINAE.
(build_special_member_call): Add SFINAE support.
(build_new_method_call): Ditto.
(perform_implicit_conversion): Ditto.
(perform_direct_initialization_if_possible): Ditto.
(initialize_reference): Fix calls for SFINAE.
* method.c (do_build_assign_ref): Fix calls for SFINAE.
* rtti.c (build_headof): Fix calls for SFINAE.
(get_tinfo_decl_dynamic): Ditto.
(get_typeid): Ditto.
(build_dynamic_cast_1): Add SFINAE support.
(build_dynamic_cast): Ditto.
(tinfo_base_init): Fix calls for SFINAE.
* except.c (do_get_exception_ptr): Fix calls for SFINAE.
(do_end_catch): Ditto.
(initialize_handler_parm): Ditto.
(expand_start_catch_block): Ditto.
(do_allocate_exception): Ditto.
(do_free_exception): Ditto.
(build_throw): Ditto.
* cvt.c (build_up_reference): Fix calls for SFINAE.
(convert_to_reference): Ditto.
(ocp_convert): Ditto.
(convert_to_void): Add SFINAE support.
* tree.c (build_dummy_object): Fix calls for SFINAE.
(stabilize_expr): Ditto.
* cp-tree.h (build_conditional_expr): Add tsubst_flags_t
parameter.
(build_new_method_call): Ditto.
(build_special_member_call): Ditto.
(build_new_op): Ditto.
(perform_implicit_conversion): Ditto.
(perform_direct_initialization_if_possible): Ditto.
(convert_to_void): Ditto.
(build_aggr_init): Ditto.
(build_new): Ditto.
(build_vec_init): Ditto.
(build_dynamic_cast): Ditto.
(finish_call_expr): Ditto
(cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
(cxx_sizeof_nowarn): Remove macro; add function declaration.
(build_class_member_access_expr): Add tsubst_flags_t parameter.
(finish_class_member_access_expr): Ditto.
(build_x_indirect_ref): Ditto.
(cp_build_indirect_ref): New.
(cp_build_function_call): Add tsubst_flags_t parameter.
(build_x_unary_op): Ditto.
(cp_build_unary_op): New.
(build_x_conditional_expr): Add tsubst_flags_t parameter.
(build_x_compound_expr): Ditto.
(build_compound_expr): Ditto.
(build_static_cast): Ditto.
(build_reinterpret_cast): Ditto.
(build_const_cast): Ditto.
(build_c_cast): Ditto.
(build_x_modify_expr): Ditto.
(cp_build_modify_expr): New.
(convert_for_initialization): Add tsubst_flags_t parameter.
(cp_build_binary_op): Remove macro; add function declaration.
(invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
(lvalue_or_else): Ditto.
(build_functional_cast): Ditto.
* typeck2.c (digest_init): Fix calls for SFINAE.
(process_init_constructor_array): Ditto.
(process_init_constructor_record): Ditto.
(build_x_arrow): Ditto.
(build_m_component_ref): Ditto.
(build_functional_cast): Add SFINAE support.
* pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
* semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
(finish_expr_stmt): Ditto.
(finish_for_expr): Ditto.
(finish_asm_stmt): Ditto.
(finish_non_static_data_member): Ditto.
(finish_qualified_id_expr): Ditto.
(finish_call_expr): Add SFINAE support.
(finish_increment_expr): Fix calls for SFINAE.
(finish_unary_op_expr): Ditto.
(simplify_aggr_init_expr): Ditto.
(finish_omp_clauses): Ditto.
(finish_omp_for): Ditto.
(finish_omp_barrier): Ditto.
(finish_omo_flush): Ditto.
* decl2.c (grok_array_decl): Fix calls or SFINAE.
(build_anon_union_vars): Ditto.
(get_guard_cond): Ditto.
(set_guard): Ditto.
(one_static_initialization_or_destruction): Ditto.
(do_static_initialization_or_destruction): Ditto.
(generate_ctor_or_dtor_function): Ditto.
(build_offset_ref_call_from_tree): Ditto.
* parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
(cp_parser_postfix_dot_deref_expression): Ditto.
(cp_parser_unary_expression): Ditto.
(cp_parser_new_expression): Ditto.
(cp_parser_cast_expression): Ditto.
(cp_parser_binary_expression): Ditto.
(cp_parser_question_colon_clause): Ditto.
(cp_parser_assignment_expression): Ditto.
(cp_parser_expression): Ditto.
(cp_parser_builtin_offsetof): Ditto.
(cp_parser_template_argument): Ditto.
(cp_parser_functional_cast): Ditto.
2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
* c-common.c (c_sizeof_or_alignof_type): If we're not allowed to
complain when we hit an error, return ERROR_MARK_NODE.
2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
* g++.dg/template/sfinae4.C: New.
* g++.dg/template/sfinae5.C: New.
* g++.dg/template/sfinae6.C: New.
* g++.dg/template/sfinae6_neg.C: New.
* g++.dg/template/sfinae7.C: New.
* g++.dg/template/sfinae8.C: New.
* g++.dg/template/sfinae9.C: New.
* g++.dg/template/sfinae10.C: New.
* g++.dg/template/sfinae11.C: New.
* g++.dg/template/sfinae12.C: New.
* g++.dg/template/sfinae13.C: New.
* g++.dg/template/sfinae14C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r-- | gcc/cp/except.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 38111b16338..5304381a499 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -176,8 +176,9 @@ do_get_exception_ptr (void) fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } - return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), - NULL_TREE)); + return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), + NULL_TREE), + tf_warning_or_error); } /* Build up a call to __cxa_begin_catch, to tell the runtime that the @@ -196,8 +197,9 @@ do_begin_catch (void) fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } - return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), - NULL_TREE)); + return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), + NULL_TREE), + tf_warning_or_error); } /* Returns nonzero if cleaning up an exception of type TYPE (which can be @@ -235,7 +237,7 @@ do_end_catch (tree type) TREE_NOTHROW (fn) = 0; } - cleanup = build_function_call (fn, NULL_TREE); + cleanup = cp_build_function_call (fn, NULL_TREE, tf_warning_or_error); TREE_NOTHROW (cleanup) = dtor_nothrow (type); return cleanup; @@ -377,7 +379,7 @@ initialize_handler_parm (tree decl, tree exp) pointer catch parm with the address of the temporary. */ if (TREE_CODE (init_type) == REFERENCE_TYPE && TYPE_PTR_P (TREE_TYPE (init_type))) - exp = build_unary_op (ADDR_EXPR, exp, 1); + exp = cp_build_unary_op (ADDR_EXPR, exp, 1, tf_warning_or_error); exp = ocp_convert (init_type, exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0); @@ -434,7 +436,7 @@ expand_start_catch_block (tree decl) exp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (exp), exp, fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (TREE_TYPE (exp)))); - exp = build_indirect_ref (exp, NULL); + exp = cp_build_indirect_ref (exp, NULL, tf_warning_or_error); initialize_handler_parm (decl, exp); return type; } @@ -546,8 +548,10 @@ do_allocate_exception (tree type) fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } - return build_function_call (fn, tree_cons (NULL_TREE, size_in_bytes (type), - NULL_TREE)); + return cp_build_function_call (fn, + tree_cons (NULL_TREE, size_in_bytes (type), + NULL_TREE), + tf_warning_or_error); } /* Call __cxa_free_exception from a cleanup. This is never invoked @@ -566,7 +570,8 @@ do_free_exception (tree ptr) void_list_node)); } - return build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE)); + return cp_build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE), + tf_warning_or_error); } /* Wrap all cleanups for TARGET_EXPRs in MUST_NOT_THROW_EXPR. @@ -644,7 +649,8 @@ build_throw (tree exp) return error_mark_node; } fn = OVL_CURRENT (fn); - exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE)); + exp = cp_build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE), + tf_warning_or_error); } else if (exp) { @@ -708,7 +714,7 @@ build_throw (tree exp) allocate_expr = get_target_expr (allocate_expr); ptr = TARGET_EXPR_SLOT (allocate_expr); object = build_nop (build_pointer_type (temp_type), ptr); - object = build_indirect_ref (object, NULL); + object = cp_build_indirect_ref (object, NULL, tf_warning_or_error); elided = (TREE_CODE (exp) == TARGET_EXPR); @@ -733,7 +739,7 @@ build_throw (tree exp) (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), - flags)); + flags, tf_warning_or_error)); if (exp == error_mark_node) { error (" in thrown expression"); @@ -812,7 +818,7 @@ build_throw (tree exp) tmp = tree_cons (NULL_TREE, throw_type, tmp); tmp = tree_cons (NULL_TREE, ptr, tmp); /* ??? Indicate that this function call throws throw_type. */ - tmp = build_function_call (fn, tmp); + tmp = cp_build_function_call (fn, tmp, tf_warning_or_error); /* Tack on the initialization stuff. */ exp = build2 (COMPOUND_EXPR, TREE_TYPE (tmp), exp, tmp); @@ -831,7 +837,7 @@ build_throw (tree exp) /* ??? Indicate that this function call allows exceptions of the type of the enclosing catch block (if known). */ - exp = build_function_call (fn, NULL_TREE); + exp = cp_build_function_call (fn, NULL_TREE, tf_warning_or_error); } exp = build1 (THROW_EXPR, void_type_node, exp); |