diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-09-05 10:14:37 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-09-05 10:14:37 +0000 |
commit | 22854930b945f09487ca7947326d741ff6328377 (patch) | |
tree | 2f95f089c2fa4d79dab5770ad9a8b5fa4956d54b /gcc/cp/cvt.c | |
parent | b588ae3074e258f5c736034c212e7499a565746f (diff) | |
download | gcc-22854930b945f09487ca7947326d741ff6328377.zip gcc-22854930b945f09487ca7947326d741ff6328377.tar.gz gcc-22854930b945f09487ca7947326d741ff6328377.tar.bz2 |
re PR c++/54191 ([C++11] SFINAE does not handle conversion to inaccessible base)
/cp
2012-09-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54191
* search.c (lookup_base): Add tsubst_flags_t parameter.
(adjust_result_of_qualified_name_lookup, check_final_overrider):
Adjust.
* name-lookup.c (do_class_using_decl): Adjust.
* typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
build_up_reference): Likewise.
* rtti.c (build_dynamic_cast_1): Likewise.
* tree.c (maybe_dummy_object): Likewise.
* call.c (build_conditional_expr_1, build_over_call): Likewise.
* cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
Remove.
(enum base_access_flags, ba_quiet): Remove.
(uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
* except.c (can_convert_eh): Adjust.
* decl.c (grokdeclarator): Likewise.
* typeck.c (comp_except_types, build_class_member_access_expr,
finish_class_member_access_expr, get_member_function_from_ptrfunc,
build_static_cast_1, get_delta_difference_1): Likewise.
* class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
warn_about_ambiguous_bases): Likewise.
(uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
/testsuite
2012-09-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54191
* g++.dg/cpp0x/sfinae39.C: New.
From-SVN: r190969
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 9550f15..86f01ab 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -149,11 +149,13 @@ cp_convert_to_pointer (tree type, tree expr, tsubst_flags_t complain) binfo = NULL_TREE; /* Try derived to base conversion. */ if (!same_p) - binfo = lookup_base (intype_class, type_class, ba_check, NULL); + binfo = lookup_base (intype_class, type_class, ba_check, + NULL, complain); if (!same_p && !binfo) { /* Try base to derived conversion. */ - binfo = lookup_base (type_class, intype_class, ba_check, NULL); + binfo = lookup_base (type_class, intype_class, ba_check, + NULL, complain); code = MINUS_EXPR; } if (binfo == error_mark_node) @@ -279,11 +281,11 @@ convert_to_pointer_force (tree type, tree expr, tsubst_flags_t complain) tree binfo; binfo = lookup_base (TREE_TYPE (intype), TREE_TYPE (type), - ba_unique, NULL); + ba_unique, NULL, complain); if (!binfo) { binfo = lookup_base (TREE_TYPE (type), TREE_TYPE (intype), - ba_unique, NULL); + ba_unique, NULL, complain); code = MINUS_EXPR; } if (binfo == error_mark_node) @@ -352,7 +354,8 @@ build_up_reference (tree type, tree arg, int flags, tree decl, && MAYBE_CLASS_TYPE_P (target_type)) { /* We go through lookup_base for the access control. */ - tree binfo = lookup_base (argtype, target_type, ba_check, NULL); + tree binfo = lookup_base (argtype, target_type, ba_check, + NULL, complain); if (binfo == error_mark_node) return error_mark_node; if (binfo == NULL_TREE) |