[Bug c++/55367] New: Probably problem with c++ vptr under templates and multiple ihenritance

2012-11-17 Thread wriabi at email dot com


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: unassig...@gcc.gnu.org

ReportedBy: wri...@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;

}


[Bug c++/55367] Probably problem with c++ vptr under templates and multiple inheritance

2012-11-18 Thread wriabi at email dot com


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



--- Comment #2 from walid riabi  2012-11-18 19:41:00 
UTC ---

I just tried that with the latest version (4.7.2) of MingW under windows 8


[Bug c++/55367] Probably problem with c++ vptr under templates and multiple inheritance

2012-11-18 Thread wriabi at email dot com


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



--- Comment #3 from walid riabi  2012-11-18 19:43:25 
UTC ---

I just tried that with the latest version (4.7.2) of MingW under windows 8


[Bug c++/55367] Probably problem with c++ vptr under templates and multiple inheritance

2012-11-19 Thread wriabi at email dot com


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



--- Comment #6 from walid riabi  2012-11-19 19:48:12 
UTC ---

I'm a candidate:)