File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ template <bool Signed> class IntegralAP final {
119
119
120
120
constexpr unsigned bitWidth () const { return V.getBitWidth (); }
121
121
122
- APSInt toAPSInt (unsigned Bits = 0 ) const { return APSInt (V, Signed); }
123
- APValue toAPValue () const { return APValue (APSInt (V, Signed)); }
122
+ APSInt toAPSInt (unsigned Bits = 0 ) const { return APSInt (V, ! Signed); }
123
+ APValue toAPValue () const { return APValue (APSInt (V, ! Signed)); }
124
124
125
125
bool isZero () const { return V.isZero (); }
126
126
bool isPositive () const { return V.isNonNegative (); }
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ namespace i128 {
56
56
57
57
static const __uint128_t UINT128_MAX =__uint128_t (__int128_t (-1L ));
58
58
static_assert (UINT128_MAX == -1 , " " );
59
+ static_assert (UINT128_MAX == 1 , " " ); // expected-error {{static assertion failed}} \
60
+ // expected-note {{'340282366920938463463374607431768211455 == 1'}} \
61
+ // ref-error {{static assertion failed}} \
62
+ // ref-note {{'340282366920938463463374607431768211455 == 1'}}
59
63
60
64
static const __int128_t INT128_MAX = UINT128_MAX >> (__int128_t )1 ;
61
65
static_assert (INT128_MAX != 0 , " " );
You can’t perform that action at this time.
0 commit comments