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

            Bug ID: 127337
           Summary: ICE looking up qualified name with std::async
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tymi at tymi dot org
  Target Milestone: ---

https://godbolt.org/z/c19KGd85n
```
import std;
int main()
{
     std::async(std::launch::async, []{ return 1.0f; });
}```
```
In file included from
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/exception:182,
                 from
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/optional:48,
                 from
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/bits/ranges_algo.h:37,
                 from
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/algorithm:65,
                 from
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/x86_64-linux-gnu/bits/stdc++.h:51,
of module
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/x86_64-linux-gnu/bits/stdc++.h,
imported at
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/bits/std.cc:26,
of module std, imported at <source>:1:
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/bits/exception_ptr.h:
In function 'constexpr std::__exception_ptr::exception_ptr
std::make_exception_ptr(_Ex) [with _Ex = future_error]':
/cefs/9b/9beb570b65b9542f9deb35d9_gcc-trunk-20260910/include/c++/17.0.0/bits/exception_ptr.h:350:46:
internal compiler error: Segmentation fault
  350 |           return __builtin_current_exception();
      |                                              ^
0x2d1de48 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2d12a8b internal_error(char const*, ...)
        ???:0
0xd36e08 module_state::load_section(unsigned int, binding_slot*)
        ???:0
0xd3710a lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*)
        ???:0
0xd4deb0 name_lookup::search_namespace_only(tree_node*)
        ???:0
0xd4e152 name_lookup::search_namespace(tree_node*)
        ???:0
0xd4e250 name_lookup::search_qualified(tree_node*, bool)
        ???:0
0xd54cc2 lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool)
        ???:0
0xc2dde3 cp_gimplify_expr(tree_node**, gimple**, gimple**)
        ???:
[...]`

Doesn't happen on GCC 16.x

Reply via email to