Make sure functions returning iterators have an iterator as parameter
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 28 Sep 2012 12:02:29 +0000 (14:02 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 19 Oct 2012 03:35:39 +0000 (05:35 +0200)
commitb8fe5e1bbc7f341d03d2704a6110d6e3240589bb
tree733f2a430ba2b10e46077026a8e7dbb115eb7816
parentf7f9a28a26a071f2f4a3823de1cdf162ac306314
Make sure functions returning iterators have an iterator as parameter

The IA-64 C++ ABI does not encode the return type for non-template
functions (QVector is the template, not the function), which means that
these two functions have the same signature:

  Node *QVector<Node>::begin()
  typename class QTypedArrayData<Node>::iterator QVector<Node>::begin()
  [both are _ZN7QVectorI4NodeE5beginEv]

When linking compilation units compiled with different
QT_STRICT_ITERATORS settings, only one of the two out-of-line copies
will survive. Depending on the ABI, we may have a problem: the ABI can
say that a function returning a structure takes an implicit first
parameter, which a function returning a regular pointer doesn't.

Task-number: QTBUG-27277
Change-Id: I57a59e5a7c46f55faabfe85c073dca89d2a7bbf3
Reviewed-by: Jan Kundrát <jkt@flaska.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qarraydata.h
src/corelib/tools/qvector.h