diff options
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt | 1 | ||||
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt index 959938c..d4ebe49 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt @@ -4,3 +4,4 @@ .*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .* .*/lupdate/testdata/good/parsecpp2/main.cpp:120: //% cannot be used with tr\(\) / QT_TR_NOOP\(\)\. Ignoring .*/lupdate/testdata/good/parsecpp2/main.cpp:123: //% cannot be used with translate\(\) / QT_TRANSLATE_NOOP\(\)\. Ignoring +.*/lupdate/testdata/good/parsecpp2/main.cpp:126: Discarding unconsumed meta data diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index 25e162f..609bd3d 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -2081,10 +2081,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) case Tok_Semicolon: prospectiveContext.clear(); prefix.clear(); - sourcetext.clear(); - extracomment.clear(); - msgid.clear(); - extra.clear(); + if (!sourcetext.isEmpty() || !extracomment.isEmpty() || !msgid.isEmpty() || !extra.isEmpty()) { + yyMsg() << "Discarding unconsumed meta data\n"; + sourcetext.clear(); + extracomment.clear(); + msgid.clear(); + extra.clear(); + } yyTokColonSeen = false; yyTok = getToken(); break; |