[libcxx-commits] [libcxx] [libc++] Make sure that __desugars_to isn't tripped up by reference_wrapper and cv-refs (PR #132092)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 19 13:50:43 PDT 2025


================
@@ -52,6 +52,24 @@ struct __totally_ordered_less_tag {};
 template <class _CanonicalTag, class _Operation, class... _Args>
 inline const bool __desugars_to_v = false;
 
+// For the purpose of determining whether something desugars to something else,
----------------
mordante wrote:

Do we have tests where we test this desugaring  with cvref types in our algorithms?
```
// syntactically, the operation is equivalent to calling `a < b`, and these expressions
// have to be true for any `a` and `b`:
// - `(a < b) == (b > a)`
```
Here if `a` and `b` are a `volatile ref` to the same object `c` the statement above may not hold true and can change every time it's tested.

My concern is specifically about `volatile`.

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


More information about the libcxx-commits mailing list