]> granicus.if.org Git - clang/commitdiff
[analyzer] Add a FIXME about devirtualization in ctors/dtors.
authorJordan Rose <jordan_rose@apple.com>
Tue, 31 Jul 2012 18:04:49 +0000 (18:04 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 31 Jul 2012 18:04:49 +0000 (18:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161058 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/CallEvent.cpp

index b28c01d0357aef17ee74b31ac22ec9dd51da389f..3b9e1e1979a4f6a70bb26e06d3a88e58644b04bd 100644 (file)
@@ -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;