summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-10-12 14:07:59 +0000
committerDuncan Sands <baldrick@free.fr>2010-10-12 14:07:59 +0000
commit38b918c0cf1c9849f2149e7ad3711c0dc23afac4 (patch)
treeb60079461c317e1ffe8f7557be3fa16a3a14ac5a /clang
parent73d3618223f2081eedcee2dbc4b6f89c4e942214 (diff)
downloadbcm5719-llvm-38b918c0cf1c9849f2149e7ad3711c0dc23afac4.tar.gz
bcm5719-llvm-38b918c0cf1c9849f2149e7ad3711c0dc23afac4.zip
Pacify gcc-4.4.
llvm-svn: 116300
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 424e6d19a46..7f844056a3a 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7217,8 +7217,10 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
if (Enum->isFixed()) {
BestType = BestPromotionType = Enum->getIntegerType();
- // We don't set BestWidth, because BestType is going to be the
- // type of the enumerators.
+ // We don't need to set BestWidth, because BestType is going to be the type
+ // of the enumerators, but we do anyway because otherwise some compilers
+ // warn that it might be used uninitialized.
+ BestWidth = CharWidth;
}
else if (NumNegativeBits) {
// If there is a negative value, figure out the smallest integer type (of
OpenPOWER on IntegriCloud