[Bug c++/115200] New: [modules] ICE in declare_module() with unclosed namespace scope before module perview
nickbegg at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed May 22 23:00:51 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115200
Bug ID: 115200
Summary: [modules] ICE in declare_module() with unclosed
namespace scope before module perview
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: nickbegg at gmail dot com
Target Milestone: ---
The following invalid code causes gcc to ICE in declare_module() in a GCC debug
build -
/// header.hpp
namespace foo {
// no closing brace
/// honeydew.mpp
module;
#include "header.hpp"
export module honeydew;
///
This assert fires...
void
declare_module (module_state *module, location_t from_loc, bool exporting_p,
tree, cpp_reader *reader)
{
gcc_assert (global_namespace == current_scope ());
///
git 15.0.0 / trunk (revid 1a5e4dd83788ea4c049d354d83ad58a6a3d747e6)
/home/nick/inst/gcc-trunk-debug/bin/g++ -fdiagnostics-color=always -g
-std=gnu++23 -MD -MT CMakeFiles/moduleMin.dir/honeydew.mpp.o -MF
CMakeFiles/moduleMin.dir/honeydew.mpp.o.d -fmodules-ts
-fmodule-mapper=CMakeFiles/moduleMin.dir/honeydew.mpp.o.modmap -MD
-fdeps-format=p1689r5 -x c++ -o CMakeFiles/moduleMin.dir/honeydew.mpp.o -c
/home/nick/src/moduleMin/honeydew.mpp
/home/nick/src/moduleMin/honeydew.mpp:5:23: internal compiler error: in
declare_module, at cp/module.cc:19721
5 | export module honeydew;
| ^
0x7b6211 declare_module(module_state*, unsigned int, bool, tree_node*,
cpp_reader*)
/home/nick/src/gcc.trunk/gcc/cp/module.cc:19721
0xc09156 cp_parser_module_declaration
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:15194
0xc32a7b cp_parser_declaration
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:15640
0xc30f51 cp_parser_toplevel_declaration
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:15707
0xc30f51 cp_parser_declaration_seq_opt
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:15420
0xc313c3 cp_parser_namespace_body
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:22268
0xc313c3 cp_parser_namespace_definition
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:22246
0xc32beb cp_parser_declaration
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:15666
0xc333ea cp_parser_toplevel_declaration
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:15707
0xc333ea cp_parser_translation_unit
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:5284
0xc333ea c_parse_file()
/home/nick/src/gcc.trunk/gcc/cp/parser.cc:51498
0xd81931 c_common_parse_file()
/home/nick/src/gcc.trunk/gcc/c-family/c-opts.cc:1311
More information about the Gcc-bugs
mailing list