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

            Bug ID: 90138
           Summary: ICE on invalid in contains_struct_check()
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
  Target Milestone: ---

r270434 --enable-checking=release not ICE
r270435 --enable-checking=yes,df,fold,rtl,extra ICE

$ cat x_2.ii
template <, typename a, typename typename, typename a,

$ g++ -fpreprocessed -fsyntax-only -c a.ii^C
[dimhen:dim ice]$ cat x_2.ii
template <, typename a, typename typename, typename a,[dimhen:dim ice]$ cat
x_2.ii
[dimhen:dim ice]$ /usr/local/gcc_current/bin/g++ -fpreprocessed -fsyntax-only
-c x_2.ii
x_2.ii:1:11: error: expected identifier before ‘,’ token
    1 | template <, typename a, typename typename, typename a,
      |           ^
x_2.ii:1:34: error: expected nested-name-specifier before ‘typename’
    1 | template <, typename a, typename typename, typename a,
      |                                  ^~~~~~~~
x_2.ii:1:42: error: expected nested-name-specifier before ‘,’ token
    1 | template <, typename a, typename typename, typename a,
      |                                          ^
x_2.ii:1:42: error: two or more data types in declaration of ‘parameter’
x_2.ii:1:54: error: expected identifier at end of input
    1 | template <, typename a, typename typename, typename a,
      |                                                      ^
x_2.ii:1:54: internal compiler error: Segmentation fault
0x11f6bdf crash_signal
        /home/dimhen/src/gcc_current/gcc/toplev.c:326
0x7f69746b55ff ???
       
/usr/src/debug/glibc-2.28-95-g7423da211d/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xc1a517 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /home/dimhen/src/gcc_current/gcc/tree.h:3289
0xc1a517 process_template_parm(tree_node*, unsigned int, tree_node*, bool,
bool)
        /home/dimhen/src/gcc_current/gcc/cp/pt.c:4345
0xbfab99 cp_parser_template_parameter_list
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:15642
0xc01694 cp_parser_explicit_template_declaration
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:28091
0xc01694 cp_parser_template_declaration_after_export
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:28125
0xc041f9 cp_parser_declaration
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:13187
0xc0484f cp_parser_translation_unit
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:4701
0xc0484f c_parse_file()
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:41181
0xd0b1fb c_common_parse_file()
        /home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1156
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ /usr/local/gcc_current/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/9.0.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 9.0.1 20190418 (experimental) [trunk revision 270435] (GCC)

Reply via email to