diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-09-29 22:58:31 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-09-29 22:58:31 +0000 |
commit | 18140454abfc73d86393a2df4bf67615bffb7a2c (patch) | |
tree | 32f7792d6eb97f6f0424af7fec2996644b3dc215 /gcc/cp/decl2.c | |
parent | 004a09342d166735b88fa83b121b78894ccde2c6 (diff) | |
download | gcc-18140454abfc73d86393a2df4bf67615bffb7a2c.zip gcc-18140454abfc73d86393a2df4bf67615bffb7a2c.tar.gz gcc-18140454abfc73d86393a2df4bf67615bffb7a2c.tar.bz2 |
re PR c++/54738 ([C++11][SFINAE] Hard errors for pointer-to-member function expressions)
/cp
2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54738
* decl2.c (build_offset_ref_call_from_tree): Add tsubst_flags_t
parameter.
* pt.c (tsubst_copy_and_build): Adjust.
* parser.c (cp_parser_postfix_expression): Likewise.
* cp-tree.h: Adjust declaration.
/testsuite
2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54738
* g++.dg/cpp0x/sfinae42.C: New.
From-SVN: r191862
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a590d17..4cff051 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4087,7 +4087,8 @@ cp_write_global_declarations (void) ARGS. */ tree -build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args) +build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args, + tsubst_flags_t complain) { tree orig_fn; VEC(tree,gc) *orig_args = NULL; @@ -4115,7 +4116,7 @@ build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args) if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE) { if (TREE_CODE (fn) == DOTSTAR_EXPR) - object = cp_build_addr_expr (object, tf_warning_or_error); + object = cp_build_addr_expr (object, complain); VEC_safe_insert (tree, gc, *args, 0, object); } /* Now that the arguments are done, transform FN. */ @@ -4130,17 +4131,17 @@ build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args) void B::g() { (this->*p)(); } */ if (TREE_CODE (fn) == OFFSET_REF) { - tree object_addr = cp_build_addr_expr (object, tf_warning_or_error); + tree object_addr = cp_build_addr_expr (object, complain); fn = TREE_OPERAND (fn, 1); fn = get_member_function_from_ptrfunc (&object_addr, fn, - tf_warning_or_error); + complain); VEC_safe_insert (tree, gc, *args, 0, object_addr); } if (CLASS_TYPE_P (TREE_TYPE (fn))) - expr = build_op_call (fn, args, tf_warning_or_error); + expr = build_op_call (fn, args, complain); else - expr = cp_build_function_call_vec (fn, args, tf_warning_or_error); + expr = cp_build_function_call_vec (fn, args, complain); if (processing_template_decl && expr != error_mark_node) expr = build_min_non_dep_call_vec (expr, orig_fn, orig_args); |