Spot the bug in the Result factory

from References
C++23 (GCC 13.3.0) intermediate 4 min 1 issue to find

Find the lifetime bug in this generated result factory.

C++
#include <string>
struct Result {
    const std::string& name;
};
Result make_result() {
    std::string local = "ready";
    return {local};
}
Open in playground
Report an error