https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86881
Bug ID: 86881 Summary: tree check fail with flag Wshadow-compatible-local Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- For this C++ code: void a() { auto b([] {}); if (0) auto b = 0; } compiled with recent gcc trunk and flag -Wshadow-compatible-local as so: $ ~/gcc/results.263341/bin/gcc -c -std=gnu++14 -Wshadow-compatible-local bug454.cc does this: bug454.cc:4:10: internal compiler error: tree check: expected record_type or uni on_type or qual_union_type, have template_type_parm in lookup_base, at cp/search .c:198 auto b = 0; ^ 0x7619b8 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../trunk/gcc/tree.c:9351 0x98faee tree_check3(tree_node*, char const*, int, char const*, tree_code, tree_ code, tree_code) ../../trunk/gcc/tree.h:3154 0x98faee lookup_base(tree_node*, tree_node*, int, base_kind*, int) ../../trunk/gcc/cp/search.c:198 0x81442a build_user_type_conversion_1 ../../trunk/gcc/cp/call.c:3782 0x815bc1 implicit_conversion ../../trunk/gcc/cp/call.c:1902 0x819d18 can_convert_arg(tree_node*, tree_node*, tree_node*, int, int) ../../trunk/gcc/cp/call.c:10673 0x8f4a4e check_local_shadow ../../trunk/gcc/cp/name-lookup.c:2737 The problem seems to have existed since before revision 262370.