[libcxx-commits] [PATCH] D100277: [libc++] [test] Detect an improperly noexcept'ed __decay_copy.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 12 09:28:38 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd7eb797ea55c: [libc++] [test] Detect an improperly noexcept'ed __decay_copy. (authored by arthur.j.odwyer).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100277/new/

https://reviews.llvm.org/D100277

Files:
  libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp


Index: libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
===================================================================
--- libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
+++ libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
@@ -23,6 +23,7 @@
 #include <atomic>
 #include <cstdlib>
 #include <cassert>
+#include <vector>
 
 #include "test_macros.h"
 
@@ -51,10 +52,12 @@
 
 bool f_run = false;
 
-void f()
-{
-    f_run = true;
-}
+struct F {
+    std::vector<int> v_;  // so f's copy-ctor calls operator new
+    explicit F() : v_(10) {}
+    void operator()() const { f_run = true; }
+};
+F f;
 
 class G
 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100277.336863.patch
Type: text/x-patch
Size: 738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210412/1280c24a/attachment.bin>


More information about the libcxx-commits mailing list