Skip to content

[libc++] ABI compat breakage using reference type for std::set key_compare #118559

Closed
@hubert-reinterpretcast

Description

@hubert-reinterpretcast

The following compiled fine with libc++ version 19:

#include <set>

struct Cmp {
  __int128 x;
  bool operator()(__int128, __int128) const;
};

struct MySet {
  unsigned char b;
  std::set<__int128, const Cmp &> s;
};

extern char q[sizeof(MySet)];
extern char q[40];

It no longer compiles with libc++ trunk (https://godbolt.org/z/cTbEovcer). It seems the size of MySet has changed because of a change in std::set.
The draft release notes (https://libcxx.llvm.org/ReleaseNotes.html#abi-affecting-changes) mention issues with overaligned empty types, but nothing about reference types.

Metadata

Metadata

Assignees

No one assigned

    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