[cfe-commits] r89480 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/SemaTemplate/destructor-template.cpp

Douglas Gregor dgregor at apple.com
Fri Nov 20 11:58:21 PST 2009


Author: dgregor
Date: Fri Nov 20 13:58:21 2009
New Revision: 89480

URL: http://llvm.org/viewvc/llvm-project?rev=89480&view=rev
Log:
When checking the base object of a member access expression (b.foo,
b->foo), don't look through pointers unless we have an -> operator.


Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/test/SemaTemplate/destructor-template.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=89480&r1=89479&r2=89480&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Fri Nov 20 13:58:21 2009
@@ -2160,10 +2160,10 @@
         return ExprError();
       }
     }
-  }
 
-  if (BaseType->isPointerType())
-    BaseType = BaseType->getPointeeType();
+    if (BaseType->isPointerType())
+      BaseType = BaseType->getPointeeType();
+  }
 
   // We could end up with various non-record types here, such as extended
   // vector types or Objective-C interfaces. Just return early and let

Modified: cfe/trunk/test/SemaTemplate/destructor-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/destructor-template.cpp?rev=89480&r1=89479&r2=89480&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/destructor-template.cpp (original)
+++ cfe/trunk/test/SemaTemplate/destructor-template.cpp Fri Nov 20 13:58:21 2009
@@ -9,4 +9,11 @@
 
 };
 
+struct Incomplete;
 
+template<typename T>
+void destroy_me(T me) {
+  me.~T();
+}
+
+template void destroy_me(Incomplete*);





More information about the cfe-commits mailing list