[libcxx-commits] [libcxx] r359458 - Add tests specifically for LWG2164. We already did this; but now we have tests. NFC
Marshall Clow via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 29 08:38:07 PDT 2019
Author: marshall
Date: Mon Apr 29 08:38:07 2019
New Revision: 359458
URL: http://llvm.org/viewvc/llvm-project?rev=359458&view=rev
Log:
Add tests specifically for LWG2164. We already did this; but now we have tests. NFC
Modified:
libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
libcxx/trunk/www/cxx2a_status.html
Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp?rev=359458&r1=359457&r2=359458&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp Mon Apr 29 08:38:07 2019
@@ -145,5 +145,16 @@ int main(int, char**)
assert(is_contiguous_container_asan_correct(c));
}
+ { // LWG 2164
+ int arr[] = {0, 1, 2, 3, 4};
+ int sz = 5;
+ std::vector<int> c(arr, arr+sz);
+ while (c.size() < c.capacity())
+ c.push_back(sz++);
+ c.emplace_back(c.front());
+ assert(c.back() == 0);
+ for (int i = 0; i < sz; ++i)
+ assert(c[i] == i);
+ }
return 0;
}
Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp?rev=359458&r1=359457&r2=359458&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp Mon Apr 29 08:38:07 2019
@@ -38,5 +38,17 @@ int main(int, char**)
}
#endif
+ { // LWG 526
+ int arr[] = {0, 1, 2, 3, 4};
+ int sz = 5;
+ std::vector<int> c(arr, arr+sz);
+ while (c.size() < c.capacity())
+ c.push_back(sz++);
+ c.push_back(c.front());
+ assert(c.back() == 0);
+ for (int i = 0; i < sz; ++i)
+ assert(c[i] == i);
+ }
+
return 0;
}
Modified: libcxx/trunk/www/cxx2a_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx2a_status.html?rev=359458&r1=359457&r2=359458&view=diff
==============================================================================
--- libcxx/trunk/www/cxx2a_status.html (original)
+++ libcxx/trunk/www/cxx2a_status.html Mon Apr 29 08:38:07 2019
@@ -216,7 +216,7 @@
<tr><td><a href="https://wg21.link/LWG3024">3024</a></td><td>variant's copies must be deleted instead of disabled via SFINAE</td><td>Albuquerque</td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="https://wg21.link/LWG2164">2164</a></td><td>What are the semantics of <tt>vector.emplace(vector.begin(), vector.back())</tt>?</td><td>Jacksonville</td><td></td></tr>
+ <tr><td><a href="https://wg21.link/LWG2164">2164</a></td><td>What are the semantics of <tt>vector.emplace(vector.begin(), vector.back())</tt>?</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2243">2243</a></td><td><tt>istream::putback</tt> problem</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG2816">2816</a></td><td><tt>resize_file</tt> has impossible postcondition</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr>
<tr><td><a href="https://wg21.link/LWG2843">2843</a></td><td>Unclear behavior of <tt>std::pmr::memory_resource::do_allocate()</tt></td><td>Jacksonville</td><td>Complete</td></tr>
More information about the libcxx-commits
mailing list