Is this code valid?
int foo() { std::vector& v = std::vector(5, \"X\"); // Do something silly...
The code you've shown is illegal – temporaries can only bind to rvalue references or const lvalue references.
VC++ happens to allow it as an extension (and gives a level 4 warning saying so).