summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-01-06 13:12:24 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-19 11:13:57 +0000
commitd07517f0237f9eef0a426e6fabb668665a96461e (patch)
tree5ace9a5087e55ac3c82ef0356deefd5614e6e4fb /tests
parent855be5f4a2462e64992c7414a6d77e283c872e0a (diff)
downloadqttools-d07517f0237f9eef0a426e6fabb668665a96461e.tar.gz
lupdate: Support numeric literal separators
Numeric literals that use apostrophes were introduced in C++14 so this adds support for cases like: int d = 10'000'00; int x = 0xAF'FE; This patch allows just any number and combination of apostrophes in numeric literals and doesn't attempt to detect ill-formed literals. We assume, lupdate runs on code that has been accepted by a C++ compiler. Task-number: QTBUG-53326 Change-Id: I23bd9b4c676694dc69199e4a17a612a011449e61 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit c2d1163004078b98abc86318f45a6796aef18811) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
index efaac791f..0372de39a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
@@ -139,3 +139,10 @@ const QString nodelimiter(QObject::tr(R"(
const QString withdelimiter = QObject::tr(R"delim(
This is a test string
)delim");
+
+
+// New in C++14: integer literals may contain single quotes as separator.
+struct IntLiteralsWithSeparators {
+ long d = 10'000'000'0'00;
+ int x = 0x1'AF'FE;
+};