diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-09 23:04:56 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-09 23:04:56 +0000 |
commit | a18e70b25c85d7e653e642b5e6e58d6063af3d83 (patch) | |
tree | 3ed909ec4379a7032f622596801f2aad04e05ec9 /lib/AST/ExprConstant.cpp | |
parent | 73189fb7077998a61e3251c65e136da3afcbc5af (diff) |
Issue warning when case value is too large to fit
in case condition type. // rdar://11577384.
Test is conditionalized on x86_64-apple triple as
I am not sure if the INT_MAX/LONG_MAX values in the test
will pass this test for other hosts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 338cd74b32..622f37b178 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -6364,8 +6364,10 @@ bool Expr::isEvaluatable(const ASTContext &Ctx) const { return EvaluateAsRValue(Result, Ctx) && !Result.HasSideEffects; } -APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx) const { +APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx, + llvm::SmallVectorImpl<PartialDiagnosticAt> *Diag) const { EvalResult EvalResult; + EvalResult.Diag = Diag; bool Result = EvaluateAsRValue(EvalResult, Ctx); (void)Result; assert(Result && "Could not evaluate expression"); |