Skip to content

Commit f7da573

Browse files
committed
Added throws to test case that throws an exception
In preparation for emitting `noexcept` by default again
1 parent 0f6b381 commit f7da573

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

regression-tests/mixed-out-destruction.cpp2

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ struct C {
1919

2020
//-------------------------------------------------------
2121
// 0x: Test one level of out and immediate throw
22-
f00: () = { c:C="f00"; x: X; f01(out x); }
23-
f01: (out x: X) = { c:C="f01"; x=(); throw_1(); }
22+
f00: () throws = { c:C="f00"; x: X; f01(out x); }
23+
f01: (out x: X) throws = { c:C="f01"; x=(); throw_1(); }
2424

2525
//-------------------------------------------------------
2626
// 1x: Test multiple levels of out and intermediate throw
27-
f10: () = { c:C="f10"; x: X; f11(out x); }
28-
f11: (out x: X) = { c:C="f11"; f12(out x); }
29-
f12: (out x: X) = { c:C="f12"; f13(out x); throw_1(); }
30-
f13: (out x: X) = { c:C="f13"; f14(out x); }
31-
f14: (out x: X) = { c:C="f14"; x=(); }
27+
f10: () throws = { c:C="f10"; x: X; f11(out x); }
28+
f11: (out x: X) throws = { c:C="f11"; f12(out x); }
29+
f12: (out x: X) throws = { c:C="f12"; f13(out x); throw_1(); }
30+
f13: (out x: X) throws = { c:C="f13"; f14(out x); }
31+
f14: (out x: X) throws = { c:C="f14"; x=(); }
3232

3333
int main() {
3434
C c("main");

regression-tests/test-results/mixed-out-destruction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ int main() {
4444

4545
//-------------------------------------------------------
4646
// 0x: Test one level of out and immediate throw
47-
auto f00() -> void{ C c { "f00" }; cpp2::deferred_init<X> x; f01(&x);}
47+
auto f00() -> void { C c { "f00" }; cpp2::deferred_init<X> x; f01(&x);}
4848
auto f01(cpp2::out<X> x) -> void{C c { "f01" }; x.construct();throw_1();}
4949

5050
//-------------------------------------------------------
5151
// 1x: Test multiple levels of out and intermediate throw
52-
auto f10() -> void{ C c { "f10" }; cpp2::deferred_init<X> x; f11(&x);}
52+
auto f10() -> void { C c { "f10" }; cpp2::deferred_init<X> x; f11(&x);}
5353
auto f11(cpp2::out<X> x) -> void{C c { "f11" }; f12(&x);}
5454
auto f12(cpp2::out<X> x) -> void{C c { "f12" }; f13(&x);throw_1();}
5555
auto f13(cpp2::out<X> x) -> void{C c { "f13" }; f14(&x);}

0 commit comments

Comments
 (0)