OSDN Git Service

Fix PR c++/42766
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Jan 2010 19:11:24 +0000 (19:11 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Jan 2010 19:11:24 +0000 (19:11 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156020 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ffa7b86..ccb2afe 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
 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/42697
index b4cc2b3..cbe8596 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);
       int win = 0;
       tree candidate;
       tree cand = TREE_VALUE (conv);
+      cand = OVL_CURRENT (cand);
 
       if (winner && winner == cand)
        continue;
 
       if (winner && winner == cand)
        continue;
index 2b0d96d..11a7540 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
 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;
+}