summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2015-10-01 19:52:44 +0000
committerDouglas Gregor <dgregor@apple.com>2015-10-01 19:52:44 +0000
commit6032d5b332c40a7c009d611a30f1dd70b869ab01 (patch)
treefc2355b9d716dccf469da0a160f185a50e371e8e /clang/lib/Sema
parentb9287b1fba572370eeb83f81e1d5aef8a3c5ba3b (diff)
downloadbcm5719-llvm-6032d5b332c40a7c009d611a30f1dd70b869ab01.tar.gz
bcm5719-llvm-6032d5b332c40a7c009d611a30f1dd70b869ab01.zip
Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check.
NFC llvm-svn: 249060
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index c39c80dc414..8ca3f5693e2 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/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<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);
OpenPOWER on IntegriCloud