https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98687

            Bug ID: 98687
           Summary: [11 Regression] ICE tree check: expected tree that
                    contains ‘decl minimal’ structure, have ‘overload’ in
                    diagnose_name_conflict, at cp/name-lookup.c:2729 since
                    r11-6652-g796ead19f85372e5
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: mpolacek at gcc dot gnu.org
  Target Milestone: ---

Reduced from bitcoin package:

$ cat mesh.ii
extern "C" namespace std { void log1p(); }
namespace std_fallback {
template <typename> void log1p();
}
template <typename> struct log1p_impl {
  static int run() {
    using std::log1p;
    using std_fallback::log1p;
    return 0;
  }
};
void log1p() { log1p_impl<int>::run; }

$ g++ mesh.ii -c
mesh.ii:1:33: warning: declaration of ‘void std::log1p()’ conflicts with
built-in declaration ‘double std::log1p(double)’
[-Wbuiltin-declaration-mismatch]
    1 | extern "C" namespace std { void log1p(); }
      |                                 ^~~~~
mesh.ii: In instantiation of ‘static int log1p_impl< <template-parameter-1-1>
>::run() [with <template-parameter-1-1> = int]’:
mesh.ii:12:33:   required from here
mesh.ii:8:25: internal compiler error: tree check: expected tree that contains
‘decl minimal’ structure, have ‘overload’ in diagnose_name_conflict, at
cp/name-lookup.c:2729
    8 |     using std_fallback::log1p;
      |                         ^~~~~
0x876572 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.c:9984
0x6b96d0 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3452
0x6b96d0 diagnose_name_conflict
        /home/marxin/Programming/gcc/gcc/cp/name-lookup.c:2729
0xa9856e supplement_binding_1
        /home/marxin/Programming/gcc/gcc/cp/name-lookup.c:2712
0xa9f566 supplement_binding
        /home/marxin/Programming/gcc/gcc/cp/name-lookup.c:2750
0xa9f566 push_local_binding
        /home/marxin/Programming/gcc/gcc/cp/name-lookup.c:4237
0xb3e19a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18138
0xb3e19a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18046
0xb3bf61 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18073
0xb3bf61 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18046
0xb3ba87 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18400
0xb3ba87 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18046
0xb27148 instantiate_body
        /home/marxin/Programming/gcc/gcc/cp/pt.c:25748
0xb2832d instantiate_decl(tree_node*, bool, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:26037
0xb56bdb instantiate_pending_templates(int)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:26116
0xa16c2b c_parse_final_cleanups()
        /home/marxin/Programming/gcc/gcc/cp/decl2.c:4965
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to