NoQ added a comment.

Maxim, totally thanks for picking this up!

Could you explain the idea behind `shouldDeferScopeEnd`, maybe in a code 
comment before the function?

In https://reviews.llvm.org/D16403#788926, @m.ostapenko wrote:

> Current patch should support basic {If, While, For, Compound, Switch}Stmts as 
> well as their interactions with {Break, Continue, Return}Stmts.
>  GotoStmt and CXXForRangeStmt are not supported at this moment.


`SwitchStmt` isn't much easier than `GotoStmt`; it doesn't jump backwards, but 
it can still jump into multiple different scopes. Does your code handle Duff's 
device (1) <https://www.lysator.liu.se/c/duffs-device.html> (2) 
<https://en.wikipedia.org/wiki/Duff's_device> correctly? We should probably add 
it as a test, or split out switch support into a separate patch together with 
goto, if such test isn't yet supported.


Repository:
  rL LLVM

https://reviews.llvm.org/D16403



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to