This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46526] VTable Problem?
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Nov 2010 22:23:36 +0000
- Subject: [Bug c++/46526] VTable Problem?
- Auto-submitted: auto-generated
- References: <bug-46526-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46526
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.11.17 22:22:55
Ever Confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-11-17 22:22:55 UTC ---
struct Base
{
virtual int getid() = 0;
};
struct A : public Base
{
virtual int getid() { return 1; }
};
struct B : public Base
{
virtual int getid() { throw "here"; }
};
int main()
{
A a;
B b;
Base& ar = a;
ar.getid(); // throws
}
Only fails with 4.6.0 and -std=c++0x