summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-03-21 14:06:43 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-21 18:55:27 +0100
commitb8d71ed60ba57142237555edb97d4cc7d3675b5c (patch)
tree3058486e0adc3fafed4b89727ff949823cf9aeaa /src
parente2502e1a06fbb15a8d0abe8ac1be5e6dec1e1152 (diff)
Fix QMetaObject::normalizedType() for "void" argument
Since the introduction of QMetaType::UnknownType, void is a proper meta-type, and the normalized form of "void" should be "void", not an empty string. Add more tests to ensure that we do remove "void" in the one case where it actually should be removed (e.g. "foo(void)"). Change-Id: I72dc2d24da67cf52da00c678f50213cff1b92e25 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 185314520b..6b3d13569b 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1326,7 +1326,9 @@ static char *qNormalizeType(char *d, int &templdepth, QByteArray &result)
--templdepth;
++d;
}
- if (strncmp("void", t, d - t) != 0)
+ // "void" should only be removed if this is part of a signature that has
+ // an explicit void argument; e.g., "void foo(void)" --> "void foo()"
+ if (strncmp("void)", t, d - t + 1) != 0)
result += normalizeTypeInternal(t, d);
return d;