Applying [[noreturn]] attribute to asset_internal (#4392)

This will silence warnings/errors in functions that don't return values in control flow paths that end with release_assert.
"warning: non-void function does not return a value in all control paths [-Wreturn-type]"
This commit is contained in:
clemahieu 2024-01-24 15:12:25 +00:00 committed by GitHub
commit 92ef79ed54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,7 @@ namespace program_options
}
}
void assert_internal (char const * check_expr, char const * func, char const * file, unsigned int line, bool is_release_assert, std::string_view error = "");
[[noreturn]] void assert_internal (char const * check_expr, char const * func, char const * file, unsigned int line, bool is_release_assert, std::string_view error = "");
#define release_assert_1(check) check ? (void)0 : assert_internal (#check, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, true)
#define release_assert_2(check, error_msg) check ? (void)0 : assert_internal (#check, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, true, error_msg)