@@ -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;
new file mode 100644
@@ -0,0 +1,14 @@
+// Origin: PR c++/46824
+
+class Incomplete;
+struct Ptr
+{
+ operator Incomplete*();
+};
+
+int
+main()
+{
+ Ptr p;
+ *p;
+}