Implement template instantiation for several more kinds of expressions:
  - C++ function casts, e.g., T(foo)
  - sizeof(), alignof()

More importantly, this allows us to verify that we're performing
overload resolution during template instantiation, with
argument-dependent lookup and the "cached" results of name lookup from
the template definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 184c9fe..1d4a3ba 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -216,7 +216,10 @@
                                                Expr **Args,
                                                unsigned NumArgs, 
                                                SourceLocation rParenLoc)
-  : Expr(CXXTemporaryObjectExprClass, writtenTy),
+  : Expr(CXXTemporaryObjectExprClass, writtenTy,
+         writtenTy->isDependentType(),
+         (writtenTy->isDependentType() ||
+          CallExpr::hasAnyValueDependentArguments(Args, NumArgs))),
     TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc),
     Constructor(Cons), Args(0), NumArgs(NumArgs) {
   if (NumArgs > 0) {