As far as I am aware, there is no [[maybe_noreturn]]
attribute in C++.
I have a function which looks like this:
void func() {
try {
do_something();
} catch (const std::exception& e) {
std::exit(1);
}
}
If I would mark func
as [[noreturn]]
I'd run into UB for the happy case. Is it UB when I do not return from a function that is not marked as [[noreturn]]
?
Or are there other language constructs, compiler extensions or libraries that implement something like [[maybe_noreturn]]
?