[cfe-commits] r172016 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/ExprConstant.cpp lib/Sema/SemaStmt.cpp test/Sema/switch-1.c

jahanian fjahanian at apple.com
Thu Jan 17 12:35:43 PST 2013


On Jan 17, 2013, at 11:31 AM, jahanian <fjahanian at apple.com> wrote:

> 
> On Jan 16, 2013, at 5:19 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> 
>> On Wed, Jan 16, 2013 at 5:05 PM, jahanian <fjahanian at apple.com> wrote:
>>> 
>>> Any more thought on this?
>> 
>> Here's one possible plan:
>> 
>> Add a mode to the expression evaluator which visits all subexpressions
>> and produces warnings for overflow etc. Call it in that mode from
>> CheckCompletedExpr (just added in r172690), except in cases where the
>> expression is required to be constant (the callers of
>> ActOnFinishFullExpr should know this).
> 
> 
> Here is the patch which moves checking to CheckCompletedExpr and avoids re-evaluation.
> I still had to add the overflow check in the case statement because case label expressions do not
> go through ActOnFinishFullExpr.
> 
> 	
> <patch-intoverflow.txt>

Oops I forgot about the 'except' part. A new patch will be coming.

- Fariborz

> 
> - Fariborz
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list