summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-06-30 13:52:20 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-06-30 15:27:27 (GMT)
commit01648005f1f546dc0281155fecd94b4f47a94584 (patch)
tree4ab00c221ba86cb4f977b8cda73d469389868d9f /src
parent7d80cd1f66fa6331c926674870d2a0dbe2921e77 (diff)
downloadQt-01648005f1f546dc0281155fecd94b4f47a94584.zip
Qt-01648005f1f546dc0281155fecd94b4f47a94584.tar.gz
Qt-01648005f1f546dc0281155fecd94b4f47a94584.tar.bz2
Moc: fix compilation when templated types with multiple arguments are used.
Each template argument need to be normalized separately. Else, the const type of one argument may end up moved in the first argument. (And then the compilation of the generated moc file would fail as the types would not match) Reviewed-by: Kent Hansen Task-number: QTBUG-11647
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetaobject_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index b538787..4a03874 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -276,12 +276,15 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
++templdepth;
if (c == '>')
--templdepth;
- if (templdepth == 0) {
+ if (templdepth == 0 || (templdepth == 1 && c == ',')) {
result += normalizeTypeInternal(tt, t-1, fixScope, false);
result += c;
- if (*t == '>')
- result += ' '; // avoid >>
- break;
+ if (templdepth == 0) {
+ if (*t == '>')
+ result += ' '; // avoid >>
+ break;
+ }
+ tt = t;
}
}
}