@@ -9,12 +9,17 @@ namespace bar {
99 template <typename T>
1010 auto sqrt (T val) { return sqrt (static_cast <double >(val)); }
1111
12+ float sqrtf (float Arg);
13+ long double sqrtl (long double Arg);
14+
1215 static constexpr double e = 2.718281828459045235360287471352662497757247093 ;
1316 // CHECK-MESSAGES-ALL: :[[@LINE-1]]:33: warning: prefer 'std::numbers::e' to this literal, differs by '0.00e+00' [modernize-use-std-numbers]
1417 // CHECK-FIXES-ALL: static constexpr double e = std::numbers::e;
1518}
1619
20+ float expf (float Arg);
1721double exp (double Arg);
22+ long double expl (long double Arg);
1823double log (double Arg);
1924
2025double log2 (double Arg);
@@ -110,6 +115,14 @@ void foo(){
110115 // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::sqrt2_v<float>' to this formula [modernize-use-std-numbers]
111116 // CHECK-FIXES-ALL: std::numbers::sqrt2_v<float>;
112117
118+ bar::sqrtf (2 .0F );
119+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::sqrt2_v<float>' to this formula [modernize-use-std-numbers]
120+ // CHECK-FIXES-ALL: std::numbers::sqrt2_v<float>;
121+
122+ bar::sqrtl (2.0 );
123+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::sqrt2_v<long double>' to this formula [modernize-use-std-numbers]
124+ // CHECK-FIXES-ALL: std::numbers::sqrt2_v<long double>;
125+
113126 sink (MY_PI);
114127 // CHECK-MESSAGES-ALL: :[[@LINE-1]]:10: warning: prefer 'std::numbers::pi' to this macro, differs by '5.36e-08' [modernize-use-std-numbers]
115128 // CHECK-FIXES-ALL: sink(std::numbers::pi);
@@ -155,6 +168,14 @@ void foo(){
155168 // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::e' to this formula [modernize-use-std-numbers]
156169 // CHECK-FIXES-ALL: std::numbers::e;
157170
171+ expf (1 );
172+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::e_v<float>' to this formula [modernize-use-std-numbers]
173+ // CHECK-FIXES-ALL: std::numbers::e_v<float>;
174+
175+ expl (1 );
176+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::e_v<long double>' to this formula [modernize-use-std-numbers]
177+ // CHECK-FIXES-ALL: std::numbers::e_v<long double>;
178+
158179 log2 (exp (1 ));
159180 // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: prefer 'std::numbers::log2e' to this formula [modernize-use-std-numbers]
160181 // CHECK-MESSAGES-ALL: :[[@LINE-2]]:10: warning: prefer 'std::numbers::e' to this formula [modernize-use-std-numbers]
0 commit comments