Skip to content

Commit fc7947e

Browse files
committed
---
yaml --- r: 294907 b: refs/heads/swift-5.1-branch c: 3e3421c h: refs/heads/master i: 294905: 0eeeb3a 294903: e4076b3
1 parent f2b557f commit fc7947e

File tree

10 files changed

+17
-16
lines changed

10 files changed

+17
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ refs/heads/marcrasi-astverifier-disable: 3fac766a23a77ebd0640296bfd7fc116ea60a4e
12421242
refs/heads/revert-22227-a-tall-white-fountain-played: adfce60b2eaa54903ea189bed8a783bca609fa53
12431243
refs/heads/revert-22300-revert-22227-a-tall-white-fountain-played: 5f92040224df7dd4e618fdfb367349df64d8acad
12441244
refs/heads/swift-5.1-old-llvm-branch: 9cef8175146f25b72806154b8a0f4a3f52e3e400
1245-
refs/heads/swift-5.1-branch: 956f48967aaa4f114843e738849dc6e0e8431c48
1245+
refs/heads/swift-5.1-branch: 3e3421c4752ad7f61ffd20cee21a03cd29067944
12461246
refs/tags/swift-4.2.2-RELEASE: e429d1f1aaf59e69d38207a96e56265c7f6fccec
12471247
refs/tags/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-02-a: 3e5a03d32ff3b1e9af90d6c1198c14f938379a6e
12481248
refs/tags/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-03-a: 4591c933063ddcb0d6cd6d0cdd01086b2f9b244d

branches/swift-5.1-branch/lib/Parse/ParseDecl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5665,6 +5665,13 @@ void Parser::parseAbstractFunctionBody(AbstractFunctionDecl *AFD) {
56655665
}
56665666
}
56675667
} else if (auto *E = Element.dyn_cast<Expr *>()) {
5668+
if (auto SE = dyn_cast<SequenceExpr>(E->getSemanticsProvidingExpr())) {
5669+
if (SE->getNumElements() > 0 && isa<AssignExpr>(SE->getElement(1))) {
5670+
// This is an assignment. We don't want to implicitly return
5671+
// it.
5672+
return;
5673+
}
5674+
}
56685675
if (auto F = dyn_cast<FuncDecl>(AFD)) {
56695676
auto RS = new (Context) ReturnStmt(SourceLoc(), E);
56705677
BS->setElement(0, RS);

branches/swift-5.1-branch/test/PrintAsObjC/extensions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ extension NSString {
138138
// CHECK-NEXT: - (T _Nullable)extract2 SWIFT_WARN_UNUSED_RESULT;
139139
// CHECK-NEXT: @end
140140
extension PettableContainer {
141-
@objc func duplicate() -> PettableContainer { _ = 0; fatalError() }
142-
@objc func duplicate2() -> PettableContainer<T> { _ = 0; fatalError() }
143-
@objc func duplicate3() -> PettableContainer<PettableOverextendedMetaphor> { _ = 0; fatalError() }
144-
@objc func extract() -> T { _ = 0; fatalError() }
145-
@objc func extract2() -> T? { _ = 0; fatalError() }
141+
@objc func duplicate() -> PettableContainer { fatalError() }
142+
@objc func duplicate2() -> PettableContainer<T> { fatalError() }
143+
@objc func duplicate3() -> PettableContainer<PettableOverextendedMetaphor> { fatalError() }
144+
@objc func extract() -> T { fatalError() }
145+
@objc func extract2() -> T? { fatalError() }
146146
}

branches/swift-5.1-branch/test/SILGen/closures.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func return_local_generic_function_without_captures<A, R>() -> (A) -> R {
2020

2121
func return_local_generic_function_with_captures<A, R>(_ a: A) -> (A) -> R {
2222
func f(_: A) -> R {
23-
_ = 0
2423
_ = a
2524
}
2625

branches/swift-5.1-branch/test/SILGen/keypath_application.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,5 @@ func writebackNesting(x: inout Int,
219219
// -- set 'b'
220220
// CHECK: function_ref @$sSi19keypath_applicationE1bSivs
221221

222-
_ = 0
223222
x.b[keyPath: y].u[keyPath: z].tt = w
224223
}

branches/swift-5.1-branch/test/SILGen/objc_blocks_bridging.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import Foundation
7474
// CHECK: end_borrow [[BORROWED_SELF_COPY]]
7575
// CHECK: destroy_value [[SELF_COPY]]
7676
@objc dynamic func cFunctionPointer(_ fp: @convention(c) (Int) -> Int, x: Int) -> Int {
77-
_ = 0
7877
_ = fp(x)
7978
}
8079

branches/swift-5.1-branch/test/SILGen/objc_bridging_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ protocol Anyable {
413413
// Make sure we generate correct bridging thunks
414414
class SwiftIdLover : NSObject, Anyable {
415415

416-
@objc func methodReturningAny() -> Any { _ = 0; fatalError() }
416+
@objc func methodReturningAny() -> Any { fatalError() }
417417
// SEMANTIC ARC TODO: This is another case of pattern matching the body of one
418418
// function in a different function... Just pattern match the unreachable case
419419
// to preserve behavior. We should check if it is correct.

branches/swift-5.1-branch/test/SILOptimizer/return.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-swift-frontend %s -emit-sil -verify
22

3-
func singleBlock() -> () {
3+
func singleBlock() -> Int {
44
_ = 0
5-
}
5+
} // expected-error {{missing return in a function expected to return 'Int'}}
66

77
func singleBlock2() -> Int {
88
var y = 0

branches/swift-5.1-branch/test/expr/capture/order.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ func transitiveForwardCapture() {
3434

3535
func transitiveForwardCapture2() {
3636
func ping() -> Int {
37-
_ = 0
3837
_ = pong() // expected-error{{cannot capture 'pong', which would use 'x' before it is declared}}
3938
}
4039
_ = ping()
4140
var x = 1 // expected-note{{'x' declared here}}
4241
func pong() -> Int { // expected-note{{'pong', declared here, captures 'pung'}}
43-
_ = 0
4442
_ = pung()
4543
}
4644
func pung() -> Int { // expected-note{{'pung', declared here, captures 'x'}}
@@ -52,7 +50,6 @@ func transitiveForwardCapture2() {
5250
func transitiveForwardCapture3() {
5351
var y = 2
5452
func ping() -> Int {
55-
_ = 0
5653
_ = pong() // expected-error{{cannot capture 'pong', which would use 'x' before it is declared}}
5754
}
5855
_ = ping()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-frontend %s -emit-sil -verify
22

33
func assertionFailure_isNotNoreturn() -> Int {
4-
_ = 0
4+
_ = 0 // Don't implicitly return the assertionFailure call.
55
assertionFailure("")
66
} // expected-error {{missing return in a function expected to return 'Int'}}
77

0 commit comments

Comments
 (0)