On Tue, May 9, 2017 at 9:46 AM, Jason Merrill <ja...@redhat.com> wrote: > The issue here was that we've been trying to treat C++ > list-initialized temporaries (which are rvalues) the same as C99 > compound literals (which are lvalues). This patch distinguishes > between them so we can treat them each correctly.
This introduced a failure in the libstdc++ testsuite, which was incorrectly relying on the temporary array backing a std::initializer_list being static even if the std::initializer_list is not; in fact they should have the same storage duration. Fixing thus.
commit 0e75edc1775f5afbb3113d840ebb500d091a7003 Author: Jason Merrill <ja...@redhat.com> Date: Tue May 9 11:06:09 2017 -0400 * testsuite/24_iterators/container_access.cc (test03): Make il3 static. diff --git a/libstdc++-v3/testsuite/24_iterators/container_access.cc b/libstdc++-v3/testsuite/24_iterators/container_access.cc index 42ecb41..7f60d2b 100644 --- a/libstdc++-v3/testsuite/24_iterators/container_access.cc +++ b/libstdc++-v3/testsuite/24_iterators/container_access.cc @@ -55,7 +55,7 @@ test03() std::initializer_list<int> il2{}; VERIFY(std::size(il2) == 0); VERIFY(std::empty(il2)); - constexpr std::initializer_list<int> il3{1,2,3}; + static constexpr std::initializer_list<int> il3{1,2,3}; constexpr auto d = std::data(il3); static_assert(d == il3.begin()); constexpr auto s = std::size(il3);