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

            Bug ID: 105300
           Summary: segfault from static_assert with user-defined string
                    suffix argument
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Jack at Applin dot US
  Target Milestone: ---

Created attachment 52824
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52824&action=edit
preprocessed source to reproduce the error

$ cat bad.ii
void operator""_x(const char *, unsigned long);
static_assert(false, "foo"_x);
$ g++ bad.ii
bad.ii:2:15: internal compiler error: Segmentation fault
    2 | static_assert(false, "foo"_x);
      |               ^~~~~
0xb0c67e crash_signal
        ../../src/gcc/toplev.c:327
0x7fb38e75951f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7dd197 finish_static_assert(tree_node*, tree_node*, unsigned int, bool, bool)
        ../../src/gcc/cp/semantics.c:10134
0x15089c8 cp_parser_static_assert
        ../../src/gcc/cp/parser.c:15464
0xf9ed91 cp_parser_declaration
        ../../src/gcc/cp/parser.c:14164
0x149bba3 cp_parser_toplevel_declaration
        ../../src/gcc/cp/parser.c:14193
0x149bba3 cp_parser_translation_unit
        ../../src/gcc/cp/parser.c:4942
0x149bba3 c_parse_file()
        ../../src/gcc/cp/parser.c:45326
0x1489a5e c_common_parse_file()
        ../../src/gcc/c-family/c-opts.c:1218
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
$ g++ --version
g++ (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply via email to