From: Douglas Gregor Date: Thu, 1 Oct 2015 19:52:44 +0000 (+0000) Subject: Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4007fb7d76039627f1d9df805867d864e8481124;p=clang Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249060 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index c39c80dc41..8ca3f5693e 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -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(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);