diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-11-22 14:52:18 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-12-09 03:11:34 +0000 |
commit | b0c321a8db7b75d740d968c6a583473600faf990 (patch) | |
tree | 1851f55318a407d13dac000aec9fd5cba36356ea /doc | |
parent | 2c9dc93696f32b798b872f931c102329d0ba7155 (diff) |
Don't crash on QVLA construction from an empty std::initializer_list
The C++ standard says in [support.initlist.access]/1:
constexpr const E* begin() const noexcept;
Returns: A pointer to the beginning of the array. If size() == 0 the
values of begin() and end() are unspecified but they shall be
identical.
So we can't assume it's non-null. I didn't want to remove the Q_ASSERT,
so passing a non-null pointer to append() remains required. This patch
simply won't call append() if the initializer list is empty.
This was already tested, but the failure is with a compiler that is not
part of the Qt CI.
Task-number: QTBUG-57277
Change-Id: Iaeecaffe26af4535b416fffd1489806872b412ee
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions