[libcxx-commits] [libcxx] [libc++] Avoid passing both sentinel and size around in vector (PR #214132)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 13 12:57:34 PDT 2026


ldionne wrote:

@philnik777 You won't believe it, but the problem here was an ODR violation. What happened is that Google Benchmark itself uses `vector<string>::operator=` so it contains a copy of the function, but it compiles as `-std=c++17`. That version of the function is slower.

The benchmark itself also contains `vector<string>::operator=` (which it tries to benchmark), but compiled for `-std=c++26`, faster. Apparently, the Xcode used in the CI contains a version of the linker that picks the one from google benchmark instead of the one from the benchmark.

I tried locally with the exact AppleClang used in the CI and was able to reproduce the issue, and after landing #218527 this doesn't reproduce anymore, or shouldn't.

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


More information about the libcxx-commits mailing list