Skip to content

[libc++] ABI break between Clang 15 and Clang 16 for some trivially copiable pairs in C++ >= 23 #95428

Closed
@ldionne

Description

@ldionne
#include <type_traits>
#include <utility>

struct trivially_copyable_no_assignment {
  int arr[4];
  trivially_copyable_no_assignment& operator=(const trivially_copyable_no_assignment&) = delete;
};

static_assert(std::is_trivially_copyable<std::pair<trivially_copyable_no_assignment, int> >::value, "");

int main() { }

is_trivially_copyable was true on Clang 15 and became false on Clang 16 and above. This only affects C++23 and C++26, which also means that we now have a different ABI between C++20 and C++23 in recent Clangs.

Godbolt: https://godbolt.org/z/hEWq59oeP

Metadata

Metadata

Assignees

Labels

ABIApplication Binary Interfacelibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions