]> granicus.if.org Git - clang/commit
Fix a few cases where enum constant handling was using
authorDouglas Gregor <dgregor@apple.com>
Thu, 15 Apr 2010 15:53:31 +0000 (15:53 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 15 Apr 2010 15:53:31 +0000 (15:53 +0000)
commitaf68d4ed6da11634e2915b3ca31da354369e4bc1
treeef2ec8549df30430b2a0f9957b3c5b4b6bfb4df7
parentfb937b8c5f1c5dc9cfd4223b5cae230cc42b0287
Fix a few cases where enum constant handling was using
ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for
the width of an integral type. The former includes padding for bools
(to the target's size) while the latter does not, so we woud end up
zero-extending bools to the target width when we shouldn't. Fixes a
crash-on-valid in the included test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101372 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/SemaCXX/constant-expression.cpp