[Bug c++/116049] friend function with explicit object parameter
fchelnokov at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 24 08:10:59 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116049
--- Comment #1 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
And this program
```
struct A {
friend bool operator == (this const A&, const A&) = default;
};
int main() {
A{} == A{};
}
```
results in
internal compiler error: Segmentation fault
6 | A{} == A{};
| ^
0x202ef4c internal_error(char const*, ...)
???:0
0x7a50e0 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
???:0
0x98a7a2 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
???:0
0x90e414 c_parse_file()
???:0
0xa0c4d9 c_common_parse_file()
???:0
Online demo: https://gcc.godbolt.org/z/zr6Y8vPss
More information about the Gcc-bugs
mailing list