Joos1W Compiler Framework
All Classes Functions Typedefs Pages
Assert.cc
1 #include "utils/Assert.h"
2 
3 #include <utils/Error.h>
4 
5 namespace utils {
6 
7 void _my_assert_fail(const char* assertion, std::source_location location) {
8  // clang-format off
9  throw utils::AssertError(
10  "\n"
11  "Assertion failed: " + std::string(assertion) + "\n" +
12  " at: " + location.file_name() + ":" + std::to_string(location.line()) + "\n" +
13  " function: " + location.function_name()
14  );
15  // clang-format on
16 }
17 
18 } // namespace utils