This is the mail archive of the gcc@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]

How to identify the type of the object being created using the new operator?


Hello,

Statement : A *a = new B;

gets translated in GIMPLE as
1. void * D.2805;
2. struct A * a;
3. D.2805 = operator new (20);
4. a = D.2805;

A is the base class and B is the derived class.
In statement 3, new operator is creating an object of derived class B.
By analyzing the RHS of the assignment statement 3, how can we identify the type (in this case B) of the object being created?


Regards,
Swati


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