[cfe-commits] Patch - Add fix-it hint for missing case keyword within a switch scope

Douglas Gregor dgregor at apple.com
Wed Apr 20 14:08:16 PDT 2011


On Apr 20, 2011, at 12:54 PM, Richard Trieu wrote:

> Thanks for the comments, Doug.  I'll look into making the changes, just one quick question.
> 
> There are two issues here. The first is that Expr::isIntegerConstantExpr() isn't safe for type- or value-dependent expressions, so we now crash on this ill-formed code:
>  
> Why does Clang crash here instead of returning false?  I didn't see a reason listed in the source why it crashes or why Expr::isIntegerConstantExpr() isn't safe for type- or value-dependent expressions.


Well, we should probably have an assert there, but the design is deliberate: code should not even ask the question about whether it's a constant expression if the expression is type- or value-dependent. It indicates a bug in the caller.

	- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110420/d8e5f1fd/attachment.html>


More information about the cfe-commits mailing list