From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5714E3858CDA; Tue, 26 Jul 2022 10:03:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5714E3858CDA From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106304] [modules] ICE compiling dynamic_cast in constexpr function (in tree_node, at cp/module.cc:9183) Date: Tue, 26 Jul 2022 10:03:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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_status everconfirmed cf_reconfirmed_on see_also keywords Message-ID: In-Reply-To: References: 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: Tue, 26 Jul 2022 10:03:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106304 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2022-07-26 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D99769 Keywords|rejects-valid |ice-on-valid-code --- Comment #1 from Jonathan Wakely --- Please provide the compiler commands, not just a link to a cmake project on godbolt, which is a pain to see what it's doing. Only one file and one command is needed to reproduce this: export module mod; template struct A : T { constexpr A(T v) : T{v} { } ~A() =3D default; // Fixes GCC. }; struct B { virtual ~B() =3D default; }; export inline constexpr auto x =3D A{B{}}; export constexpr const A* y(const B& b) { return dynamic_cast*>(&b); } $ g++ -std=3Dc++20 mod.cpp -fmodules-ts -c mod.cpp:1:8: internal compiler error: in tree_node, at cp/module.cc:9078 1 | export module mod; | ^~~~~~ Please submit a full bug report, with preprocessed source. See for instructions. Preprocessed source stored into /tmp/ccYLb5i0.out file, please attach this = to your bugreport. Maybe a dup of PR 99769 which fails at the same place in a typeid expressio= n.=