diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 01:52:57 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 01:52:57 (GMT) |
commit | aa9cf406d62004519ad54596e1c391f9a6439210 (patch) | |
tree | dd562b9c296981f2761b76623911be8496c7af84 /src/tools/moc | |
parent | 987aec28b950e1c9817a20a9dd71afc071cd93ea (diff) | |
parent | 56b6a5924008ab5cdbae36e9662eddba923acd5e (diff) | |
download | Qt-aa9cf406d62004519ad54596e1c391f9a6439210.zip Qt-aa9cf406d62004519ad54596e1c391f9a6439210.tar.gz Qt-aa9cf406d62004519ad54596e1c391f9a6439210.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/moc.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index da5733a..0ba7d53 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -337,11 +337,10 @@ bool Moc::testFunctionAttribute(Token tok, FunctionDef *def) bool Moc::parseFunction(FunctionDef *def, bool inMacro) { def->isVirtual = false; - while (test(INLINE) || test(STATIC) || test(VIRTUAL) - || testFunctionAttribute(def)) { - if (lookup() == VIRTUAL) - def->isVirtual = true; - } + //skip modifiers and attributes + while (test(INLINE) || test(STATIC) || + (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual + || testFunctionAttribute(def)) {} bool templateFunction = (lookup() == TEMPLATE); def->type = parseType(); if (def->type.name.isEmpty()) { @@ -429,11 +428,10 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro) bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def) { def->isVirtual = false; - while (test(EXPLICIT) || test(INLINE) || test(STATIC) || test(VIRTUAL) - || testFunctionAttribute(def)) { - if (lookup() == VIRTUAL) - def->isVirtual = true; - } + //skip modifiers and attributes + while (test(EXPLICIT) || test(INLINE) || test(STATIC) || + (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual + || testFunctionAttribute(def)) {} bool tilde = test(TILDE); def->type = parseType(); if (def->type.name.isEmpty()) @@ -862,7 +860,7 @@ void Moc::parseSignals(ClassDef *def) funcDef.access = FunctionDef::Protected; parseFunction(&funcDef); if (funcDef.isVirtual) - error("Signals cannot be declared virtual"); + warning("Signals cannot be declared virtual"); if (funcDef.inlineCode) error("Not a signal declaration"); def->signalList += funcDef; |