public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96328] New: Singe keyword "friend" makes GCC ICE in cp_lexer_previous_token, at cp/parser.c:769
@ 2020-07-27  3:42 haoxintu at gmail dot com
  2020-07-27  6:44 ` [Bug c++/96328] [11 Regression] Single keyword "friend" makes GCC ICE in cp_lexer_previous_token, at cp/parser.c:769 since r11-891-g1dc83b460653c29f marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: haoxintu at gmail dot com @ 2020-07-27  3:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96328
           Summary: Singe keyword "friend" makes GCC ICE in
                    cp_lexer_previous_token, at cp/parser.c:769
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi, all.

Weirdly, a single "friend" makes GCC crashed in the current trunk.

Input: 
//small.cc
friend

Command:
g++ small.cc

Output:
small.cc:1:1: error: ‘friend’ used outside of class
    1 | friend
      | ^~~~~~
      | ------
small.cc:2: internal compiler error: in cp_lexer_previous_token, at
cp/parser.c:769
0x66759d cp_lexer_previous_token
        ../../gcc/cp/parser.c:769
0x667c28 cp_lexer_previous_token
        ../../gcc/tree.h:3303
0x667c28 cp_parser_error_1
        ../../gcc/cp/parser.c:2943
0x9e04c0 cp_parser_error
        ../../gcc/cp/parser.c:3003
0x9e04c0 cp_parser_error
        ../../gcc/cp/parser.c:3000
0x9e04c0 cp_parser_unqualified_id
        ../../gcc/cp/parser.c:6332
0x9d7cf8 cp_parser_direct_declarator
        ../../gcc/cp/parser.c:22255
0x9d7cf8 cp_parser_declarator
        ../../gcc/cp/parser.c:21137
0x9ed1a6 cp_parser_init_declarator
        ../../gcc/cp/parser.c:20637
0x9cdacc cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13799
0x9f8d2e cp_parser_declaration
        ../../gcc/cp/parser.c:13498
0x9f941b cp_parser_translation_unit
        ../../gcc/cp/parser.c:4781
0x9f941b c_parse_file()
        ../../gcc/cp/parser.c:44069
0xb13e2d c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1188
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.

$g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/tuhaoxin/compilers/gcc-0726/build/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure CC=gcc-10 CXX=g++-10
--prefix=/home/hatuhaoxin/compilers/gcc-0726/build/ --enable-languages=c,c++
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200726 (experimental) (GCC) 

Interestingly, this case only occurred in the 20200726 trunk version, it does
not crash on 20200725.

Thanks,
Haoxin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-28 13:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27  3:42 [Bug c++/96328] New: Singe keyword "friend" makes GCC ICE in cp_lexer_previous_token, at cp/parser.c:769 haoxintu at gmail dot com
2020-07-27  6:44 ` [Bug c++/96328] [11 Regression] Single keyword "friend" makes GCC ICE in cp_lexer_previous_token, at cp/parser.c:769 since r11-891-g1dc83b460653c29f marxin at gcc dot gnu.org
2020-07-27  7:44 ` rguenth at gcc dot gnu.org
2020-07-27  9:06 ` mark at gcc dot gnu.org
2020-07-27  9:09 ` jakub at gcc dot gnu.org
2020-07-27  9:26 ` mark at gcc dot gnu.org
2020-07-27  9:52 ` jakub at gcc dot gnu.org
2020-07-27 10:55 ` mark at gcc dot gnu.org
2020-07-28 13:42 ` cvs-commit at gcc dot gnu.org
2020-07-28 13:46 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).