This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/7824: Temporary ostream doesn't work properly with operator<< and const char*


Synopsis: Temporary ostream doesn't work properly with operator<< and const char*

Responsible-Changed-From-To: unassigned->jason
Responsible-Changed-By: bkoz
Responsible-Changed-When: Wed Nov  6 08:43:44 2002
Responsible-Changed-Why:
    Jason, can you take a look at this? If not, maybe Nathan? I think this is an issue with overload resolution and temporaries. Seems odd.
State-Changed-From-To: open->analyzed
State-Changed-By: bkoz
State-Changed-When: Wed Nov  6 08:43:44 2002
State-Changed-Why:
    Even simpler:
    
    #include <iostream>
    int main()
    {
      const char* str = "Hello world";
    
    #if 1
      // uses operator << void*
      std::ostream(std::cerr.rdbuf()) << str << std::endl;
    #else
      // uses operator << char*
      std::cerr << str << std::endl;
    #endif
    
      return 0;
    }
    
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7824


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]