This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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 symtab/11912] C++ name lookup failes


------- Additional Comments From marc dot khouzam at ericsson dot com  2010-09-09 15:08 -------
I've also seen what seems like the same problem in the following example.  Note
that this also fails for GDB 6.8

class bar{};
class foo : public bar {
  public:
    foo() {}  // Comment this line to make things work
    void test() { return; }
};

int main(void) {
    foo f; f.test();
    return 0;
}

//commands to execute in GDB, which will make the last one fail
//b foo::test
//r
//p (*(bar*) this)

The print will cause GDB to report a syntax error.
Removing the constructor of foo fixes the problem.
Adding 'struct' or 'class', as in 'p (*(struct bar*) this)' also fixes the problem.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11912

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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