[cfe-commits] [PATCH] Fix PR14514: Call destructor automatically after a throw

Eli Friedman eli.friedman at gmail.com
Mon Dec 17 17:06:55 PST 2012


On Sun, Dec 16, 2012 at 8:57 PM, WenHan Gu (谷汶翰) <wenhan.gu at mediatek.com>wrote:

>  Hi committers,****
>
> ** **
>
> This patch fix PR14514: *Array of class type didn't call destructor
> automatically after a throw. *****
>
> http://llvm.org/bugs/show_bug.cgi?id=14514****
>
> ** **
>
> Please have a look.****
>
> Thanks!****
>
>
-  assert(!dtor->isTrivial());
+  if (dtor->isTrivial())
+    return;

Something has gone wrong in the other logic in your patch if you need this
change.  We shouldn't push cleanups for elements of an array with a
trivially destructible type.  You should probably be calling
QualType::isDestructedType somewhere.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121217/08f0f476/attachment.html>


More information about the cfe-commits mailing list