Skip to content

Commit 2f16a69

Browse files
committed
Updated assert_fatal
1 parent 1ecc00f commit 2f16a69

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

buildcc/lib/env/include/env/assert_fatal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace buildcc::env {
3131
* exit)
3232
* During Unit Test -> throw std::exception
3333
*/
34-
void assert_handle_fatal();
34+
[[noreturn]] void assert_handle_fatal();
3535

3636
/**
3737
* @brief Compile time expr asserts fatally when false

buildcc/lib/env/mock/assert_fatal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
namespace buildcc::env {
66

7-
void assert_handle_fatal() { throw std::exception(); }
7+
[[noreturn]] void assert_handle_fatal() { throw std::exception(); }
88

99
} // namespace buildcc::env

buildcc/lib/env/src/assert_fatal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ bool IsRunningOnThread() {
3535

3636
namespace buildcc::env {
3737

38-
void assert_handle_fatal() {
38+
[[noreturn]] void assert_handle_fatal() {
3939
if (!IsRunningOnThread()) {
4040
std::exit(1);
41+
} else {
42+
throw std::exception();
4143
}
42-
43-
throw std::exception();
4444
}
4545

4646
} // namespace buildcc::env

0 commit comments

Comments
 (0)