moc: Fix parsing of operator<

moc would skip the 'operator' keyword as unknown and try to parse a type again
but as it sees the '<' it looks for the corresponding '>' which does not exist
types can't start with '<' anyway, so return an invalid type and continue
parsing as usual

Task-number: QTBUG-36834

Change-Id: If3d27076ef9947abf8c57c594713eece9334d0b0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This commit is contained in:
Olivier Goffart 2014-02-13 11:13:30 +01:00 committed by The Qt Project
parent 4179302d65
commit 2b0f02aa5c
2 changed files with 5 additions and 0 deletions

View File

@ -224,6 +224,10 @@ Type Moc::parseType()
;
}
if (test(LANGLE)) {
if (type.name.isEmpty()) {
// '<' cannot start a type
return type;
}
type.name += lexemUntil(RANGLE);
}
if (test(SCOPE)) {

View File

@ -128,6 +128,7 @@ public:
emit send(value);
}
bool operator< ( const Sender & ) const { /* QTBUG-36834 */ return true;}
signals:
void send(const String::Type&);
void send(const Int::Type&);