PR libstdc++/88840 delay evaluation of constant until type is complete
authorJonathan Wakely <jwakely@redhat.com>
Thu, 24 Jan 2019 15:39:25 +0000 (15:39 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 24 Jan 2019 15:39:25 +0000 (15:39 +0000)
commite658669fe18d27bbde85085d648f0392f3f9bce6
treeeddfdc9e4eb573f87f18f3b2ca3d2c5ed4443a5f
parent400a08e28429f2c56c2298908be673a5951d5e20
PR libstdc++/88840 delay evaluation of constant until type is complete

Clang fails to compile std::vector<Incomplete> because the static member
__use_relocate cannot be evaluated for an incomplete type. Replace with
a static member function that will not be odr-used until needed, by
which point the type must be complete.

PR libstdc++/88840
* include/bits/stl_vector.h (vector::__use_relocate): Replace static
data member with static member function _S_use_relocate().
* include/bits/vector.tcc (vector::reserve, vector::_M_realloc_insert)
(vector::_M_default_append): Use _S_use_relocate() instead of
__use_relocate.

From-SVN: r268239
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/bits/vector.tcc