------- Comment #25 from kspiteri at ieee dot org 2006-06-15 06:25 -------
In reply to comment #24:
> No it should not be. a() is a temporary so it cannot be bound to "a&". At
> least it should not be.
Then this is not a bug. The C++ standard in 27.6.2.1 defines
* basic_ostream<charT,traits>& operator<<(const void* p);
as a member of class basic_ostream<charT, traits> and
* template<class traits>
* basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&,
* const char*);
as a helper function.
If the output for attachment 11669 should be
char
void
then ostreams are behaving correctly.
Also, in the attachment, if the line
a() << "";
is changed to
a() << "" << "";
then the output corresponding to that line is changed from
void
to
void
char
Does this mean that a() << "" is returning the temporary variable bound to "a&"
while a() itself cannot be bound to "a&"?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9925