diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-02-24 07:31:28 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-02-24 07:31:28 +0000 |
| commit | abcf38a064f2d322f410af70bddfa256c96c174c (patch) | |
| tree | 70418089123dc5710af3cb90d3e8a155ef4c7429 /clang/lib/Sema | |
| parent | eddb33ebd0610300c62817168c8cedee9c2a4ee1 (diff) | |
| download | bcm5719-llvm-abcf38a064f2d322f410af70bddfa256c96c174c.tar.gz bcm5719-llvm-abcf38a064f2d322f410af70bddfa256c96c174c.zip | |
compute the integer width, not the memory width here. We want to know that
_Bool is 1 bit, not 8. This fixes an assertion on the testcase, which is
PR9304 and rdar://9045501.
llvm-svn: 126368
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 64827ff1779..89957e60dec 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -502,8 +502,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, bool HasDependentValue = CondExpr->isTypeDependent() || CondExpr->isValueDependent(); unsigned CondWidth - = HasDependentValue? 0 - : static_cast<unsigned>(Context.getTypeSize(CondTypeBeforePromotion)); + = HasDependentValue ? 0 : Context.getIntWidth(CondTypeBeforePromotion); bool CondIsSigned = CondTypeBeforePromotion->isSignedIntegerType(); // Accumulate all of the case values in a vector so that we can sort them |

