[Bug libstdc++/120159] New: is_layout_compatible_v not exported in std module

2025-05-07 Thread alberto.gcc.bugzilla at gmail dot com via Gcc-bugs
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);

static_assert(std::is_layout_compatible::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);
  |^~

Thank you

[Bug c++/119864] [15/16 Regression][modules] ICE with -fmodules and omp reduction of UDT

2025-05-07 Thread alberto.gcc.bugzilla at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119864

Alberto  changed:

   What|Removed |Added

 CC||alberto.gcc.bugzilla@gmail.
   ||com

--- Comment #6 from Alberto  ---

Hello

This issue also affects the std module as it has "declare reduction" clauses to
support the unseq execution policy.

For example, the program:

``` hello.cpp

import std;

int main()
{
  std::vector v;
}

```

compiled with:

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

causes g++ to crash:

hello.cpp: In function 'void omp declare reduction __min_func(_ComplexType&)':
hello.cpp:5:8: internal compiler error: Segmentation fault
5 |   std::vector v;
  |^~
0x2287465 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x22989b6 internal_error(char const*, ...)
???:0
0xfd2b06 relayout_decl(tree_node*)
???:0
0xc740ee allocate_struct_function(tree_node*, bool)
???:0
0x9011e1 module_state::read_cluster(unsigned int)
???:0
0x901a7d module_state::load_section(unsigned int, binding_slot*)
???:0
0x901b28 module_state::lazy_load(unsigned int, binding_slot*)
???:0
0x900fc3 module_state::read_cluster(unsigned int)
???:0
0x901a7d module_state::load_section(unsigned int, binding_slot*)
???:0
0x901b28 module_state::lazy_load(unsigned int, binding_slot*)
???:0
0x900fc3 module_state::read_cluster(unsigned int)
???:0
0x901a7d module_state::load_section(unsigned int, binding_slot*)
???:0
0x901c30 lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*)
???:0
0x91479e name_lookup::search_namespace_only(tree_node*)
???:0
0x914998 name_lookup::search_namespace(tree_node*)
???:0
0x914ae7 name_lookup::search_qualified(tree_node*, bool)
???:0
0x9180a7 lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool)
???:0
0x981ebd c_parse_file()
???:0
0xa8b739 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug libstdc++/120159] is_layout_compatible_v not exported in std module

2025-05-07 Thread alberto.gcc.bugzilla at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120159

--- Comment #2 from Alberto  ---
Thank you very much for the quick fix!

Note to self: there are no is_corresponding_member_v and
is_pointer_interconvertible_with_class_v (those are functions, not traits
structs, and possibly the reason of the oversight).