s++;
saw_period = true;
const char *floatDigitsBegin = s;
+ checkSeparator(TokLoc, s, CSK_BeforeDigits);
s = SkipHexDigits(s);
noSignificand &= (floatDigitsBegin == s);
}
// A binary exponent can appear with or with a '.'. If dotted, the
// binary exponent is required.
if (*s == 'p' || *s == 'P') {
+ checkSeparator(TokLoc, s, CSK_AfterDigits);
const char *Exponent = s;
s++;
saw_exponent = true;
hadError = true;
return;
}
+ checkSeparator(TokLoc, s, CSK_BeforeDigits);
s = first_non_digit;
if (!PP.getLangOpts().HexFloats)
s++;
radix = 10;
saw_period = true;
+ checkSeparator(TokLoc, s, CSK_BeforeDigits);
s = SkipDigits(s); // Skip suffix.
}
if (*s == 'e' || *s == 'E') { // exponent
+ checkSeparator(TokLoc, s, CSK_AfterDigits);
const char *Exponent = s;
s++;
radix = 10;
if (*s == '+' || *s == '-') s++; // sign
const char *first_non_digit = SkipDigits(s);
if (first_non_digit != s) {
+ checkSeparator(TokLoc, s, CSK_BeforeDigits);
s = first_non_digit;
} else {
PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, Exponent-ThisTokBegin),
float d = 1.0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}}
float e = 1e'1; // expected-error {{digit separator cannot appear at start of digit sequence}}
float f = 1e1'ms; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float g = 0.'0; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float h = .'0; // '; // expected-error {{expected expression}}, lexed as . followed by character literal
+ float i = 0x.'0p0; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float j = 0x'0.0p0; // expected-error {{invalid suffix 'x'0.0p0'}}
+ float k = 0x0'.0p0; // '; // expected-error {{expected ';'}}
+ float l = 0x0.'0p0; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float m = 0x0.0'p0; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float n = 0x0.0p'0; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float o = 0x0.0p0'ms; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float p = 0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float q = 0'0e1;
+ float r = 0.'0e1; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float s = 0.0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float t = 0.0e'1; // expected-error {{digit separator cannot appear at start of digit sequence}}
}
#line 123'456