https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94462
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:467fc7c83abfe8fca8b75defac7c89f6c75bf9d7 commit r10-7580-g467fc7c83abfe8fca8b75defac7c89f6c75bf9d7 Author: Jason Merrill <ja...@redhat.com> Date: Mon Apr 6 18:19:07 2020 -0400 c++: Fix ICE with implicit operator== [PR94462] duplicate_decls assumed that any TREE_ARTIFICIAL function at namespace scope was a built-in function, but now in C++20 it's possible to have an implicitly declared hidden friend operator==. We just need to move the assert into the if condition. gcc/cp/ChangeLog 2020-04-06 Jason Merrill <ja...@redhat.com> PR c++/94462 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.