diff options
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/moc.cpp | 4 | ||||
-rw-r--r-- | src/tools/moc/moc.h | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 680b8a5..10a80f3 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -230,11 +230,13 @@ Type Moc::parseType() } } while (test(CONST) || test(VOLATILE) || test(SIGNED) || test(UNSIGNED) - || test(STAR) || test(AND)) { + || test(STAR) || test(AND) || test(ANDAND)) { type.name += ' '; type.name += lexem(); if (lookup(0) == AND) type.referenceType = Type::Reference; + else if (lookup(0) == ANDAND) + type.referenceType = Type::RValueReference; else if (lookup(0) == STAR) type.referenceType = Type::Pointer; } diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index d365ed5..9f349b5 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -55,7 +55,7 @@ struct QMetaObject; struct Type { - enum ReferenceType { NoReference, Reference, Pointer }; + enum ReferenceType { NoReference, Reference, RValueReference, Pointer }; inline Type() : isVolatile(false), isScoped(false), firstToken(NOTOKEN), referenceType(NoReference) {} inline explicit Type(const QByteArray &_name) : name(_name), isVolatile(false), isScoped(false), firstToken(NOTOKEN), referenceType(NoReference) {} @@ -242,8 +242,11 @@ public: inline QByteArray noRef(const QByteArray &type) { - if (type.endsWith('&')) + if (type.endsWith('&')) { + if (type.endsWith("&&")) + return type.left(type.length()-2); return type.left(type.length()-1); + } return type; } |