Incorrect "Value may not fit into receiver" inspection for std::abs
On my computer, the following code
#include <cstdlib>
int main()
{
int i = 5;
int j = std::abs(i);
}
raises the warning "Values of type 'long' may not fit into the receiver type 'int'. However, there is an int-valued abs function (http://en.cppreference.com/w/cpp/numeric/math/abs), so why is CLion raising this warning? Thanks for the help!
Please sign in to leave a comment.
Hi Spencer.
It correctly works in my environment. Could you please specify which OS and CLion version ('About CLion') you are using?
Hi Anna,
I am using Arch Linux with CLion version:
CLion 2016.1.2
Build #CL-145.972, built on May 18, 2016
JRE: 1.8.0_92-b14 amd64
JVM: OpenJDK 64-Bit Server VM by Oracle Corporation
Could you please try CLion 2016.2 EAP? Does the problem occur?
Yes, unfortunately the problem still occurs.