Resolve placeholder expressions before trying to deduce
'auto'.  Introduce a convenience method to make this a bit
easier, and use it elsewhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144605 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp
index b70c4ca..3bd671d 100644
--- a/lib/Sema/SemaPseudoObject.cpp
+++ b/lib/Sema/SemaPseudoObject.cpp
@@ -775,12 +775,10 @@
                                         VK_RValue, OK_Ordinary, opcLoc);
 
   // Filter out non-overload placeholder types in the RHS.
-  if (const BuiltinType *PTy = RHS->getType()->getAsPlaceholderType()) {
-    if (PTy->getKind() != BuiltinType::Overload) {
-      ExprResult result = CheckPlaceholderExpr(RHS);
-      if (result.isInvalid()) return ExprError();
-      RHS = result.take();
-    }
+  if (RHS->getType()->isNonOverloadPlaceholderType()) {
+    ExprResult result = CheckPlaceholderExpr(RHS);
+    if (result.isInvalid()) return ExprError();
+    RHS = result.take();
   }
 
   Expr *opaqueRef = LHS->IgnoreParens();