aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-09-24 09:55:01 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-09-24 09:55:01 +0000
commita271590a43eb22cee96e2c5c3b7a11816502033f (patch)
tree37a53ad2a2bb447786b15d918c7a248400241fa4 /gcc/cp/cvt.c
parentee02baae96517c43f9045fe2cb8f89605bbed1bb (diff)
downloadgcc-a271590a43eb22cee96e2c5c3b7a11816502033f.zip
gcc-a271590a43eb22cee96e2c5c3b7a11816502033f.tar.gz
gcc-a271590a43eb22cee96e2c5c3b7a11816502033f.tar.bz2
re PR c++/44267 (SFINAE does not handle down static_cast over virtual inheritance)
/cp 2011-09-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/44267 * class.c (build_base_path): Add a tsubst_flags_t parameter. (convert_to_base): Adjust call. * typeck.c (build_class_member_access_expr, get_member_function_from_ptrfunc, build_static_cast_1): Likewise. * init.c (dfs_initialize_vtbl_ptrs, emit_mem_initializers): Likewise. * method.c (do_build_copy_constructor, do_build_copy_assign): Likewise. * rtti.c (build_dynamic_cast_1): Likewise. * typeck2.c (build_scoped_ref, build_m_component_ref): Likewise. * call.c (build_over_call, build_special_member_call): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, build_up_reference): Likewise. * cp-tree.h (build_base_path): Adjust declaration. /testsuite 2011-09-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/44267 * g++.dg/template/sfinae28.C: New. From-SVN: r179141
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 8a23d51..3e618d3 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
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@@ -157,7 +157,8 @@ cp_convert_to_pointer (tree type, tree expr)
if (binfo || same_p)
{
if (binfo)
- expr = build_base_path (code, expr, binfo, 0);
+ expr = build_base_path (code, expr, binfo, 0,
+ tf_warning_or_error);
/* Add any qualifier conversions. */
return build_nop (type, expr);
}
@@ -275,7 +276,8 @@ convert_to_pointer_force (tree type, tree expr)
return error_mark_node;
if (binfo)
{
- expr = build_base_path (code, expr, binfo, 0);
+ expr = build_base_path (code, expr, binfo, 0,
+ tf_warning_or_error);
if (expr == error_mark_node)
return error_mark_node;
/* Add any qualifier conversions. */
@@ -341,7 +343,8 @@ build_up_reference (tree type, tree arg, int flags, tree decl)
return error_mark_node;
if (binfo == NULL_TREE)
return error_not_base_type (target_type, argtype);
- rval = build_base_path (PLUS_EXPR, rval, binfo, 1);
+ rval = build_base_path (PLUS_EXPR, rval, binfo, 1,
+ tf_warning_or_error);
}
else
rval