From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8076 invoked by alias); 17 Nov 2012 16:22:09 -0000 Received: (qmail 8040 invoked by uid 48); 17 Nov 2012 16:21:55 -0000 From: "wriabi at email dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55367] New: Probably problem with c++ vptr under templates and multiple ihenritance Date: Sat, 17 Nov 2012 16:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: wriabi at email dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01600.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55367 Bug #: 55367 Summary: Probably problem with c++ vptr under templates and multiple ihenritance Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: wriabi@email.com Created attachment 28720 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28720 code snippet Hello, I have some code that compile and work fine in gcc 4.6.2 (without tne new keyword "override" ) but in version 4.7.2 it complie generate access violation runtime. under windows platform. So, i need some help, thank you very much: #include using namespace std; struct Entity { //~Entity() = default; //work fine ~Entity() {} //when i specified my destructor this compile but generate runtime access viloation }; template struct IRepository { virtual T g() = 0; }; struct OtherInterface{ virtual void y() = 0; }; struct IEntityRepository : public virtual IRepository{ }; template struct RepositoryBase : public virtual IRepository, public OtherInterface{ virtual void y() override { cout << "y() override called" << endl; } }; template struct DataRepository : public RepositoryBase{ virtual T f() { cout << "f() called" << endl; this->y(); T t; return t; } T g() override { cout << "g() override called" << endl; ////when i specified my destructor for class Entity this compile but generate runtime access viloation here : on this: probably problem with vptr return this->f(); } }; struct EffectiveEntityRepository : public DataRepository, public IEntityRepository{ }; int main() { IEntityRepository* var = new EffectiveEntityRepository(); var->g(); return 1; }