Author: dgregor Date: Thu Oct 1 14:52:44 2015 New Revision: 249060 URL: http://llvm.org/viewvc/llvm-project?rev=249060&view=rev Log: Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check.
NFC Modified: cfe/trunk/lib/Sema/SemaStmt.cpp Modified: cfe/trunk/lib/Sema/SemaStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=249060&r1=249059&r2=249060&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaStmt.cpp (original) +++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Oct 1 14:52:44 2015 @@ -2987,14 +2987,9 @@ bool Sema::DeduceFunctionTypeFromReturnE // 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); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits