Index: testsuite/g++.dg/template/crash100.C
===================================================================
--- testsuite/g++.dg/template/crash100.C	(revision 0)
+++ testsuite/g++.dg/template/crash100.C	(revision 0)
@@ -0,0 +1,24 @@
+// PR c++/44628
+
+template <typename T>
+class Temp
+{
+  int Val;
+  public:
+  operator T&(void)  { return Val; }
+
+  virtual T& operator=(T a ) // { dg-error "overriding" }
+  {
+    Val = a;
+    return Val;
+  }
+};
+
+class Int : public Temp<int>
+{
+  public:
+  Int& operator=(int a) // { dg-error "conflicting return type" }
+  {
+    return (*this);
+  }
+};
Index: cp/typeck.c
===================================================================
--- cp/typeck.c	(revision 161612)
+++ cp/typeck.c	(working copy)
@@ -4781,7 +4781,7 @@ cp_build_unary_op (enum tree_code code, tree xarg,
   tree val;
   const char *invalid_op_diag;
 
-  if (error_operand_p (arg))
+  if (!arg || error_operand_p (arg))
     return error_mark_node;
 
   if ((invalid_op_diag
Index: cp/call.c
===================================================================
--- cp/call.c	(revision 161612)
+++ cp/call.c	(working copy)
@@ -1040,6 +1040,9 @@ convert_class_to_reference (tree reference_type, t
   struct z_candidate *cand;
   bool any_viable_p;
 
+  if (!expr)
+    return NULL;
+
   conversions = lookup_conversions (s, /*lookup_template_convs_p=*/true);
   if (!conversions)
     return NULL;
