[cfe-commits] r83195 - in /cfe/trunk: lib/CodeGen/CGCXXExpr.cpp test/CodeGenCXX/delete.cpp
Douglas Gregor
dgregor at apple.com
Wed Sep 30 22:49:52 PDT 2009
Author: dgregor
Date: Thu Oct 1 00:49:51 2009
New Revision: 83195
URL: http://llvm.org/viewvc/llvm-project?rev=83195&view=rev
Log:
Fix a lame regression in IR gen for C++ delete expressions. PR5102
Modified:
cfe/trunk/lib/CodeGen/CGCXXExpr.cpp
cfe/trunk/test/CodeGenCXX/delete.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXXExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXExpr.cpp?rev=83195&r1=83194&r2=83195&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXXExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXXExpr.cpp Thu Oct 1 00:49:51 2009
@@ -246,6 +246,8 @@
if (ICE->getCastKind() != CastExpr::CK_UserDefinedConversion &&
ICE->getType()->isVoidPointerType())
Arg = ICE->getSubExpr();
+ else
+ break;
}
QualType DeleteTy = Arg->getType()->getAs<PointerType>()->getPointeeType();
Modified: cfe/trunk/test/CodeGenCXX/delete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/delete.cpp?rev=83195&r1=83194&r2=83195&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/delete.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/delete.cpp Thu Oct 1 00:49:51 2009
@@ -23,3 +23,15 @@
// RUN: grep "call void @_ZN1TD1Ev" %t | count 1
delete t;
}
+
+// PR5102
+template <typename T>
+class A {
+ operator T *() const;
+};
+
+void f() {
+ A<char*> a;
+
+ delete a;
+}
More information about the cfe-commits
mailing list