[cfe-commits] [PATCH] Fix PR14514: Call destructor automatically after a throw
WenHan Gu (谷汶翰)
wenhan.gu at mediatek.com
Mon Dec 17 17:17:24 PST 2012
Hi Eli,
Actually, I have thought this assertion issue before modifying it.
However, I think, checking destruct-able in one callee is much simple and clear than checking it in *all* caller, right?
If this has some design consideration, please let me know.
Thanks.
From: Eli Friedman [mailto:eli.friedman at gmail.com]
Sent: Tuesday, December 18, 2012 9:07 AM
To: WenHan Gu (谷汶翰)
Cc: anton at korobeynikov.info; andersca at mac.com; rjmccall at apple.com; cfe-commits at cs.uiuc.edu
Subject: Re: [PATCH] Fix PR14514: Call destructor automatically after a throw
On Sun, Dec 16, 2012 at 8:57 PM, WenHan Gu (谷汶翰) <wenhan.gu at mediatek.com<mailto: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/20121218/0bbcead9/attachment.html>
More information about the cfe-commits
mailing list