diff options
author | Dodji Seketeli <dodji@redhat.com> | 2009-12-23 00:31:33 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2009-12-23 01:31:33 +0100 |
commit | 58326a562079d2a2a732fb869767c0611694ba96 (patch) | |
tree | bf27e39059a5d3b482c3c5aaacaccd3688912360 /gcc/cp/search.c | |
parent | 79e2daa9a1608d88555a246d588960b68a55cb88 (diff) | |
download | gcc-58326a562079d2a2a732fb869767c0611694ba96.zip gcc-58326a562079d2a2a732fb869767c0611694ba96.tar.gz gcc-58326a562079d2a2a732fb869767c0611694ba96.tar.bz2 |
re PR c++/42260 (ICE looking up template conversion operator)
Fix PR c++/42260
gcc/cp/ChangeLog:
PR c++/42260
* cp-tree.h (lookup_conversions): Add new bool parameter to
declaration.
* search.c (lookup_conversion): Use new bool parameter in
definition.
* call.c (add_builtin_candidates): Don't lookup template conversion
(convert_class_to_reference, build_user_type_conversion_1,
build_op_call): Adjust.
* cvt.c (build_expr_type_conversion): Likewise
gcc/testsuite/ChangeLog:
PR c++/42260
* conversion/cast2.C: New test.
From-SVN: r155415
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r-- | gcc/cp/search.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 3e9bec0..c07a5e6 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -2419,10 +2419,13 @@ lookup_conversions_r (tree binfo, functions in this node were selected. This function is effectively performing a set of member lookups as lookup_fnfield does, but using the type being converted to as the unique key, rather than the - field name. */ + field name. + If LOOKUP_TEMPLATE_CONVS_P is TRUE, the returned TREE_LIST contains + the non-hidden user-defined template conversion functions too. */ tree -lookup_conversions (tree type) +lookup_conversions (tree type, + bool lookup_template_convs_p) { tree convs, tpl_convs; tree list = NULL_TREE; @@ -2449,6 +2452,9 @@ lookup_conversions (tree type) } } + if (lookup_template_convs_p == false) + tpl_convs = NULL_TREE; + for (; tpl_convs; tpl_convs = TREE_CHAIN (tpl_convs)) { tree probe, next; |