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]

[Bug c++/30019] New: g++ did not issue a warning when it (IMO) could have


Hi, I mixed up the following code to reset a ostringstream

ostringstream oss;
oss << "Stuff";
oss.str() = "";  // Should have been oss.str( "" );

The third line is creating a temporary variable and assigning it the new ""
value, then it disappears.  Couldn't g++ have warned me of an unused temp? I
know I have seen it do things like that before.

Thanks


-- 
           Summary: g++ did not issue a warning when it (IMO) could have
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dflogeras2 at gmail dot com
  GCC host triplet: Gentoo Linux
GCC target triplet: Target: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30019


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