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++/11875] New: cin.rdbuf()->() crashes g++


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: cin.rdbuf()->() crashes g++
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: david at davidlist dot dk
                CC: gcc-bugs at gcc dot gnu dot org

When compiling C++ source that contains some std::basic_istream<class charT,
class Traits> variable for which rdbuf() is called, g++ crashes when a member
function for the returned basic_streambuf<class charT, class Traits> pointer is
used to call a function, but the function name is omitted (by mistake, of course).

Example (very contrived):

#include <iostream>
using namespace std;

int main()
{
    int a = 0;
    cin >> a;
    cout << "a is now " << a << endl;
    cin.rdbuf()->sputbackc('3');
    cin >> a;
    cout << "a is now " << a << endl;
}

If, in the fourth line in the main() body, the line reads:
cin.rdbuf()->('3');
instead, g++ crashes with a message asking the user to submit a bug report.


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