public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100381] [11/12/13/14 Regression] new static_assert((std::__is_complete_or_unbounded(...)) failure from g++ 11.1.0 Date: Wed, 27 Mar 2024 12:21:25 +0000 [thread overview] Message-ID: <bug-100381-4-M9toEp6q7D@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100381-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100381 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- The code is definitely invalid. Your code instantiates std::function<void(CallParameter)> where CallParameter is IndexGroupsAndNames which is an incomplete type. Constructing a std::function checks that the callable argument is invocable with the argument types in the std::function's call signature, which is void(CallParameter). That is done using std::is_invocable_r. The spec for std::is_invocable_r<R, Fn, ArgTypes...> has this requirement: "Fn, R, and all types in the template parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound." So you're trying to construct std::function<void(IncompleteType)> which needs to check if you can call a function with an argument of type IncompleteType, which cannot be determined because the type might be non-copyable. Using std::function<void(const CallParameter&)> would work, so would ensuring the type is complete before trying to use it in a std::function call signature.
prev parent reply other threads:[~2024-03-27 12:21 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-02 14:15 [Bug c++/100381] New: " gilles.gouaillardet at gmail dot com 2021-05-03 8:04 ` [Bug libstdc++/100381] [11/12 Regression] " rguenth at gcc dot gnu.org 2021-07-28 7:06 ` rguenth at gcc dot gnu.org 2021-07-28 10:43 ` redi at gcc dot gnu.org 2022-04-21 7:49 ` rguenth at gcc dot gnu.org 2023-05-29 10:04 ` [Bug libstdc++/100381] [11/12/13/14 " jakub at gcc dot gnu.org 2024-03-27 12:21 ` redi at gcc dot gnu.org [this message]
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-100381-4-M9toEp6q7D@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).