An unhandled exception escaping a thread function

worker() throws an exception that is never caught inside the thread function. What happens when this program runs?

main.cpp
void worker() {
    throw std::runtime_error("boom");
}

int main() {
    std::thread t(worker);
    try {
        t.join();
    } catch (const std::exception& e) {
        std::cout << "caught: " << e.what() << std::endl;
    }
    return 0;
}

17 of 51 in Concurrency