https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66717
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-07-01 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The static_assert suggests the deduction is correct, so I'm not sure, but the problem could just be a misleading diagnostic. Trying to initialize the const int& could be attempting to create a temporary of type int (which the reference could bind to) and then giving an error complaining that the creation of that temporary fails. Presumably it tries the same thing in the string case, but when creating a string temporary fails it gives a useful error, not an error about an unwanted side-effect.