Skip to content

Commit bf97ad8

Browse files
authored
Update ASTContext.cpp
1 parent 3f61d83 commit bf97ad8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7118,12 +7118,15 @@ QualType ASTContext::isPromotableBitField(Expr *E) const {
71187118
// We perform that promotion here to match GCC and C++.
71197119
// FIXME: C does not permit promotion of an enum bit-field whose rank is
71207120
// greater than that of 'int'. We perform that promotion to match GCC.
7121-
if (BitWidth < IntSize)
7121+
if (BitWidth < IntSize) {
7122+
if (getLangOpts().MicrosoftExt || getLangOpts().MSVCCompat)
7123+
return {};
71227124
#ifdef _WIN32
71237125
return {};
71247126
#else
71257127
return IntTy;
71267128
#endif
7129+
}
71277130

71287131
if (BitWidth == IntSize)
71297132
return FT->isSignedIntegerType() ? IntTy : UnsignedIntTy;

0 commit comments

Comments
 (0)