================
@@ -216,11 +244,18 @@ int compareit(float a, float b) {
// no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the
currently enabled floating-point options}}
// no-inf-warning@+1 {{use of infinity is undefined behavior due to the
currently enabled floating-point options}}
- double y = i * numeric_limits<double>::infinity();
+ double y = i * std::numeric_limits<double>::infinity();
+
+ y = i * numeric_limits<double>::infinity(); // expected-no-diagnostics
// no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the
currently enabled floating-point options}}
// no-inf-warning@+1 {{use of infinity is undefined behavior due to the
currently enabled floating-point options}}
- j = numeric_limits<float>::infinity();
+ j = std::numeric_limits<float>::infinity();
----------------
AmrDeveloper wrote:
> So what happens if we are using `using namespace std` and use
> `numeric_limits<...>::infinity()` do we expect a diagnostic?
Yes should expect a diagnostic because we check Decl name space not the call
expr,
I will create a pr to cover this case and update minor comment related to
namespace
I will tag you as reviewer once I push it
Thanks
https://github.com/llvm/llvm-project/pull/123417
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits