File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,7 @@ NarrowingKind StandardConversionSequence::getNarrowingKind(
509509 constexpr auto CanRepresentAll = [](bool FromSigned, unsigned FromWidth,
510510 bool ToSigned, unsigned ToWidth) {
511511 return (FromWidth < ToWidth + (FromSigned == ToSigned)) &&
512- (FromSigned <= ToSigned);
512+ ! (FromSigned && ! ToSigned);
513513 };
514514
515515 if (CanRepresentAll(FromSigned, FromWidth, ToSigned, ToWidth))
@@ -542,7 +542,7 @@ NarrowingKind StandardConversionSequence::getNarrowingKind(
542542 // If the bit-field width was dependent, it might end up being small
543543 // enough to fit in the target type (unless the target type is unsigned
544544 // and the source type is signed, in which case it will never fit)
545- if (DependentBitField && (FromSigned <= ToSigned))
545+ if (DependentBitField && ! (FromSigned && ! ToSigned))
546546 return NK_Dependent_Narrowing;
547547
548548 // Otherwise, such a conversion is always narrowing
You can’t perform that action at this time.
0 commit comments