+2011-04-26 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/46824
+ * 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-04-26 Jason Merrill <jason@redhat.com>
PR c++/42687
}
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*);
case INDIRECT_REF:
if (TREE_CODE (type1) == POINTER_TYPE
+ && !uses_template_parms (TREE_TYPE (type1))
&& (TYPE_PTROB_P (type1)
|| TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE))
break;
+2011-04-27 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/46824, c++/42260, c++/45383
+ * g++.dg/conversion/cast2.C: New test.
+ * g++.dg/conversion/cast3.C: Likewise.
+ * g++.dg/conversion/cond4.C: Likewise.
+
2011-04-26 Jason Merrill <jason@redhat.com>
* g++.dg/lookup/koenig13.C: New.
--- /dev/null
+// 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" }
--- /dev/null
+// Origin: PR c++/46824
+
+class Incomplete;
+struct Ptr
+{
+ operator Incomplete*();
+};
+
+int
+main()
+{
+ Ptr p;
+ *p;
+}
--- /dev/null
+// Origin: PR c++/45383
+// { dg-do run }
+
+struct null {
+ null() {}
+ template<class T>
+ operator T*() const {
+ return 0;
+ }
+
+ template<class C, class T>
+ operator T C::*() const {
+ return 0;
+ }
+private:
+ null(const null&);
+ null& operator=(const null&);
+ void operator&() const;
+};
+
+static struct null null;
+
+int
+main()
+{
+ int* ptr = null;
+ if (ptr == null)
+ return 0;
+ if (ptr != null)
+ return 1;
+}