https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120159

            Bug ID: 120159
           Summary: is_layout_compatible_v not exported in std module
           Product: gcc
           Version: 15.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alberto.gcc.bugzilla at gmail dot com
  Target Milestone: ---

Hello

It appears that is_layout_compatible_v, is_corresponding_member_v, and
is_pointer_interconvertible_with_class_v aren't exported by the std module.

In std.cc.in I can only find:

#if __cpp_lib_is_layout_compatible
  using std::is_corresponding_member;
  using std::is_layout_compatible;
#endif
#if __cpp_lib_is_pointer_interconvertible
  using std::is_pointer_interconvertible_base_of;
  using std::is_pointer_interconvertible_base_of_v;
  using std::is_pointer_interconvertible_with_class;
#endif


As a consequence, the following program:

``` hello.cpp
import std;

struct A
{
  double a;
};

struct B
{
  double a;
};

static_assert(std::is_layout_compatible_v<A, B>);

static_assert(std::is_layout_compatible<A, B>::value); // passes

```

compiled with:

g++ -std=c++23 -fmodules -fsearch-include-path bits/std.cc hello.cpp -o
hello.out


fails:

hello.cpp:13:20: error: 'is_layout_compatible_v' is not a member of 'std'
   13 | static_assert(std::is_layout_compatible_v<A, B>);
      |                    ^~~~~~~~~~~~~~~~~~~~~~

Thank you

Reply via email to