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

            Bug ID: 123563
           Summary: ICE in error_operand_p, at tree.h:4785
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jirehguo at tju dot edu.cn
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/rKa7xzEoe
The following c++ code crash gcc trunk.
And goes back to 12.1 with checking.

Code:
```cpp
template<typename T>
using Introspected = decltype(__direct_bases(T));
```

Stack dump:
```
<source>:2:47: internal compiler error: tree check: expected tree that contains
'typed' structure, have 'bases' in error_operand_p, at tree.h:4785
    2 | using Introspected = decltype(__direct_bases(T));
      |                                               ^
0x2926688 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x291b44b internal_error(char const*, ...)
        ???:0
0xa1b84e tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ???:0
0xd57563 c_parse_file()
        ???:0
0xec8ee9 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

Reply via email to