Elektrine lite

← Feed

@q66@gts.q66.moe

Post #1465924

2026-04-20 14:06 UTC

psa for anyone using qt6 with llvm 22 and libc++ so if you try to build qt6 (any version) with clang22 and libcxx, you will notice the tests tst_collections and tst_qmap failing the code that is failing specifically is something like ``` QMultiMap<int, T> qm; qm.insert(1, val1); qm.insert(1, val2); assert(qm.value(1) == val2); // assume .value(key) always returns most recently inserted value, but it does not in practice ``` the reason for this is that QMultiMap uses plain old std::multimap for its backing; the .value() method implementation on it calls `.find(key)` on the backing and if it returns a valid iterator, returns its value however, the standard std::multimap documentation for the .find() method says: "If there are several elements with the requested key in the container, any of them may be returned." so qt is placing expectations on behavior of multimap outside of the bounds of the standard, which libcxx validly follows i think in practice this is unlikely to break anything much? i don't see much real world code relying on multimaps at all, let alone the specific lookup order but just in case anyone else scratched their head over this for a couple hours

Replies (0)

No replies.