re PR c++/42766 (tree check fail in build_expr_type_conversion)

Fix PR c++/42766

gcc/cp/ChangeLog:
	PR c++/42766
	* cvt.c (build_expr_type_conversion): Look through OVERLOAD.

gcc/testsuite/ChangeLog:
	PR c++/42766
	* g++.dg/conversion/op6.C: New test.

From-SVN: r156020
This commit is contained in:
Dodji Seketeli 2010-01-18 19:11:24 +00:00 committed by Dodji Seketeli
parent 3b9e834309
commit a5cf630e39
4 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-01-18 Dodji Seketeli <dodji@redhat.com>
PR c++/42766
* cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2010-01-17 Dodji Seketeli <dodji@redhat.com>
PR c++/42697

View File

@ -1203,6 +1203,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
int win = 0;
tree candidate;
tree cand = TREE_VALUE (conv);
cand = OVL_CURRENT (cand);
if (winner && winner == cand)
continue;

View File

@ -1,3 +1,8 @@
2010-01-18 Dodji Seketeli <dodji@redhat.com>
PR c++/42766
* g++.dg/conversion/op6.C: New test.
2010-01-18 Uros Bizjak <ubizjak@gmail.com>
PR target/42774

View File

@ -0,0 +1,18 @@
// Origin: PR c++/42766
// { dg-do compile }
template<class T> class smart_pointer {
public:
operator T* () const { }
operator bool () const { }
operator bool () { }
};
class Context { };
typedef smart_pointer<Context> ContextP;
class SvnClient {
~SvnClient();
ContextP svnContext;
};
SvnClient::~SvnClient() {
delete svnContext;
}