re PR c++/45383 (Implicit conversion to pointer does no longer automatically generate operator== and operator!=.)

Fix PR c++/45383

Reverting the fix for PR c++/42260 fixes c++/45383.
This reverts commit r155415.

gcc/cp/
	Reverted patch for PR c++/42260
	* cp-tree.h (lookup_conversions): Reverted "Add new bool parameter to
	declarationE."
	* search.c (lookup_conversion): Reverted "Use new bool parameter in
	definition".
	* call.c (add_builtin_candidates): Reverted "Don't lookup template
          conversion"
	(convert_class_to_reference, build_user_type_conversion_1,
	 build_op_call): Reverted "Adjust".
	* cvt.c (build_expr_type_conversion): Reverted "Likewise".

gcc/testsuite/
	Reverted patch for PR c++/42260
	* conversion/cast2.C: Reverted New test.

From-SVN: r167248
This commit is contained in:
Dodji Seketeli 2010-11-29 16:30:54 +00:00 committed by Dodji Seketeli
parent 3b8204d789
commit 9c7d5cae18
7 changed files with 28 additions and 29 deletions

View File

@ -1,3 +1,17 @@
2010-11-29 Dodji Seketeli <dodji@redhat.com>
PR c++/45383
Reverted patch for PR c++/42260
* cp-tree.h (lookup_conversions): Reverted "Add new bool parameter to
declarationE."
* search.c (lookup_conversion): Reverted "Use new bool parameter in
definition".
* call.c (add_builtin_candidates): Reverted "Don't lookup template
conversion"
(convert_class_to_reference, build_user_type_conversion_1,
build_op_call): Reverted "Adjust".
* cvt.c (build_expr_type_conversion): Reverted "Likewise".
2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_try_catch_finally_statement): Parse

View File

@ -1093,7 +1093,7 @@ convert_class_to_reference (tree reference_type, tree s, tree expr, int flags)
if (!expr)
return NULL;
conversions = lookup_conversions (s, /*lookup_template_convs_p=*/true);
conversions = lookup_conversions (s);
if (!conversions)
return NULL;
@ -2464,8 +2464,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
if (i == 0 && code == MODIFY_EXPR && code2 == NOP_EXPR)
return;
convs = lookup_conversions (argtypes[i],
/*lookup_template_convs_p=*/false);
convs = lookup_conversions (argtypes[i]);
if (code == COND_EXPR)
{
@ -3028,8 +3027,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
reference to it)... */
}
else
conv_fns = lookup_conversions (fromtype,
/*lookup_template_convs_p=*/true);
conv_fns = lookup_conversions (fromtype);
}
candidates = 0;
@ -3585,7 +3583,7 @@ build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
LOOKUP_NORMAL, &candidates);
}
convs = lookup_conversions (type, /*lookup_template_convs_p=*/true);
convs = lookup_conversions (type);
for (; convs; convs = TREE_CHAIN (convs))
{

View File

@ -5161,7 +5161,7 @@ extern int at_function_scope_p (void);
extern bool at_class_scope_p (void);
extern bool at_namespace_scope_p (void);
extern tree context_for_name_lookup (tree);
extern tree lookup_conversions (tree, bool);
extern tree lookup_conversions (tree);
extern tree binfo_from_vbase (tree);
extern tree binfo_for_vbase (tree, tree);
extern tree look_for_overrides_here (tree, tree);

View File

@ -1503,9 +1503,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
if (!TYPE_HAS_CONVERSION (basetype))
return NULL_TREE;
for (conv = lookup_conversions (basetype, /*lookup_template_convs_p=*/true);
conv;
conv = TREE_CHAIN (conv))
for (conv = lookup_conversions (basetype); conv; conv = TREE_CHAIN (conv))
{
int win = 0;
tree candidate;

View File

@ -2440,13 +2440,10 @@ 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.
If LOOKUP_TEMPLATE_CONVS_P is TRUE, the returned TREE_LIST contains
the non-hidden user-defined template conversion functions too. */
field name. */
tree
lookup_conversions (tree type,
bool lookup_template_convs_p)
lookup_conversions (tree type)
{
tree convs, tpl_convs;
tree list = NULL_TREE;
@ -2473,9 +2470,6 @@ 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;

View File

@ -1,3 +1,9 @@
2010-11-29 Dodji Seketeli <dodji@redhat.com>
PR c++/45383
Reverted patch for PR c++/42260
* conversion/cast2.C: Reverted new test.
2010-11-29 Dodji Seketeli <dodji@redhat.com>
PR debug/46101

View File

@ -1,11 +0,0 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/42260
// { dg-do compile }
struct A
{
template<typename T> operator T*();
};
int i = *A();// { dg-error "no match" }