[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 11:31:53 PST 2013


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.

	
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-intoverflow.txt
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130117/800937a0/attachment.txt>
-------------- next part --------------


- Fariborz



More information about the cfe-commits mailing list