Make moc grok binary literals with digit separators

Task-number: QTBUG-75656
Change-Id: I6011ef2fb07497cc2a055d6828a1b6356927c281
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Ville Voutilainen 2019-05-10 16:45:56 +03:00
parent c99678fb19
commit 2a1651cc16
2 changed files with 3 additions and 1 deletions

View File

@ -241,7 +241,8 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
if (!*data || *data != '.') {
token = INTEGER_LITERAL;
if (data - lexem == 1 &&
(*data == 'x' || *data == 'X')
(*data == 'x' || *data == 'X'
|| *data == 'b' || *data == 'B')
&& *lexem == '0') {
++data;
while (is_hex_char(*data) || *data == '\'')

View File

@ -524,6 +524,7 @@ private:
#ifdef Q_MOC_RUN
int xx = 11'11; // digit separator must not confuse moc (QTBUG-59351)
int xx = 0b11'11; // digit separator in a binary literal must not confuse moc (QTBUG-75656)
#endif
private slots: