From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 31EFF385DDF3; Tue, 11 Jun 2024 21:32:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31EFF385DDF3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718141566; bh=zmAvf/GGPe10C4FnsQkSsr+xwaa54PITtzSvemfnXz0=; h=From:To:Subject:Date:From; b=yfFDwjilhh6h4gAHzVODU5TpCHjrVBcCm1xBmJatjXAxe21+h3Cc2tb+7Kht1W2iq XcgRx/z0kOeHb/PnQpvZAIOyp1rnBaq9//KsHs11hA3Jwalk0dKZhZTgIryW1wI9DT yPM8oNcKTe5e5SP2DuyFH3SeTXDvo8WHICJLG0NA= From: "m.cencora at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115446] New: [15 Regression] Segfault when exporting operator new Date: Tue, 11 Jun 2024 21:32:45 +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: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: m.cencora at gmail 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115446 Bug ID: 115446 Summary: [15 Regression] Segfault when exporting operator new Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: m.cencora at gmail dot com Target Milestone: --- $ cat op_new.cpp module; void* operator new(unsigned long, void*); namespace std { template auto construct_at(_Tp*) -> decltype(::new((void*)0) _Tp()) { return new _Tp(); } void use(int*p) { construct_at(p); } } export module std; export { using ::operator new; } $ g++ -Wno-global-module -fmodules-ts -std=3Dc++2b -c op_new.cpp ' Segmentation fault 9 | auto construct_at(_Tp*) -> decltype(::new((void*)0) _Tp()) | ^~~~~~~~~~~~~~~~~~~~~ 0x26c45cc internal_error(char const*, ...) ???:0 0xc06a7a lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool) ???:0 0xa93fde build_operator_new_call(tree_node*, vec**, tree_node**, tree_node**, tree_node*, tree_node*, tree_node**, int) ???:0 0xb8c6f0 build_new(unsigned int, vec**, tree_node*, tree_node*, vec**, int, int) ???:0 0xcb2a28 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0x26ed6c4 pp_format(pretty_printer*, text_info*, urlifier const*) ???:0 0x26f06a5 pp_verbatim(pretty_printer*, char const*, ...) ???:0 0x26c2e7a diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x26c45cc internal_error(char const*, ...) ???:0 0x972a48 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ???:0 0xbf6a6d name_lookup::add_overload(tree_node*) ???:0 0xbf6ce4 name_lookup::process_binding(tree_node*, tree_node*) ???:0 0xc00ce2 name_lookup::search_namespace(tree_node*) ???:0 0xc00de0 name_lookup::search_qualified(tree_node*, bool) ???:0 0xc06a70 lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool) ???:0 0xa93fde build_operator_new_call(tree_node*, vec**, tree_node**, tree_node**, tree_node*, tree_node*, tree_node**, int) ???:0 0xb8c6f0 build_new(unsigned int, vec**, tree_node*, tree_node*, vec**, int, int) ???:0 0xca6373 instantiate_decl(tree_node*, bool, bool) ???:0 0xcd08eb instantiate_pending_templates(int) ???:0 0xb690f0 c_parse_final_cleanups() ???:0 Works fine on gcc-14. Reduced from an implementation of "std" module: module; #include export module std; export { using ::operator new; }=