summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-07-30 12:05:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-01 13:36:59 +0200
commit1c7d9a533509d510047c1ff4045e88262139c6aa (patch)
treed5a100890bd4390054999ffb810776bed7774bc3 /tests/auto
parent829f6489daf357bb5d63a89d1f808d3d72e43263 (diff)
downloadqttools-1c7d9a533509d510047c1ff4045e88262139c6aa.tar.gz
ignore bracketed expressions only outside function scope
static initializers obviously cannot appear in scopes, so there is no reason to suppress parsing tr() statements used for indexing inside functions. Task-number: QTBUG-29998 Change-Id: I3a0330e1382cd5a74106328ae6722a02af282f7f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp9
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result5
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
index 0db9a8350..792d0dc3a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
@@ -343,3 +343,12 @@ void YetMoreFun::funStuff()
}
}
+
+
+
+// QTBUG-29998: tr() macro inside square brackets
+void blubb()
+{
+ QMap<QString, QString> d;
+ d[LotsaFun::tr("bracketed")] = "plain";
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index c8cca3f04..c7367cab5 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -147,6 +147,11 @@ backslashed \ stuff.</source>
<source>this is inside operator&lt;&lt;</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="main.cpp" line="353"/>
+ <source>bracketed</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>NameSchpace::YetMoreFun</name>