diff options
author | Michael Hanselmann <public@hansmi.ch> | 2015-12-17 13:26:46 +0100 |
---|---|---|
committer | Michael Hanselmann <public@hansmi.ch> | 2016-01-05 16:20:20 +0000 |
commit | 00c523ab372c680984b17ad8d66939cd3aaa8f34 (patch) | |
tree | b20a405bdbc50dc911daaff9bc3d977acba9c324 /src | |
parent | bdd4e502ffd81084f33181426df31ffcddde637c (diff) |
lupdate: Support for C++11's "final" identifier
C++11 introduced the "final" identifier which may appear immediately
after the name in a class definition to specify that the class cannot be
derived from.
lupdate collects strings for translation and did not understand "final".
Instead it would use "final" as the name of the class as there may be
attributes before the class name and the last token before the colon
character is used.
[ChangeLog][lupdate] The C++11 identifier "final" is now skipped when
determining the name of a class.
Task-number: QTBUG-42735
Change-Id: I2adee9a188645622fc6916158ba2b48dde921383
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/linguist/lupdate/cpp.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/linguist/lupdate/cpp.cpp b/src/linguist/lupdate/cpp.cpp index 9acae45aa..963e5c53f 100644 --- a/src/linguist/lupdate/cpp.cpp +++ b/src/linguist/lupdate/cpp.cpp @@ -456,6 +456,7 @@ int CppParser::getChar() STRING(Q_OBJECT); STRING(class); +STRING(final); STRING(friend); STRING(namespace); STRING(operator); @@ -1817,6 +1818,12 @@ void CppParser::parseInternal(ConversionData &cd, const QStringList &includeStac quali << fct; yyTok = getToken(); } else if (yyTok == Tok_Ident) { + if (yyWord == strfinal) { + // C++11: final may appear immediately after the name of the class + yyTok = getToken(); + break; + } + // Handle impure definitions such as 'class Q_EXPORT QMessageBox', in // which case 'QMessageBox' is the class name, not 'Q_EXPORT', by // abandoning any qualification collected so far. |