In C++11, as an infinite loop with no side-effects, the following program is UB:
int main() {
while (true) {}
}
Is the following also UB?
void foo() {
foo();
}
int main() {
foo();
}
Citations from the standard for both programs would be ideal.