What is the point of noreturn?

[dcl.attr.noreturn] provides the following example:

[[ noreturn ]] void f() {
    throw "error";
    // OK
}

but I do not understand what is the point of [[noreturn]], because the return type of the function is already void.

So, what is the point of the noreturn attribute? How is it supposed to be used?

5 Answers
5

Leave a Comment