Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

std::lerp is missing Arithmetic overloads #50431

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR51464
Status NEW
Importance P enhancement
Reported by Kostiantyn Pesteriev (konstantinua00@gmail.com)
Reported on 2021-08-12 15:00:58 -0700
Last modified on 2021-08-13 13:56:43 -0700
Version 12.0
Hardware PC Linux
CC llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
According to C++20 standard paragraph 20.8.1.2 ( [cmath.syn] ), std::lerp is
not an exception to expansion of acceptable parameters to integral and mixed
floating point types.
I.e. overload 4) from https://en.cppreference.com/w/cpp/numeric/lerp is missing.

Example code (compile with -std=c++20):

#include<cmath>

int main()
{
    std::lerp(int{},int{},int{});
    std::lerp(float{}, double{}, (long double)0);
}

https://godbolt.org/z/vboY4aoE9

Current behaviour:
Does not compile with: "error: call to 'lerp' is ambiguous" (twice)

Expected behaviour:
Compilation with no issues.
Quuxplusone commented 3 years ago
I apologize, I did not know that clang on godbolt by default uses libstdc++

Example code is the same, but compile with -std=c++20 *and* -stdlib=libc++
https://godbolt.org/z/c3PqWez9x