When a member pointer is dereferenced, the class it points into must be complete. Enforce this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100925 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 7efba3a..04b3d83 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1847,6 +1847,9 @@
 
   QualType Class(MemPtr->getClass(), 0);
 
+  if (RequireCompleteType(Loc, Class, diag::err_memptr_rhs_to_incomplete))
+    return QualType();
+
   // C++ 5.5p2
   //   [...] to its first operand, which shall be of class T or of a class of
   //   which T is an unambiguous and accessible base class. [p3: a pointer to