From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5290D3857C42; Tue, 1 Sep 2020 02:07:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5290D3857C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598926037; bh=zWZD+4vHU54ULIdf6BA3DeN/TA/mjAMiCKuA99BKYaw=; h=From:To:Subject:Date:From; b=NkhrnsU/okRhqdEQhqvrf021xKhLDShNl3xsu3043VIGpaUFQefHvTdgl1eYS1QF9 ZQIR6N84HB4DF/DBPlHVhIe99Itqc6BoCEbl/IYj9XDqGHWCZ5PAL145vks4Ja0HMO BzSNR+bCBwF3uWrC6aOQHdzz0A3J4FtlbAr0bHb4= From: "insertinterestingnamehere at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: insertinterestingnamehere at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 01 Sep 2020 02:07:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96877 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 vers= ion of gcc) the compiler emits an erroneous warning about binding a temporary i= n 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 using function_type =3D decltype(std::declval()); struct S { function_type fptr =3D nullptr; }; int main() { S thing; }=