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

            Bug ID: 98882
           Summary: ICE in in cpp_directive_only_process on empty
                    translation unit
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: boris at kolpackov dot net
  Target Milestone: ---

I get an internal compiler error when preprocessing with -fdirectives-only an
empty translation unit:

touch test.cxx
g++ -std=c++2a -E -fdirectives-only -o test.ii test.cxx

test.cxx:1: internal compiler error: in cpp_directive_only_process, at
libcpp/lex.c:4323
0x2c09263 cpp_directive_only_process(cpp_reader*, void*, void (*)(cpp_reader*,
CPP_DO_task, void*, ...))
        ../../gcc/libcpp/lex.c:4323
0xf11c8e scan_translation_unit_directives_only
        ../../gcc/gcc/c-family/c-ppoutput.c:402
0xf11158 preprocess_file(cpp_reader*)
        ../../gcc/gcc/c-family/c-ppoutput.c:100
0xf0b6e4 c_common_init()
        ../../gcc/gcc/c-family/c-opts.c:1188
0xbe4d7b cxx_init()
        ../../gcc/gcc/cp/lex.c:332
0x1805e47 lang_dependent_init
        ../../gcc/gcc/toplev.c:1881
0x18066f9 do_compile
        ../../gcc/gcc/toplev.c:2178

This is new in GCC 11.

Reply via email to