[libcxx-commits] [libcxx] [libc++] P2602R2 Poison Pills are Too Toxic (PR #74534)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 7 00:38:35 PST 2024


================
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
----------------
huixie90 wrote:

i would suggest to add another test to test the use case in the paper


```
class Test {
    friend size_t size(const Test&) {
        return 0;
    }
};

size_t f(Test t) {
   return std::ranges::size(t);
}
```
without implementing the paper the above code does not work because the poison pill was too toxic. and with the implementation the above code should work.  I suggest to add
robust_against_poison_pill  which tests all the CPOs

https://github.com/llvm/llvm-project/pull/74534


More information about the libcxx-commits mailing list