https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90382
Bug ID: 90382 Summary: internal compiler error: in linemap_macro_map_loc_to_exp_point, at libcpp/line-map.c:1061 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: sbergman at redhat dot com Target Milestone: --- I encountered this ICE with recent GCC trunk with #include "boost/spirit/include/phoenix.hpp" but could only strip it down to the following reproducer that still includes some boost/preprocessor/ include files (from boost-devel-1.69.0-6.fc30.x86_64 on Fedora 30 in my case). The failure was not reproducible with -E preprocessed sources. $ cat test.cc > #include "boost/preprocessor/repetition/enum_params.hpp" > #include "boost/preprocessor/repetition/repeat_from_to.hpp" > > template<typename = void> struct S {}; > > #define N S > > #define M(z, n, d) template<BOOST_PP_ENUM_PARAMS(n, typename A)> void > f(N<BOOST_PP_ENUM_PARAMS(n, A)> const &); > > BOOST_PP_REPEAT_FROM_TO(0, 1, M,) $ gcc/trunk/inst/bin/g++ -c test.cc > test.cc:8:109: internal compiler error: in > linemap_macro_map_loc_to_exp_point, at libcpp/line-map.c:1061 > 8 | d) template<BOOST_PP_ENUM_PARAMS(n, typename A)> void > f(N<BOOST_PP_ENUM_PARAMS(n, A)> const &); > | > ^ > > /usr/include/boost/preprocessor/repetition/repeat_from_to.hpp:83:54: note: in > expansion of macro ‘M’ > 83 | # define BOOST_PP_REPEAT_FROM_TO_M_1_II(z, n, m, dt) m(z, n, dt) > | ^ > 0x18ecbef linemap_macro_map_loc_to_exp_point > ../../src/libcpp/line-map.c:1061 > 0x18ecbef linemap_macro_map_loc_to_exp_point > ../../src/libcpp/line-map.c:1054 > 0x18ee6a7 first_map_in_common_1 > ../../src/libcpp/line-map.c:1269 > 0x18ee6a7 first_map_in_common > ../../src/libcpp/line-map.c:1306 > 0x18ee6a7 linemap_compare_locations(line_maps*, unsigned int, unsigned int) > ../../src/libcpp/line-map.c:1349 > 0x905d8d linemap_location_before_p(line_maps*, unsigned int, unsigned int) > ../../src/gcc/../libcpp/include/line-map.h:1273 > 0x905d8d min_location > ../../src/gcc/cp/decl.c:10069 > 0x91cdbb grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, > decl_context, int, tree_node**) > ../../src/gcc/cp/decl.c:10427 > 0x9c3e0e cp_parser_parameter_declaration_list > ../../src/gcc/cp/parser.c:22197 > 0x9c41ab cp_parser_parameter_declaration_clause > ../../src/gcc/cp/parser.c:22114 > 0x9b8d9d cp_parser_direct_declarator > ../../src/gcc/cp/parser.c:20806 > 0x9b8d9d cp_parser_declarator > ../../src/gcc/cp/parser.c:20674 > 0x9c6bb5 cp_parser_init_declarator > ../../src/gcc/cp/parser.c:20184 > 0x9ca294 cp_parser_single_declaration > ../../src/gcc/cp/parser.c:28268 > 0x9caed7 cp_parser_explicit_specialization > ../../src/gcc/cp/parser.c:17323 > 0x9cd826 cp_parser_declaration > ../../src/gcc/cp/parser.c:13184 > 0x9cde1f cp_parser_translation_unit > ../../src/gcc/cp/parser.c:4701 > 0x9cde1f c_parse_file() > ../../src/gcc/cp/parser.c:41181 > 0xad3beb c_common_parse_file() > ../../src/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.