summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@theqtcompany.com>2016-02-08 16:39:18 +0100
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2016-02-08 20:09:14 +0000
commitff6f4f09361e50211b431979f4a9271812c57f0b (patch)
treed395cce9047295ac20d862d0ecb82a5ea26acfb4 /src/qdoc/cppcodeparser.cpp
parentb29665d0c3531a6b7acdc02fae2278eb139560ef (diff)
downloadqttools-ff6f4f09361e50211b431979f4a9271812c57f0b.tar.gz
qdoc: Implement C++11 'final' specifier support.
Change-Id: I9248c0481c44f9ebbbe9df86cad182689288f810 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index da389d71c..8bd8f1461 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -1570,6 +1570,7 @@ bool CppCodeParser::matchFunctionDecl(Aggregate *parent,
// look for const
bool matchedConst = match(Tok_const);
+ bool matchFinal = match(Tok_final);
bool isDeleted = false;
bool isDefaulted = false;
@@ -1652,6 +1653,7 @@ bool CppCodeParser::matchFunctionDecl(Aggregate *parent,
func->setVirtualness(virtuality);
func->setIsDeleted(isDeleted);
func->setIsDefaulted(isDefaulted);
+ func->setFinal(matchFinal);
if (isQPrivateSignal)
func->setPrivateSignal();
if (!pvect.isEmpty()) {
@@ -1740,6 +1742,9 @@ bool CppCodeParser::matchClassDecl(Aggregate *parent,
}
}
}
+
+ const QString className = previousLexeme();
+ match(Tok_final); // ignore C++11 final class-virt-specifier
if (tok != Tok_Colon && tok != Tok_LeftBrace)
return false;
@@ -1747,7 +1752,7 @@ bool CppCodeParser::matchClassDecl(Aggregate *parent,
So far, so good. We have 'class Foo {' or 'class Foo :'.
This is enough to recognize a class definition.
*/
- ClassNode *classe = new ClassNode(parent, previousLexeme());
+ ClassNode *classe = new ClassNode(parent, className);
classe->setAccess(access);
classe->setLocation(location());
if (compat)