diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -18474,9 +18474,6 @@ unsigned NumNegativeBits = 0; unsigned NumPositiveBits = 0; - // Keep track of whether all elements have type int. - bool AllElementsInt = true; - for (unsigned i = 0, e = Elements.size(); i != e; ++i) { EnumConstantDecl *ECD = cast_or_null(Elements[i]); @@ -18491,10 +18488,6 @@ else NumNegativeBits = std::max(NumNegativeBits, (unsigned)InitVal.getMinSignedBits()); - - // Keep track of whether every enum element has type int (very common). - if (AllElementsInt) - AllElementsInt = ECD->getType() == Context.IntTy; } // Figure out the type that should be used for this enum.