http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51149
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-11-16 08:13:54 UTC --- Could you provide self-contained testcases? What do you mean by "forgetting you are working with strings"? Would it help if the compiler reminded it to you like in: pr51149.cc:8:36: error: invalid operands to binary expression ('string' (aka 'basic_string<char>') and 'const char [5]') string theString = anotherString << "text"; ~~~~~~~~~~~~~ ^ ~~~~~~ I think it is very hard to guess in general that you meant something if you wrote something else. Why suggest "+" and not something else? Also, it may make sense with "std::string", but what about every other possible or standard type? What is the correct guess there?