This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58924] Non-member invocation of overload of operator<< when the first argument is a temporary of type std::stringstream
- From: "fanael4 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Oct 2013 13:09:38 +0000
- Subject: [Bug c++/58924] Non-member invocation of overload of operator<< when the first argument is a temporary of type std::stringstream
- Auto-submitted: auto-generated
- References: <bug-58924-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58924
Fanael <fanael4 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fanael4 at gmail dot com
--- Comment #1 from Fanael <fanael4 at gmail dot com> ---
That's expected behavior AFAIU. 'operator<<(basic_ostream<charT, traits>&& os,
const T& x)' is a better match for const char[K] than
'basic_ostream<charT,traits>& basic_ostream<charT,traits>::operator<<(const
void* p)', hence the former gets called, which then forwards the arguments to
'operator<<(basic_ostream<charT, traits>&& os, const charT* x)'.