]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/42766 (tree check fail in build_expr_type_conversion)
authorDodji Seketeli <dodji@redhat.com>
Mon, 18 Jan 2010 19:11:24 +0000 (19:11 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Mon, 18 Jan 2010 19:11:24 +0000 (20:11 +0100)
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

gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/conversion/op6.C [new file with mode: 0644]

index ffa7b86dd31915f746326c9c9c4ca1bcedbb7ba0..ccb2afec9e4573aae5e65522fd99183ce7e800bc 100644 (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
index b4cc2b3ed8ceb1bde1f6ca7747a1a0211b2db90d..cbe85965a59df1cf096f02a430d61608cf233dac 100644 (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;
index 2b0d96d794ab74c75ecfc21c4ca4197b082e45c8..11a7540f5719c98187b917fa0850063cb334ad1c 100644 (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
diff --git a/gcc/testsuite/g++.dg/conversion/op6.C b/gcc/testsuite/g++.dg/conversion/op6.C
new file mode 100644 (file)
index 0000000..9aec9f0
--- /dev/null
@@ -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;
+}