https://github.com/PiotrZSL requested changes to this pull request.

Example:
```
llvm/include/llvm/Support/MathExtras.h:59:31: warning: prefer std::numbers math 
constant [modernize-use-std-numbers]
   59 |                 inv_sqrt3f  = .577350269F, // (0x1.279a74P-1)
      |                               ^~~~~~~~~~~
      |                               std::numbers::egamma_v<float>
```

```
egammaf     = .577215665F
```

Looks like having this check implemented as an multiple matchers isn't a good 
idea, simply because we pickup first one that match instead a nearest one. This 
leads to bugs when dealing with proper values.

In ideal conditions something like x* 3.14 should be even detected as PI. 
Also warning message should already say what from std::numbers should be used 
and how far are current and proposed values from them self.

https://github.com/llvm/llvm-project/pull/66583
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to