From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AA9EE385E44A; Wed, 14 Jul 2021 10:44:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA9EE385E44A From: "ensadc at mailnesia dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101449] New: [modules] internal compiler error: in cxx_eval_call_expression Date: Wed, 14 Jul 2021 10:44:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ensadc at mailnesia dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 10:44:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101449 Bug ID: 101449 Summary: [modules] internal compiler error: in cxx_eval_call_expression Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ensadc at mailnesia dot com Target Milestone: --- $ cat str.cpp export module str; export struct str { constexpr str() { ptr =3D new char[42]; } constexpr ~str() { delete[] ptr; } const char* ptr =3D nullptr; }; export constexpr str get_str() { return str{}; } $ cat main.cpp import str; int main() { str a =3D get_str(); } $ g++ -std=3Dc++2b -fmodules-ts str.cpp main.cpp main.cpp: In function =E2=80=98int main()=E2=80=99: main.cpp:4:21: in =E2=80=98constexpr=E2=80=99 expansion of =E2=80=98get_s= tr@str()()=E2=80=99 main.cpp:4:21: internal compiler error: in cxx_eval_call_expression, at cp/constexpr.c:2742 4 | str a =3D get_str(); | ^ 0x652ee9 cxx_eval_call_expression ../../gcc/gcc/cp/constexpr.c:2742 0x9e54f1 cxx_eval_constant_expression ../../gcc/gcc/cp/constexpr.c:6250 0x9e8829 cxx_eval_outermost_constant_expr ../../gcc/gcc/cp/constexpr.c:7282 0x9ed921 maybe_constant_value(tree_node*, tree_node*, bool) ../../gcc/gcc/cp/constexpr.c:7556 0xa20665 cp_fully_fold(tree_node*) ../../gcc/gcc/cp/cp-gimplify.c:2146 0xa207f4 cp_fully_fold(tree_node*) ../../gcc/gcc/cp/cp-gimplify.c:2140 0xa207f4 cp_fully_fold_init(tree_node*) ../../gcc/gcc/cp/cp-gimplify.c:2167 0xc16e03 store_init_value(tree_node*, tree_node*, vec**, int) ../../gcc/gcc/cp/typeck2.c:816 0xa3a300 check_initializer ../../gcc/gcc/cp/decl.c:7169 0xa5dfd0 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc/gcc/cp/decl.c:8103 0xb4a89f cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:22258 0xb2608d cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:14801 0xb27d69 cp_parser_declaration_statement ../../gcc/gcc/cp/parser.c:13936 0xb28743 cp_parser_statement ../../gcc/gcc/cp/parser.c:12066 0xb2904e cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:12433 0xb29128 cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:12382 0xb48ff0 cp_parser_function_body ../../gcc/gcc/cp/parser.c:24448 0xb48ff0 cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:24499 0xb49aea cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:30572 0xb4ac96 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:30488 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=