public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "johelegp at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105044] New: [modules] ICE in comptypes, at cp/typeck.c:1529 Date: Thu, 24 Mar 2022 10:53:13 +0000 [thread overview] Message-ID: <bug-105044-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105044 Bug ID: 105044 Summary: [modules] ICE in comptypes, at cp/typeck.c:1529 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/YGo78aPE8. `mod.cpp`: ```C++ export module mod; export template<typename BaseType> struct downcast_base { using downcast_base_type = BaseType; friend auto downcast_guide(downcast_base); }; export template<typename T> concept Downcastable = true; export template<typename Target, Downcastable T> struct downcast_child : T { friend auto downcast_guide(typename T::downcast_base) { return T(); } }; export struct ratio { int num; }; export template<ratio R, typename U> struct scaled_unit : downcast_base<scaled_unit<R, U>> {}; export template<typename Child> struct unit : downcast_child<Child, scaled_unit<ratio(1), Child>> {}; export struct unknown_coherent_unit : unit<unknown_coherent_unit> {}; ``` `test.cpp`: ```C++ import mod; struct u : downcast_base<u> { }; int main() { } ``` Output: ``` In module mod, imported at /app/test.cpp:1: mod.cpp: In instantiation of 'struct downcast_base@mod<u>': test.cpp:2:12: required from here mod.cpp:4:8: internal compiler error: in comptypes, at cp/typeck.cc:1529 4 | struct downcast_base { | ^~~~~~~~~~~~~ 0x218c519 internal_error(char const*, ...) ???:0 0x741b3f fancy_abort(char const*, int, char const*) ???:0 0xa7e346 comptypes(tree_node*, tree_node*, int) ???:0 0x828f6d complete_vars(tree_node*) ???:0 0x7a1a5c finish_struct_1(tree_node*) ???:0 0xa01359 instantiate_class_template(tree_node*) ???:0 0xa7739b complete_type_or_maybe_complain(tree_node*, tree_node*, int) ???:0 0x841a1c xref_basetypes(tree_node*, tree_node*) ???:0 0x986b0d c_parse_file() ???:0 0xb18ae2 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. ```
next reply other threads:[~2022-03-24 10:53 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-24 10:53 johelegp at gmail dot com [this message] 2022-07-03 21:24 ` [Bug c++/105044] " johelegp at gmail dot com 2022-07-03 21:25 ` [Bug c++/105044] [modules] ICE in comptypes, at cp/typeck.cc:1531 johelegp at gmail dot com 2022-07-04 3:28 ` johelegp at gmail dot com 2022-10-18 15:10 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-105044-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).