summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-21 17:32:28 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-22 08:18:48 (GMT)
commite43eae35b242bf90c801e719d61fff4a20549ead (patch)
tree2441fac7af61071e9d1ceb76db1369b42570822a /src/tools/moc
parent96ee22d27e3f7c54ae622a956435bfc84cdb0e90 (diff)
downloadQt-e43eae35b242bf90c801e719d61fff4a20549ead.zip
Qt-e43eae35b242bf90c801e719d61fff4a20549ead.tar.gz
Qt-e43eae35b242bf90c801e719d61fff4a20549ead.tar.bz2
Fix Warning saying that signal cannot be made virtual
The test for virtual signal did not work. But we cannot make an error right now or it might break existing code (exemple in task 210879) Reviewed-by: Kent Hansen
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/moc.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index da5733a..797595f 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(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;