re PR c++/46824 (chromium-compile failed because error: no match for ‘operator*’ in)
authorDodji Seketeli <dodji@redhat.com>
Sat, 12 Mar 2011 07:28:20 +0000 (07:28 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Sat, 12 Mar 2011 07:28:20 +0000 (08:28 +0100)
PR c++/46824

gcc/cp/

* call.c (add_builtin_candidate)<case INDIRECT_REF>: The type
of the argument of the indirection operator should not be
dependent.  Fix the comment.

gcc/testsuite/

* g++.dg/conversion/cast3.C: New test.

From-SVN: r170897

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

index 7c1e739ad70ce5a3bb844ec24025d9ac8ba646ae..bebb1fcee5d463d110a13a1657bf2f3b895008ab 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-11  Dodji Seketeli  <dodji@redhat.com>
+
+       * call.c (add_builtin_candidate)<case INDIRECT_REF>: The type of
+       the argument of the indirection operator should not be dependent.
+       Fix the comment.
+
 2011-03-11  Jason Merrill  <jason@redhat.com>
 
        PR c++/47125
index a297f5313e375ac42865fc0ec5413e40a4f62643..5953e3524ccb1e4ba720bfb547b2d3bbaaf2858e 100644 (file)
@@ -2150,7 +2150,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
        }
       return;
 
-/* 7 For every cv-qualified or cv-unqualified complete object type T, there
+/* 7 For every cv-qualified or cv-unqualified object type T, there
      exist candidate operator functions of the form
 
             T&      operator*(T*);
@@ -2161,7 +2161,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
 
     case INDIRECT_REF:
       if (TREE_CODE (type1) == POINTER_TYPE
-         && is_complete (TREE_TYPE (type1))
+         && !uses_template_parms (TREE_TYPE (type1))
          && (TYPE_PTROB_P (type1)
              || TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE))
        break;
index 9652b4aae30b78920f424bcd5cb4774ef5365133..412188a01a736e38b89fffe16a5dd307395d3041 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-11  Dodji Seketeli  <dodji@redhat.com>
+
+       * g++.dg/conversion/cast3.C: New test.
+
 2011-03-11  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/template/error45.C: New.
diff --git a/gcc/testsuite/g++.dg/conversion/cast3.C b/gcc/testsuite/g++.dg/conversion/cast3.C
new file mode 100644 (file)
index 0000000..43287a1
--- /dev/null
@@ -0,0 +1,14 @@
+// Origin: PR c++/46824
+
+class Incomplete;
+struct Ptr
+{
+  operator Incomplete*();
+};
+
+int
+main()
+{
+  Ptr p;
+  *p;
+}