From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9927A3846426; Thu, 9 May 2024 21:01:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9927A3846426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715288506; bh=tv9fMjqcVlVkpsjELeu8YKAy8msn4EmQfGVNCmtvaLo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DcEEH11q5hkcu0+C8uW0sQVJh8YeuoJnS1sPOu5mST/UG80xtRreCiXKlajarFH0w TwBhNUKnm5U1NRpzAk14Oi8FoBas98vyiOlk8uIDzi+CjyfzLy0Vr+vBlwbUnx1xQv PNdyc2bdONz5RxACEaxXdO795t5//h/znr7FjHkw= From: "public.melg8 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98056] coroutines: ICE tree check: expected record_type or union_type or qual_union_type, have array_type since r11-2183-g0f66b8486cea8668 Date: Thu, 09 May 2024 21:01:43 +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: 11.0 X-Bugzilla-Keywords: C++-coroutines, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: public.melg8 at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98056 melg melg changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |public.melg8 at gmail dot = com --- Comment #26 from melg melg --- I think i found regression of this bug. Or maybe similar type of bug, but w= ith slightly different reproducible. Using std::vector as container and std::st= ring as elements of vector, when you take std::vector as argument by value to the coroutine and on call side initialize that argument with sing= le std::string value using initializer list - you get ICE. Affected versions (tested on godbolt.org):=20 x86-64 gcc: - 11.1, 11.2, 11.4 - 12.3 - 13.1, 13.2 Luckily 14.1 version of gcc doesn't have this error.=20 Minimal reproducer online: https://godbolt.org/z/drnf3PWsY Compilation flags: "-std=3Dc++20" Minimal reproducer source code: #include #include #include auto use_vector_of_strings(std::vector values) { struct awaitable { bool await_ready() { return false; } void await_suspend(std::coroutine_handle<> h) { h.resume(); } void await_resume() {} }; return awaitable{}; } struct task { struct promise_type { task get_return_object() { return {}; } std::suspend_never initial_suspend() { return {}; } std::suspend_never final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {} }; }; task string_test_1() { std::string test =3D "hello"; co_await use_vector_of_strings({test}); // ICE here. } task string_test_2() { std::string test =3D "hello"; std::vector container{test}; // No problem here. co_await use_vector_of_strings(container); // No problem here. } int main() { string_test_1(); string_test_2();=20 } ICE error message: : In function 'task string_test_1()': :29:1: internal compiler error: in build_special_member_call, at cp/call.cc:11093 29 | } | ^ 0x1ce62bc internal_error(char const*, ...) ???:0 0x71ee4d fancy_abort(char const*, int, char const*) ???:0 0x10f5a63 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ???:0 0x10f5a63 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ???:0=