r203336 - [-Wunreachabe-code] Don't warn about unreachable destructors for temporaries.

Ted Kremenek kremenek at apple.com
Fri Mar 7 20:35:41 PST 2014


On Mar 7, 2014, at 7:36 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> 
> 
>> On Mar 7, 2014, at 18:38 , David Blaikie <dblaikie at gmail.com> wrote:
>> 
>>> On Fri, Mar 7, 2014 at 6:22 PM, Ted Kremenek <kremenek at apple.com> wrote:
>>> Author: kremenek
>>> Date: Fri Mar  7 20:22:32 2014
>>> New Revision: 203336
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=203336&view=rev
>>> Log:
>>> [-Wunreachabe-code] Don't warn about unreachable destructors for temporaries.
>> 
>> Can a noreturn function exit by throwing? If so then the dtors are all
>> perfectly reachable. (and I guess your change makes that happen, so it
>> might just be correct without refinement)
> 
> It looks like "yes". C++11 [dcl.attr.noreturn]p2: [ Note: The function may terminate by throwing an exception. — end note ]
> 
> Jordan

Right.  If we want to model this the approach I would take is to modify the CFG (possibly as an optional variant).  The heuristics here only prune code that has been computed to be unreachable. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140307/04393e3a/attachment.html>


More information about the cfe-commits mailing list