From: Jordan Rose Date: Tue, 31 Jul 2012 18:04:49 +0000 (+0000) Subject: [analyzer] Add a FIXME about devirtualization in ctors/dtors. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d8ab45a203eb701c2fd1104492cb4bd7557a3e9;p=clang [analyzer] Add a FIXME about devirtualization in ctors/dtors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161058 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/CallEvent.cpp b/lib/StaticAnalyzer/Core/CallEvent.cpp index b28c01d035..3b9e1e1979 100644 --- a/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -393,6 +393,10 @@ const Decl *CXXInstanceCall::getRuntimeDefinition() const { // If the method is virtual, see if we can find the actual implementation // based on context-sensitivity. + // FIXME: Virtual method calls behave differently when an object is being + // constructed or destructed. It's not as simple as "no devirtualization" + // because a /partially/ constructed object can be referred to through a + // base pointer. We'll eventually want to use DynamicTypeInfo here. if (const CXXMethodDecl *Devirtualized = devirtualize(MD, getCXXThisVal())) return Devirtualized; @@ -527,6 +531,10 @@ const Decl *CXXDestructorCall::getRuntimeDefinition() const { // If the method is virtual, see if we can find the actual implementation // based on context-sensitivity. + // FIXME: Virtual method calls behave differently when an object is being + // constructed or destructed. It's not as simple as "no devirtualization" + // because a /partially/ constructed object can be referred to through a + // base pointer. We'll eventually want to use DynamicTypeInfo here. if (const CXXMethodDecl *Devirtualized = devirtualize(MD, getCXXThisVal())) return Devirtualized;