]> granicus.if.org Git - clang/commitdiff
Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check.
authorDouglas Gregor <dgregor@apple.com>
Thu, 1 Oct 2015 19:52:44 +0000 (19:52 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 1 Oct 2015 19:52:44 +0000 (19:52 +0000)
NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249060 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmt.cpp

index c39c80dc414302056cfe0b5850f2fe613601f96e..8ca3f5693e2465b65f4d6181b8382334ddb22650 100644 (file)
@@ -2987,14 +2987,9 @@ bool Sema::DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD,
     //   statement with a non-type-dependent operand.
     assert(AT->isDeduced() && "should have deduced to dependent type");
     return false;
-  } else if (RetExpr) {
-    //  If the deduction is for a return statement and the initializer is
-    //  a braced-init-list, the program is ill-formed.
-    if (isa<InitListExpr>(RetExpr)) {
-      Diag(RetExpr->getExprLoc(), diag::err_auto_fn_return_init_list);
-      return true;
-    }
+  } 
 
+  if (RetExpr) {
     //  Otherwise, [...] deduce a value for U using the rules of template
     //  argument deduction.
     DeduceAutoResult DAR = DeduceAutoType(OrigResultType, RetExpr, Deduced);