Lines Matching defs:infinity
26 // RUN: %s -Wno-nan-infinity-disabled -menable-no-infs -std=c++23
29 // RUN: %s -Wno-nan-infinity-disabled -menable-no-nans -std=c++23
64 [[nodiscard]] static constexpr _Ty infinity() noexcept {
77 [[nodiscard]] static constexpr float infinity() noexcept {
85 [[nodiscard]] static constexpr double infinity() noexcept {
93 [[nodiscard]] static constexpr _Ty infinity() noexcept {
101 [[nodiscard]] static constexpr float infinity() noexcept {
109 [[nodiscard]] static constexpr double infinity() noexcept {
114 double infinity() { return 0; }
118 // no-inf-no-nan-warning@+4 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
119 // no-inf-no-nan-warning@+3 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
120 // no-inf-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
121 // no-inf-warning@+1 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
124 // no-inf-no-nan-warning@+4 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
125 // no-inf-no-nan-warning@+3 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
126 // no-inf-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
127 // no-inf-warning@+1 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
142 // no-inf-no-nan-warning@+4 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
143 // no-inf-no-nan-warning@+3 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
144 // no-inf-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
145 // no-inf-warning@+1 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
148 // no-inf-no-nan-warning@+4 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
149 // no-inf-no-nan-warning@+3 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
150 // no-inf-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
151 // no-inf-warning@+1 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
166 // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
167 // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
174 // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
175 // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
178 // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
179 // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
186 // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
187 // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
190 // These should NOT warn, since they are not using NaN or infinity.
231 // no-inf-no-nan-warning@+4 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
232 // no-inf-no-nan-warning@+3 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
233 // no-inf-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
234 // no-inf-warning@+1 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
245 // no-inf-no-nan-warning@+6 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
246 // no-inf-no-nan-warning@+5 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
248 // no-inf-warning@+3 {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
249 // no-inf-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
253 // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
254 // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
255 double y = i * std::numeric_limits<double>::infinity();
257 y = i * numeric_limits<double>::infinity(); // expected-no-diagnostics
259 // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
260 // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
261 j = std::numeric_limits<float>::infinity();
263 j = numeric_limits<float>::infinity(); // expected-no-diagnostics
265 y = infinity(); // expected-no-diagnostics