From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83B463836C52; Mon, 30 Nov 2020 10:09:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83B463836C52 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98056] ICE tree check: expected record_type or union_type or qual_union_type, have array_type in build_special_member_call, at cp/call.c:9862 since r11-2183-g0f66b8486cea8668 Date: Mon, 30 Nov 2020 10:09:56 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin 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: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone short_desc 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: Mon, 30 Nov 2020 10:09:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98056 Martin Li=C5=A1ka changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |10.3 Summary|internal compiler error: |ICE tree check: expected |tree check: expected |record_type or union_type |record_type or union_type |or qual_union_type, have |or qual_union_type, have |array_type in |array_type in |build_special_member_call, |build_special_member_call, |at cp/call.c:9862 since |at cp/call.c:9862 |r11-2183-g0f66b8486cea8668 --- Comment #3 from Martin Li=C5=A1ka --- Before r11-2183-g0f66b8486cea8668 it was rejected. Reduced test-case: $ cat cloudstorage.cc.ii namespace std { template struct coroutine_traits : _Result = {}; template struct coroutine_handle { operator coroutine_handle<>(); }; struct suspend_never { void await_ready(); void await_suspend(coroutine_handle<>); void await_resume(); }; } // namespace std namespace std_ns =3D std; namespace coro::stdx { template using coroutine_handle =3D std_ns::coroutine_handle<= >; } namespace std { struct pair { template pair(_U1, _U2); }; template class initializer_list { int *_M_array; unsigned long _M_len; }; int typedef string; } // namespace std namespace coro::stdx { class stop_token {}; } // namespace coro::stdx namespace coro { class Task { public: void await_ready(); void await_suspend(stdx::coroutine_handle<>); void await_resume(); struct promise_type { struct final_awaitable { void await_ready(); template void await_suspend(V); void await_resume(); }; std::suspend_never initial_suspend(); final_awaitable final_suspend(); void unhandled_exception(); }; }; } // namespace coro namespace std { class optional { public: template optional(_Up); }; } // namespace std namespace coro::http { struct Request { std::optional body; }; template concept HttpClient =3D requires { stdx::stop_token(); }; } // namespace coro::http namespace coro::cloudstorage { template concept CloudProviderImpl =3D requires(T stop_token) { stop_token; }; template class CloudProvider : Impl { public: Impl::Impl; template void RefreshAccessToken(HttpClient http, int refresh_token, stdx::stop_token stop_token =3D stdx::stop_token(= )) { Impl::RefreshAccessToken(http, refresh_token, stop_token); } }; } // namespace coro::cloudstorage namespace coro::util { template Task FetchJson(auto, RequestType, stdx::stop_token); } namespace coro::http { template > int FormDataToString(List); } namespace coro::cloudstorage { class GoogleDrive { public: GoogleDrive(int); template Task RefreshAccessToken(HttpClient http, int refresh_token, stdx::stop_token stop_token) { co_await util::FetchJson( http, http::Request{http::FormDataToString({{"", refresh_token}})}, stop_token); } }; } // namespace coro::cloudstorage using coro::cloudstorage::CloudProvider; using coro::cloudstorage::GoogleDrive; int GetGoogleDriveAuthData(); template void GetAccessToken(int *, HttpClient http) { CloudProvider(GetGoogleDriveAuthData()) .RefreshAccessToken(http, std::string()); } void CoMain() { int *event_loop; void http(); GetAccessToken(event_loop, http); } $ g++ cloudstorage.cc.ii -c -fcoroutines -std=3Dgnu++2a cloudstorage.cc.ii:65:3: warning: access declarations are deprecated in fav= our of using-declarations; suggestion: add the =E2=80=98using=E2=80=99 keyword = [-Wdeprecated] 65 | Impl::Impl; | ^~~~ cloudstorage.cc.ii: In instantiation of =E2=80=98coro::Task coro::cloudstorage::GoogleDrive::RefreshAccessToken(HttpClient, int, coro::stdx::stop_token) [with HttpClient =3D void (*)()]=E2=80=99: cloudstorage.cc.ii:69:29: required from =E2=80=98void coro::cloudstorage::CloudProvider::RefreshAccessToken(HttpClient, int, coro::stdx::stop_token) [with HttpClient =3D void (*)(); Impl =3D coro::cloudstorage::GoogleDrive]=E2=80=99 cloudstorage.cc.ii:100:26: required from =E2=80=98void GetAccessToken(int= *, HttpClient) [with HttpClient =3D void (*)()]=E2=80=99 cloudstorage.cc.ii:105:34: required from here cloudstorage.cc.ii:91:3: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have array_type in build_special_member_call, at cp/call.c:9862 91 | } | ^ 0x80d3ef tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/marxin/Programming/gcc/gcc/tree.c:9810 0x62a1ea tree_check3(tree_node*, char const*, int, char const*, tree_code, tree_code, tree_code) /home/marxin/Programming/gcc/gcc/tree.h:3371 0x62a1ea build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int) /home/marxin/Programming/gcc/gcc/cp/call.c:9862 0x92c1a4 flatten_await_stmt /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:2871 0x92bd96 flatten_await_stmt /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:2889 0x92bd96 flatten_await_stmt /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:2889 0x92bd96 flatten_await_stmt /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:2889 0x92bd96 flatten_await_stmt /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:2889 0x92d5fb maybe_promote_temps /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:3074 0x92d5fb await_statement_walker /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:3579 0x132093a 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 >*)) /home/marxin/Programming/gcc/gcc/tree.c:12089 0x92d100 await_statement_walker /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:3339 0x132093a 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 >*)) /home/marxin/Programming/gcc/gcc/tree.c:12089 0x1320ade 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 >*)) /home/marxin/Programming/gcc/gcc/tree.c:12425 0x92d100 await_statement_walker /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:3339 0x132093a 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 >*)) /home/marxin/Programming/gcc/gcc/tree.c:12089 0x92d7de await_statement_walker /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:3327 0x132093a 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 >*)) /home/marxin/Programming/gcc/gcc/tree.c:12089 0x928abc morph_fn_to_coro(tree_node*, tree_node**, tree_node**) /home/marxin/Programming/gcc/gcc/cp/coroutines.cc:4166 0x973e71 finish_function(bool) /home/marxin/Programming/gcc/gcc/cp/decl.c:16982 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=