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

            Bug ID: 117152
           Summary: Segmentation fault in permerror(unsigned int, char
                    const*, ...)
           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/jYKsrhPY1

The following program:
```cpp
template<typename T> struct S {};
struct X {
    friend constexpr S<int>::S(S<int>&& = {0}) noexcept;
};
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
Segmentation fault
0x286a525 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x287e305 internal_error(char const*, ...)
        ???:0
0x28a10f3 pretty_printer::format(text_info&)
        ???:0
0x286a242 diagnostic_context::report_diagnostic(diagnostic_info*)
        ???:0
0x286a525 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x287d4bf permerror(unsigned int, char const*, ...)
        ???:0
0xb6d4d1 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ???:0
0xb8e620 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
        ???:0
0xc98ffa c_parse_file()
        ???:0
0xdf0c19 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