Introduce a new expression type, CXXUnresolvedConstructExpr, to
describe the construction of a value of a given type using function
syntax, e.g.,
  
  T(a1, a2, ..., aN)

when the type or any of its arguments are type-dependent. In this
case, we don't know what kind of type-construction this will be: it
might construct a temporary of type 'T' (which might be a class or
non-class type) or might perform a conversion to type 'T'. Also,
implement printing of and template instantiation for this new
expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr,
our existing tests cover template instantiation of this new expression
node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72176 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 30a7598..b957510 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -164,14 +164,11 @@
       CallExpr::hasAnyTypeDependentArguments(Exprs, NumExprs)) {
     exprs.release();
     
-    // FIXME: Is this correct (I don't think so). Instead, we should have an 
-    // CXXUnresolvedTemporaryObjectExpr node for this.
-    CXXTempVarDecl *Temp = CXXTempVarDecl::Create(Context, CurContext, Ty);
-
-    return Owned(new (Context) CXXTemporaryObjectExpr(Context, Temp, 0, Ty, 
-                                                      TyBeginLoc,
-                                                      Exprs, NumExprs,
-                                                      RParenLoc));
+    return Owned(CXXUnresolvedConstructExpr::Create(Context, 
+                                                    TypeRange.getBegin(), Ty, 
+                                                    LParenLoc,
+                                                    Exprs, NumExprs,
+                                                    RParenLoc));
   }