summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/moc/preprocessor.cpp3
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index e83125925d..d135bddb4c 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -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 == '\'')
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 293cbd8323..41bc4bc73b 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -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: