From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C03253857817; Tue, 12 Oct 2021 10:59:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C03253857817 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/101870] std::lerp is missing Arithmetic overloads Date: Tue, 12 Oct 2021 10:59:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Tue, 12 Oct 2021 10:59:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101870 --- Comment #3 from CVS Commits --- The releases/gcc-11 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:371e12a7fd0295251340eabae77dd060577054c3 commit r11-9113-g371e12a7fd0295251340eabae77dd060577054c3 Author: Jonathan Wakely Date: Thu Aug 12 17:35:25 2021 +0100 libstdc++: Add additional overload of std::lerp [PR101870] The [cmath.syn] p1 wording about additional overloads sufficient to handle any arithmetic types also applies to std::lerp. This adds a new overload of std::lerp that does the required promotions to support arguments of arbitrary arithmetic types. A new __promoted_t alias template is added, which the C++17 function templates std::hypot and std::lerp can use to avoid instantiating the __promote_3 class template. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/101870 * include/c_global/cmath (hypot): Use __promoted_t. (lerp): Add new overload accepting any arithmetic types. * include/ext/type_traits.h (__promoted_t): New alias template. * testsuite/26_numerics/lerp.cc: Moved to... * testsuite/26_numerics/lerp/1.cc: ...here. * testsuite/26_numerics/lerp/constexpr.cc: New test. * testsuite/26_numerics/lerp/version.cc: New test. (cherry picked from commit 9017326e19fe278d5f62898cca4682b17f8e8e07)=