https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120536
Bug ID: 120536
Summary: internal compiler error: in build_over_call, at
cp/call.cc:10918 since gcc 5.5
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mario.rodriguezb1 at um dot es
Target Milestone: ---
ICE on ambiguous, it only happens with Derived3, not any other of Derived
classes:
## Program
```
#include <iostream>
#include <memory>
class Base {
public:
virtual ~Base() = default;
};
class Derived : public virtual Base {};
class Derived2 : public Base {};
class Derived3 : public Derived, Derived2 {};
int main()
{
auto p = std::make_unique<Derived3>();
p->~Base();
return 0;
}
```
## Stack dump
```
<source>:13:13: internal compiler error: in build_over_call, at
cp/call.cc:10918
0x282a0a5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x284b7e6 internal_error(char const*, ...)
???:0
0xadd7bc fancy_abort(char const*, int, char const*)
???:0
0xafe7c3 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
???:0
0xd854d9 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
???:0
0xd02d73 c_parse_file()
???:0
0xe6aad9 c_common_parse_file()
???:0
```
To quickly reproduce:
https://godbolt.org/z/ssW6jbzdd