simply ignoring equal signs turns out to be not so smart: there are
static initializers without braces, which consequently do not look like
function definitions with a weird additional char.
Task-number: QTBUG-9276
Change-Id: I7d200aee7b81f17b42866eca4830be388c8edb64
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
yyTok = getToken();
break;
case Tok_Colon:
+ yyTokColonSeen = true;
+ // fallthrough
+ case Tok_Equals:
if (!prospectiveContext.isEmpty()
&& yyBraceDepth == namespaceDepths.count() && yyParenDepth == 0)
pendingContext = prospectiveContext;
- yyTokColonSeen = true;
yyTok = getToken();
break;
case Tok_LeftBrace:
if (!yyParenDepth)
prospectiveContext.clear();
// fallthrough
- case Tok_Equals: // for static initializers; other cases make no difference
- case Tok_RightBracket: // ignoring indexing; same reason
+ case Tok_RightBracket: // ignoring indexing; for static initializers
case_default:
yyTok = getToken();
break;
QMap<QString, QString> d;
d[LotsaFun::tr("bracketed")] = "plain";
}
+
+
+
+// QTBUG-9276 part 2: QT_TR_NOOP in static member initializers
+class TestClass
+{
+ Q_DECLARE_TR_FUNCTIONS(TestClass);
+
+public:
+ static const char TEST_STRING[];
+};
+
+const char TestClass::TEST_STRING[] = QT_TR_NOOP("Test value");
<comment>TestClass</comment>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="main.cpp" line="367"/>
+ <source>Test value</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Testing</name>