[libcxx-commits] [libcxx] [libc++] Explicity use std::swap (PR #189112)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 30 00:48:49 PDT 2026


frederick-vs-ja wrote:

> Here is the link to the other swap it confuses: https://android.googlesource.com/platform/frameworks/native/+/refs/heads/android16-qpr2-release/services/inputflinger/reader/mapper/TouchInputMapper.cpp#86

It seems to me that the correct fix is removing the internal `swap` and using `std::swap` instead. The crux is that such the internal `swap` can be found by ADL for `android::T*`, which makes these pointer types no longer meet the _Cpp17Swappable_ requirements ([[swappable.requirements]](https://eel.is/c++draft/swappable.requirements)).

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


More information about the libcxx-commits mailing list