https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109018
--- Comment #8 from qingzhe huang <nickhuang99 at hotmail dot com> --- I gdb a little bit and I feel this issue is fixable. See the comparison of "unq" and "function" below is not compatible because "function" is "IDENTIFIER_NODE" and "unq" is "VIEW_CONVERT_EXPR". If we check and convert "unq", we will find they are matching. (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 0x0000000000d0bafc in tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) at /home/nick/Downloads/gcc-dev/gcc/gcc/cp/pt.cc:20608 breakpoint already hit 1 time (gdb) l 20608 20603 (function, args, complain, in_decl, true, 20604 integral_constant_expression_p)); 20605 if (unq == error_mark_node) 20606 RETURN (error_mark_node); 20607 20608 if (unq != function) 20609 { 20610 char const *const msg 20611 = G_("%qD was not declared in this scope, " 20612 "and no declarations were found by " (gdb) p IDENTIFIER_POINTER(function) $16 = 0x7ffff70c42c0 "g" (gdb) p IDENTIFIER_POINTER(DECL_NAME(TREE_OPERAND(unq,0))) $17 = 0x7ffff70c42c0 "g" (gdb) p TREE_CODE(function) $18 = IDENTIFIER_NODE (gdb) p TREE_CODE(unq) $19 = VIEW_CONVERT_EXPR (gdb)