Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
4.2.2
-
None
Description
In bool Moc::parseFunction(FunctionDef *def, bool inMacro) in QTDIRsrc\tools\moc, the segment:
def->isVirtual = false;
while (test(INLINE) || test(STATIC) || test(VIRTUAL))
will never work and virtual functions will not be marked as such (isVirtual == true). The reason is that the default parameter value for lookup() is 1, which mean that lookup() would return the current token. However, because test() advances the internal pointer to the next token, if the current token is the expected one, then by the time lookup() is called we are already after the 'virtual' token. The solution is to
call lookup(0) instead:
def->isVirtual = false;
while (test(INLINE) || test(STATIC) || test(VIRTUAL))
Also, this same code segment should be pasted in the very beginning of bool Moc::parseMaybeFunction(FunctionDef *def) as well.
Also, the functions parseSignals() and parseSlots() do NOT set the flags isSlot and isSignal to true, as they should.