From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6BB7D3987945; Wed, 27 Jan 2021 14:36:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BB7D3987945 From: "davveston at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/83417] Pointer-to-member template parameter with auto member type dependent container type does not work (C++17) Date: Wed, 27 Jan 2021 14:36:01 +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: 7.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: davveston at gmail dot com 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: --- 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 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: Wed, 27 Jan 2021 14:36:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83417 David Friberg changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |davveston at gmail dot com --- Comment #3 from David Friberg --- The same holds for the case of function pointers. Given the following function: void f(int) {} Both examples (A) and (B) below are well-formed, as per [temp.deduct.type]/= 13 (and for (B): also as per [temp.arg.nontype]/1). // Example (A) template struct A; template struct A { }; A a{}; // #1: OK // Example (B) template struct B; template struct B { }; B b{}; // #2: Rejected (type deduction failure in partial specializati= on) Clang accepts both, whereas GCC (trunk/any version I've tried that supports C++17) rejects example (B), as #2 is resolved to the primary (non-defined) class template after failing to deduce the dependent 'T' from 'auto (*fp)(T= )' in the partial specialization, given the argument 'f' to the latter (non-ty= pe) template parameter.=