aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-06-19 14:52:20 -0400
committerGitHub <noreply@github.com>2024-06-19 14:52:20 -0400
commit02af67c88f393cd6998949cc1bf8075553579a42 (patch)
treeba35add49bee35301adfde83d445cf9b1a8e0ee3 /llvm/lib/IR/Module.cpp
parenteb8d036565496d4466ad9974fdf8ff91812feefb (diff)
downloadllvm-02af67c88f393cd6998949cc1bf8075553579a42.zip
llvm-02af67c88f393cd6998949cc1bf8075553579a42.tar.gz
llvm-02af67c88f393cd6998949cc1bf8075553579a42.tar.bz2
[libc++] Fix triviality of std::pair for trivially copyable types without an assignment operator (#95444)
Since 83ead2b, std::pair would not be trivially copyable when it holds a trivially copyable type without an assignment operator. That is because pair gained an elligible copy-assignment-operator (the const version) in 83ead2b in C++ >= 23. This means that the trivially copyable property of std::pair for such types would be inconsistent between C++11/14/17/20 (trivially copyable) and C++23/26 (not trivially copyable). This patch makes std::pair's behavior consistent in all Standard modes EXCEPT C++03, which is a pre-existing condition and we have no way of changing (also, it shouldn't matter because the std::is_trivially_copyable trait was introduced in C++11). While this is not technically an ABI break, in practice we do know that folks sometimes use a different representation based on whether a type is trivially copyable. So we're treating 83ead2b as an ABI break and this patch is fixing said breakage. This patch also adds tests stolen from #89652 that pin down the ABI of std::pair with respect to being trivially copyable. Fixes #95428
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions