 <p>The code you mention works fine with Qt 4.6.1 and GCC 4.4.1 on Intel/Mac OS X.</p> <pre><code>$ cat a.cpp #include &lt;QtCore&gt; void foo (QMap&lt;int, QMap&lt;QString, QVector&lt;QPointF&gt; &gt; &gt; &amp;map) { map.clear(); } $ g++-4.4-fsf -c -DQT_CORE_LIB -DQT_SHARED -I/Library/Frameworks/QtCore.framework/Versions/4/Headers a.cpp -W -Wall -Werror -g -O3 -fPIC $ </code></pre> <p>So your issue is probably fixed by upgrading to Qt 4.6.1. (Unless it's a compiler target-specific bug, which seems unlikely; plus, you haven't told us what platform you're compiling on.)</p>