[cfe-dev] C++ checker for exceptions in destructors

George Kollias via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 2 05:08:27 PST 2016


Hi all,
I'm interested into developing a static analyzer checker that detects
exceptions that escape a destructor. It even seems there is a similar
suggestion in http://clang-analyzer.llvm.org/potential_checkers.html
 (ctordtor.ExptInsideDtor).

As a first step, I modified the alpha.cplusplus.VirtualCall checker to walk
call hierarchies under destructors searching for throw statements
(CXXThrowExpr). It works fine for many cases but there are also some
limitations. One of them is that when we want to visit the body of a
virtual method call "foo.bar()", the call (IIUC) is resolved statically
-according to foo's static type-. Is there any way/API to walk/get all
possible "bar" method implementations? Any examples to look at?

Of course, any other implementation suggestions are welcome.

Cheers,
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160202/703bbf8f/attachment.html>


More information about the cfe-dev mailing list