I know that the code written below is illegal
void doSomething(std::string *s){} int main() { doSomething(&std::string(\"Hello World\")); retur
One reason is that your example would give the method write access to the temporary, which is pointless.
The citation you provided isn't about this situation, it is a specific optimization that is permitted in declarators with initializers.