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

            Bug ID: 117345
           Summary: internal compiler error: Segmentation fault at
                    maybe_begin_member_template_processing(tree_node*)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/G8Tad87or

The following program:
```cpp
struct X {
  template<typename T> static decltype(auto) g0(T x) { return x; }
};
template<typename U> class A {
  friend decltype(auto) X::g0<>(A<U> = 0);
};
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x287e395 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x28947f5 internal_error(char const*, ...)
        ???:0
0xcb47c1 maybe_begin_member_template_processing(tree_node*)
        ???:0
0xc9e55a c_parse_file()
        ???:0
0xdf7f79 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