public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "insertinterestingnamehere at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96877] New: Erroneous warning when default initializing function pointer types defined using std::declval Date: Tue, 01 Sep 2020 02:07:17 +0000 [thread overview] Message-ID: <bug-96877-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96877 Bug ID: 96877 Summary: Erroneous warning when default initializing function pointer types defined using std::declval Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: insertinterestingnamehere at gmail dot com Target Milestone: --- When compiling the following with -Wextra (C++11 and later, all recent version of gcc) the compiler emits an erroneous warning about binding a temporary in a constructor. Note: this works fine if function_type is declared as a plain typedef instead of using decltype and std::declval. See https://godbolt.org/z/sjKdP5. #include <utility> using function_type = decltype(std::declval<void (*)(void*) noexcept>()); struct S { function_type fptr = nullptr; }; int main() { S thing; }
next reply other threads:[~2020-09-01 2:07 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-01 2:07 insertinterestingnamehere at gmail dot com [this message] 2020-09-01 15:29 ` [Bug c++/96877] " insertinterestingnamehere at gmail dot com 2020-09-01 17:37 ` redi at gcc dot gnu.org 2020-09-01 19:19 ` insertinterestingnamehere at gmail dot com 2020-09-01 19:25 ` insertinterestingnamehere at gmail dot com 2020-09-02 8:51 ` redi at gcc dot gnu.org 2020-09-02 16:51 ` insertinterestingnamehere at gmail dot com
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-96877-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).