File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -409,6 +409,9 @@ static unsigned GetAutoSenseRadix(StringRef &Str) {
409
409
410
410
bool llvm::consumeUnsignedInteger (StringRef &Str, unsigned Radix,
411
411
unsigned long long &Result) {
412
+ // Consume the + value
413
+ Str.consume_front (" +" );
414
+
412
415
// Autosense radix if not specified.
413
416
if (Radix == 0 )
414
417
Radix = GetAutoSenseRadix (Str);
Original file line number Diff line number Diff line change @@ -622,19 +622,21 @@ TEST(StringRefTest, Hashing) {
622
622
struct UnsignedPair {
623
623
const char *Str;
624
624
uint64_t Expected;
625
- } Unsigned[] =
626
- { {" 0" , 0 }
627
- , {" 255" , 255 }
628
- , {" 256" , 256 }
629
- , {" 65535" , 65535 }
630
- , {" 65536" , 65536 }
631
- , {" 4294967295" , 4294967295ULL }
632
- , {" 4294967296" , 4294967296ULL }
633
- , {" 18446744073709551615" , 18446744073709551615ULL }
634
- , {" 042" , 34 }
635
- , {" 0x42" , 66 }
636
- , {" 0b101010" , 42 }
637
- };
625
+ } Unsigned[] = {{" 0" , 0 },
626
+ {" 255" , 255 },
627
+ {" 256" , 256 },
628
+ {" 65535" , 65535 },
629
+ {" 65536" , 65536 },
630
+ {" 4294967295" , 4294967295ULL },
631
+ {" 4294967296" , 4294967296ULL },
632
+ {" 18446744073709551615" , 18446744073709551615ULL },
633
+ {" 042" , 34 },
634
+ {" 0x42" , 66 },
635
+ {" 0b101010" , 42 },
636
+ {" +42" , 42 },
637
+ {" +042" , 34 },
638
+ {" +0x42" , 66 },
639
+ {" +0b101010" , 42 }};
638
640
639
641
struct SignedPair {
640
642
const char *Str;
You can’t perform that action at this time.
0 commit comments