Skip to content

Commit 3fc0f17

Browse files
committed
C++: Tweak the catching by value good cases.
1 parent 6518005 commit 3fc0f17

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • cpp/ql/test/query-tests/Best Practices/Exceptions/CatchingByValue

‎cpp/ql/test/query-tests/Best Practices/Exceptions/CatchingByValue/test.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ void catchByValueDerived() {
2020
} catch (DerivedException &e) { }
2121

2222
try {
23-
throw new DerivedException();
24-
} catch (DerivedException *e) { }
23+
throw DerivedException();
24+
} catch (BaseException &e) { }
25+
26+
try {
27+
throw new BaseException();
28+
} catch (BaseException *e) { }
2529

2630
try {
2731
throw DerivedException();

0 commit comments

Comments
 (0)