void foo(const std::string& s = "abc") {
// ...
}
// ...
int main() {
// ...
foo();
// ...
}
Will s in foo be dangling? I think because std::string will be constructed from default value "abc", and then this will be a const reference do died temporary.
Am I right?