Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check.

NFC

llvm-svn: 249060
This commit is contained in:
Douglas Gregor 2015-10-01 19:52:44 +00:00
parent b9287b1fba
commit 6032d5b332
1 changed files with 2 additions and 7 deletions

View 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);