[cfe-dev] virtual method calls in ctor/dtor

Olaf Krzikalla Olaf.Krzikalla at tu-dresden.de
Thu Dec 5 06:55:32 PST 2013

Hi all,

before I implement it by myself I'd rather ask. Maybe there is already a 
solution or it is not as simple as I thought.
The question is, whether or not it is possible to implement a warning 
about direct or indirect calls to virtual methods within ctors or dtors.
My approach would be to generate the cfg of the examined ctor/dtor and 
then traverse the execution paths and see if there is such a call. The 
interesting/difficult thing could be to keep track of the "this" 
pointer, since calls by other objects should not lead to such a warning.

What do you think?

Best Olaf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4856 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131205/6d159516/attachment.bin>

More information about the cfe-dev mailing list