diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-18 10:21:43 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-18 10:21:43 +0000 |
commit | 4405c1ad256149fcd9564c029014f6afa1313cbf (patch) | |
tree | dd9019ca2a1fa34c934ecc6915019c675d4e0b66 /gcc/cp/cvt.c | |
parent | 04ec15fab9e10f969c2826268e471a0ab08ebd58 (diff) | |
download | gcc-4405c1ad256149fcd9564c029014f6afa1313cbf.tar.gz |
/cp
2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52422
* cp-tree.h (build_addr_func, decay_conversion,
get_member_function_from_ptrfunc,
build_m_component_ref, convert_member_func_to_ptr):
Add tsubst_flags_t parameter.
* typeck.c (cp_default_conversion): Add.
(decay_conversion, default_conversion,
get_member_function_from_ptrfunc, convert_member_func_to_ptr):
Add tsubst_flags_t parameter and use it throughout.
(cp_build_indirect_ref, cp_build_array_ref,
cp_build_function_call_vec, convert_arguments, build_x_binary_op,
cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
build_const_cast_1, expand_ptrmemfunc_cst,
convert_for_initialization): Adjust.
* init.c (build_vec_init): Adjust.
* decl.c (grok_reference_init, get_atexit_node): Likewise.
* rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
* except.c (build_throw): Likewise.
* typeck2.c (build_x_arrow): Likewise.
(build_m_component_ref): Add tsubst_flags_t parameter and
use it throughout.
* pt.c (convert_nontype_argument): Adjust.
* semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
* decl2.c (build_offset_ref_call_from_tree): Likewise.
* call.c (build_addr_func): Add tsubst_flags_t parameter and
use it throughout.
(build_call_a, build_conditional_expr_1, build_new_op_1,
convert_like_real, convert_arg_to_ellipsis, build_over_call,
build_special_member_call): Adjust.
* cvt.c (cp_convert_to_pointer, force_rvalue,
build_expr_type_conversion): Likewise.
/testsuite
2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52422
* g++.dg/cpp0x/sfinae33.C: New.
* g++.dg/cpp0x/sfinae34.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 5694abede45..09a589efd02 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1,7 +1,7 @@ /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011 Free Software Foundation, Inc. + 2011, 2012 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -109,7 +109,7 @@ cp_convert_to_pointer (tree type, tree expr) { if (TYPE_PTRMEMFUNC_P (intype) || TREE_CODE (intype) == METHOD_TYPE) - return convert_member_func_to_ptr (type, expr); + return convert_member_func_to_ptr (type, expr, tf_warning_or_error); if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE) return build_nop (type, expr); intype = TREE_TYPE (expr); @@ -188,7 +188,8 @@ cp_convert_to_pointer (tree type, tree expr) { tree object = TREE_OPERAND (expr, 0); return get_member_function_from_ptrfunc (&object, - TREE_OPERAND (expr, 1)); + TREE_OPERAND (expr, 1), + tf_warning_or_error); } } error ("cannot convert %qE from type %qT to type %qT", @@ -550,7 +551,7 @@ force_rvalue (tree expr, tsubst_flags_t complain) expr = build_cplus_new (type, expr, complain); } else - expr = decay_conversion (expr); + expr = decay_conversion (expr, complain); return expr; } @@ -1495,7 +1496,8 @@ build_expr_type_conversion (int desires, tree expr, bool complain) case FUNCTION_TYPE: case ARRAY_TYPE: - return (desires & WANT_POINTER) ? decay_conversion (expr) + return (desires & WANT_POINTER) ? decay_conversion (expr, + tf_warning_or_error) : NULL_TREE; case COMPLEX_TYPE: |