This patch fixes a bug in misdiagnosing correct
use of pointer to data member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89251 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 0eea169..cf2c696 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1445,6 +1445,12 @@
     }
   }
 
+  if (isa<CXXZeroInitValueExpr>(rex)) {
+    // Diagnose use of pointer-to-member type which when used as
+    // the functional cast in a pointer-to-member expression.
+    Diag(Loc, diag::err_pointer_to_member_type) << isIndirect;
+     return QualType();
+  }
   // C++ 5.5p2
   //   The result is an object or a function of the type specified by the
   //   second operand.