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

            Bug ID: 117040
           Summary: g++ crashed for __alignof and got internal compiler
                    error: in poplevel, at cp/decl.cc:643
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

The following illformed code crashes current gcc trunk. This code was generated
by a fuzzer.

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

Code:

_Alignof(auto);
struct S {
    int t;
};

Stack dump:

<source>:3:9: internal compiler error: in poplevel, at cp/decl.cc:643
0x283dbf5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x28515d5 internal_error(char const*, ...)
        ???:0
0xa87f78 fancy_abort(char const*, int, char const*)
        ???:0
0xc9e5f0 end_template_decl()
        ???:0
0xc954ca c_parse_file()
        ???:0
0xded089 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