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(
509
509
constexpr auto CanRepresentAll = [](bool FromSigned, unsigned FromWidth,
510
510
bool ToSigned, unsigned ToWidth) {
511
511
return (FromWidth < ToWidth + (FromSigned == ToSigned)) &&
512
- (FromSigned <= ToSigned);
512
+ ! (FromSigned && ! ToSigned);
513
513
};
514
514
515
515
if (CanRepresentAll(FromSigned, FromWidth, ToSigned, ToWidth))
@@ -542,7 +542,7 @@ NarrowingKind StandardConversionSequence::getNarrowingKind(
542
542
// If the bit-field width was dependent, it might end up being small
543
543
// enough to fit in the target type (unless the target type is unsigned
544
544
// and the source type is signed, in which case it will never fit)
545
- if (DependentBitField && (FromSigned <= ToSigned))
545
+ if (DependentBitField && ! (FromSigned && ! ToSigned))
546
546
return NK_Dependent_Narrowing;
547
547
548
548
// Otherwise, such a conversion is always narrowing
You can’t perform that action at this time.
0 commit comments