According to intro.abstract#1:
... conforming implementations are required to emulate (only) the observable behavior of the abstract machine as explained below.
This explanation is the as-if rule, which contains the following example:
... an actual implementation need not evaluate part of an expression if it can deduce that its value is not used and that no side effects affecting the observable behavior of the program are produced.
The definition of a side-effect is in intro.execution#7:
Reading an object designated by a volatile glvalue ([basic.lval]), modifying an object, calling a library I/O function, or calling a function that does any of those operations are all side effects, which are changes in the state of the execution environment. ...
It seems to me that in the following program:
int main()
{
throw 42;
}
The value of the expression throw 42;
is not used, and it doesn't satisfy any of the criteria of being a side-effect.
Does that mean the implementation is allowed to not evaluate this expression? Is the above program equivalent to:
int main() {}
as far as the abstract machine is considered? I can't find any text that says the abstract machine knows or cares about exceptions.