You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
638 B

2014-07-23 Jonathan Wakely <jwakely@redhat.com>
* testsuite/30_threads/condition_variable_any/rh1118870.cc: New test.
--- libstdc++-v3/testsuite/30_threads/condition_variable_any/rh1118870.cc
+++ libstdc++-v3/testsuite/30_threads/condition_variable_any/rh1118870.cc
@@ -0,0 +1,13 @@
+// { dg-options " -std=gnu++11 -pthread" }
+#include <condition_variable>
+#include <cstring>
+
+int main()
+{
+ const size_t sz = sizeof(std::condition_variable_any);
+ char garbage[sz];
+ memset(garbage, 0xff, sz);
+ auto cond = new ((void*)garbage) std::condition_variable_any();
+ cond->notify_all();
+ cond->~condition_variable_any();
+}