From 156d2391d92bae3e85dcffdd8f05f054ba1cfbd0 Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Wed, 17 Jun 2020 16:14:15 +0800 Subject: [PATCH 01/10] Remove pow(floating, int) overloads --- stl/inc/cmath | 33 +-------------------------------- tests/tr1/tests/cmath1/test.cpp | 2 ++ tests/tr1/tests/cmath2/test.cpp | 2 ++ tests/tr1/tests/cmath3/test.cpp | 2 ++ 4 files changed, 7 insertions(+), 32 deletions(-) diff --git a/stl/inc/cmath b/stl/inc/cmath index 6137ec53fa4..cf07a5b9424 100644 --- a/stl/inc/cmath +++ b/stl/inc/cmath @@ -19,14 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new -_NODISCARD _Check_return_ inline double pow(_In_ double _Xx, _In_ int _Yx) noexcept /* strengthened */ { - if (_Yx == 2) { - return _Xx * _Xx; - } - - return _CSTD pow(_Xx, static_cast(_Yx)); -} - _NODISCARD _Check_return_ inline float acos(_In_ float _Xx) noexcept /* strengthened */ { return _CSTD acosf(_Xx); } @@ -199,14 +191,6 @@ _NODISCARD _Check_return_ inline float pow(_In_ float _Xx, _In_ float _Yx) noexc return _CSTD powf(_Xx, _Yx); } -_NODISCARD _Check_return_ inline float pow(_In_ float _Xx, _In_ int _Yx) noexcept /* strengthened */ { - if (_Yx == 2) { - return _Xx * _Xx; - } - - return _CSTD powf(_Xx, static_cast(_Yx)); -} - _NODISCARD _Check_return_ inline float remainder(_In_ float _Xx, _In_ float _Yx) noexcept /* strengthened */ { return _CSTD remainderf(_Xx, _Yx); } @@ -442,14 +426,6 @@ _NODISCARD _Check_return_ inline long double pow(_In_ long double _Xx, _In_ long return _CSTD powl(_Xx, _Yx); } -_NODISCARD _Check_return_ inline long double pow(_In_ long double _Xx, _In_ int _Yx) noexcept /* strengthened */ { - if (_Yx == 2) { - return _Xx * _Xx; - } - - return _CSTD powl(_Xx, static_cast(_Yx)); -} - _NODISCARD _Check_return_ inline long double remainder(_In_ long double _Xx, _In_ long double _Yx) noexcept /* strengthened */ { return _CSTD remainderl(_Xx, _Yx); @@ -517,13 +493,6 @@ double frexp(_Ty _Value, _Out_ int* const _Exp) noexcept /* strengthened */ { return _CSTD frexp(static_cast(_Value), _Exp); } -// FUNCTION TEMPLATE pow -template && _STD is_arithmetic_v<_Ty2>, int> = 0> -_NODISCARD _STD _Common_float_type_t<_Ty1, _Ty2> pow(const _Ty1 _Left, const _Ty2 _Right) noexcept /* strengthened */ { - using _Common = _STD _Common_float_type_t<_Ty1, _Ty2>; - return _CSTD pow(static_cast<_Common>(_Left), static_cast<_Common>(_Right)); -} - // FUNCTION TEMPLATE fma #if !_HAS_IF_CONSTEXPR inline float _Fma(float _Left, float _Middle, float _Right) noexcept { @@ -643,7 +612,7 @@ _GENERIC_MATH1(cbrt) _GENERIC_MATH1(fabs) _GENERIC_MATH2(hypot) // 3-arg hypot() is hand-crafted -// pow() is hand-crafted +_GENERIC_MATH2(pow) _GENERIC_MATH1(sqrt) _GENERIC_MATH1(erf) _GENERIC_MATH1(erfc) diff --git a/tests/tr1/tests/cmath1/test.cpp b/tests/tr1/tests/cmath1/test.cpp index 67806452778..e73589b7b1f 100644 --- a/tests/tr1/tests/cmath1/test.cpp +++ b/tests/tr1/tests/cmath1/test.cpp @@ -50,6 +50,8 @@ void test_cpp() { // test C++ header double (*pabs)(double) = &STD abs; // C++ overloads CHECK((*pabs)(-rthalf) == rthalf); + + static_assert(std::is_same::value); } void test_main() { // test basic workings of cmath definitions diff --git a/tests/tr1/tests/cmath2/test.cpp b/tests/tr1/tests/cmath2/test.cpp index 90f289c80be..188c8373f0f 100644 --- a/tests/tr1/tests/cmath2/test.cpp +++ b/tests/tr1/tests/cmath2/test.cpp @@ -94,6 +94,8 @@ void test_cpp() { // test C++ header CHECK(approx((*psqrt)(2.0F), 1.0F / rthalf)); float (*ptanh)(float) = &STDx tanh; CHECK(approx((*ptanh)(-1.0F), -(e * e - 1.0F) / (e * e + 1.0F))); + + static_assert(std::is_same::value); } void test_main() { // test basic workings of cmath definitions diff --git a/tests/tr1/tests/cmath3/test.cpp b/tests/tr1/tests/cmath3/test.cpp index 3907014c393..f918d3d859b 100644 --- a/tests/tr1/tests/cmath3/test.cpp +++ b/tests/tr1/tests/cmath3/test.cpp @@ -94,6 +94,8 @@ void test_cpp() { // test C++ header CHECK(approx((*psqrt)(2.0L), 1.0L / rthalf)); long double (*ptanh)(long double) = &STDx tanh; CHECK(approx((*ptanh)(-1.0L), -(e * e - 1.0L) / (e * e + 1.0L))); + + static_assert(std::is_same::value); } void test_main() { // test basic workings of cmath definitions From 9174b037e6ba18231f6c07a9d5b5a2af8058c9a3 Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Wed, 17 Jun 2020 18:02:25 +0800 Subject: [PATCH 02/10] Fix terse static assert --- tests/tr1/tests/cmath1/test.cpp | 2 +- tests/tr1/tests/cmath2/test.cpp | 2 +- tests/tr1/tests/cmath3/test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tr1/tests/cmath1/test.cpp b/tests/tr1/tests/cmath1/test.cpp index e73589b7b1f..809de23c1a1 100644 --- a/tests/tr1/tests/cmath1/test.cpp +++ b/tests/tr1/tests/cmath1/test.cpp @@ -51,7 +51,7 @@ void test_cpp() { // test C++ header double (*pabs)(double) = &STD abs; // C++ overloads CHECK((*pabs)(-rthalf) == rthalf); - static_assert(std::is_same::value); + STATIC_ASSERT(std::is_same::value); } void test_main() { // test basic workings of cmath definitions diff --git a/tests/tr1/tests/cmath2/test.cpp b/tests/tr1/tests/cmath2/test.cpp index 188c8373f0f..ae89b5d7177 100644 --- a/tests/tr1/tests/cmath2/test.cpp +++ b/tests/tr1/tests/cmath2/test.cpp @@ -95,7 +95,7 @@ void test_cpp() { // test C++ header float (*ptanh)(float) = &STDx tanh; CHECK(approx((*ptanh)(-1.0F), -(e * e - 1.0F) / (e * e + 1.0F))); - static_assert(std::is_same::value); + STATIC_ASSERT(std::is_same::value); } void test_main() { // test basic workings of cmath definitions diff --git a/tests/tr1/tests/cmath3/test.cpp b/tests/tr1/tests/cmath3/test.cpp index f918d3d859b..9ca06e646af 100644 --- a/tests/tr1/tests/cmath3/test.cpp +++ b/tests/tr1/tests/cmath3/test.cpp @@ -95,7 +95,7 @@ void test_cpp() { // test C++ header long double (*ptanh)(long double) = &STDx tanh; CHECK(approx((*ptanh)(-1.0L), -(e * e - 1.0L) / (e * e + 1.0L))); - static_assert(std::is_same::value); + STATIC_ASSERT(std::is_same::value); } void test_main() { // test basic workings of cmath definitions From d0a9a9e757dc8aca8cfe43918d53b708fa4e84fc Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Wed, 17 Jun 2020 21:14:13 +0800 Subject: [PATCH 03/10] Fix build --- tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp | 2 +- tests/tr1/tests/cmath1/test.cpp | 2 ++ tests/tr1/tests/cmath2/test.cpp | 2 ++ tests/tr1/tests/cmath3/test.cpp | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp b/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp index 3a8de4d7c99..32da82a4077 100644 --- a/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp +++ b/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp @@ -44,7 +44,7 @@ class test_std_pow_against_crt { void single(uint32_t baseCandidate) { float input = reinterpret_as(baseCandidate); - float powOut = std::pow(input, 2); + float powOut = input * input; float powfOut = powf(input, 2.0f); int powClass = fpclassify(powOut); int powfClass = fpclassify(powfOut); diff --git a/tests/tr1/tests/cmath1/test.cpp b/tests/tr1/tests/cmath1/test.cpp index 809de23c1a1..6a80901e9d2 100644 --- a/tests/tr1/tests/cmath1/test.cpp +++ b/tests/tr1/tests/cmath1/test.cpp @@ -8,6 +8,8 @@ #include "tdefs.h" #include +#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) + static const double e = (double) 2.7182818284590452353602874713526625L; static const double ln2 = (double) 0.69314718055994530941723212145817657L; static const double pi3by4 = (double) 2.35619449019234492884698253745962716L; diff --git a/tests/tr1/tests/cmath2/test.cpp b/tests/tr1/tests/cmath2/test.cpp index ae89b5d7177..4fa5dc60422 100644 --- a/tests/tr1/tests/cmath2/test.cpp +++ b/tests/tr1/tests/cmath2/test.cpp @@ -8,6 +8,8 @@ #include "tdefs.h" #include +#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) + static const float e = (float) 2.7182818284590452353602874713526625L; static const float ln2 = (float) 0.69314718055994530941723212145817657L; static const float pi3by4 = (float) 2.35619449019234492884698253745962716L; diff --git a/tests/tr1/tests/cmath3/test.cpp b/tests/tr1/tests/cmath3/test.cpp index 9ca06e646af..81e2f1cd999 100644 --- a/tests/tr1/tests/cmath3/test.cpp +++ b/tests/tr1/tests/cmath3/test.cpp @@ -8,6 +8,8 @@ #include "tdefs.h" #include +#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) + static const long double e = 2.7182818284590452353602874713526625L; static const long double ln2 = 0.69314718055994530941723212145817657L; static const long double pi3by4 = 2.35619449019234492884698253745962716L; From f05a2b46c04fabdd9b7af32e222ce6ebe31a1767 Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Thu, 18 Jun 2020 15:31:59 +0800 Subject: [PATCH 04/10] Add new test for pow. --- .../VSO_0099869_pow_float_overflow/test.cpp | 2 +- .../tests/VSO_0553723_pow_template/env.lst | 4 ++ .../tests/VSO_0553723_pow_template/test.cpp | 58 +++++++++++++++++++ tests/tr1/tests/cmath1/test.cpp | 4 -- tests/tr1/tests/cmath2/test.cpp | 4 -- tests/tr1/tests/cmath3/test.cpp | 4 -- 6 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 tests/std/tests/VSO_0553723_pow_template/env.lst create mode 100644 tests/std/tests/VSO_0553723_pow_template/test.cpp diff --git a/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp b/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp index 32da82a4077..a4c11a09a2c 100644 --- a/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp +++ b/tests/std/tests/VSO_0099869_pow_float_overflow/test.cpp @@ -44,7 +44,7 @@ class test_std_pow_against_crt { void single(uint32_t baseCandidate) { float input = reinterpret_as(baseCandidate); - float powOut = input * input; + float powOut = static_cast(pow(input, 2)); float powfOut = powf(input, 2.0f); int powClass = fpclassify(powOut); int powfClass = fpclassify(powfOut); diff --git a/tests/std/tests/VSO_0553723_pow_template/env.lst b/tests/std/tests/VSO_0553723_pow_template/env.lst new file mode 100644 index 00000000000..19f025bd0e6 --- /dev/null +++ b/tests/std/tests/VSO_0553723_pow_template/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/VSO_0553723_pow_template/test.cpp b/tests/std/tests/VSO_0553723_pow_template/test.cpp new file mode 100644 index 00000000000..7fbb4cbcf75 --- /dev/null +++ b/tests/std/tests/VSO_0553723_pow_template/test.cpp @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include + +#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) + +int main() { + long double ld = 10.0l; + double d = 10.0; + float f = 10.0f; + long long ll = 2ll; + int i = 2; + short s = 2; + + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); +} \ No newline at end of file diff --git a/tests/tr1/tests/cmath1/test.cpp b/tests/tr1/tests/cmath1/test.cpp index 6a80901e9d2..67806452778 100644 --- a/tests/tr1/tests/cmath1/test.cpp +++ b/tests/tr1/tests/cmath1/test.cpp @@ -8,8 +8,6 @@ #include "tdefs.h" #include -#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) - static const double e = (double) 2.7182818284590452353602874713526625L; static const double ln2 = (double) 0.69314718055994530941723212145817657L; static const double pi3by4 = (double) 2.35619449019234492884698253745962716L; @@ -52,8 +50,6 @@ void test_cpp() { // test C++ header double (*pabs)(double) = &STD abs; // C++ overloads CHECK((*pabs)(-rthalf) == rthalf); - - STATIC_ASSERT(std::is_same::value); } void test_main() { // test basic workings of cmath definitions diff --git a/tests/tr1/tests/cmath2/test.cpp b/tests/tr1/tests/cmath2/test.cpp index 4fa5dc60422..90f289c80be 100644 --- a/tests/tr1/tests/cmath2/test.cpp +++ b/tests/tr1/tests/cmath2/test.cpp @@ -8,8 +8,6 @@ #include "tdefs.h" #include -#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) - static const float e = (float) 2.7182818284590452353602874713526625L; static const float ln2 = (float) 0.69314718055994530941723212145817657L; static const float pi3by4 = (float) 2.35619449019234492884698253745962716L; @@ -96,8 +94,6 @@ void test_cpp() { // test C++ header CHECK(approx((*psqrt)(2.0F), 1.0F / rthalf)); float (*ptanh)(float) = &STDx tanh; CHECK(approx((*ptanh)(-1.0F), -(e * e - 1.0F) / (e * e + 1.0F))); - - STATIC_ASSERT(std::is_same::value); } void test_main() { // test basic workings of cmath definitions diff --git a/tests/tr1/tests/cmath3/test.cpp b/tests/tr1/tests/cmath3/test.cpp index 81e2f1cd999..3907014c393 100644 --- a/tests/tr1/tests/cmath3/test.cpp +++ b/tests/tr1/tests/cmath3/test.cpp @@ -8,8 +8,6 @@ #include "tdefs.h" #include -#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) - static const long double e = 2.7182818284590452353602874713526625L; static const long double ln2 = 0.69314718055994530941723212145817657L; static const long double pi3by4 = 2.35619449019234492884698253745962716L; @@ -96,8 +94,6 @@ void test_cpp() { // test C++ header CHECK(approx((*psqrt)(2.0L), 1.0L / rthalf)); long double (*ptanh)(long double) = &STDx tanh; CHECK(approx((*ptanh)(-1.0L), -(e * e - 1.0L) / (e * e + 1.0L))); - - STATIC_ASSERT(std::is_same::value); } void test_main() { // test basic workings of cmath definitions From c64aee91da11fc27f6216eaf4a0c63b4685b37f1 Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Thu, 18 Jun 2020 15:34:29 +0800 Subject: [PATCH 05/10] Fix code format with a newline. --- tests/std/tests/VSO_0553723_pow_template/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0553723_pow_template/test.cpp b/tests/std/tests/VSO_0553723_pow_template/test.cpp index 7fbb4cbcf75..de25939325c 100644 --- a/tests/std/tests/VSO_0553723_pow_template/test.cpp +++ b/tests/std/tests/VSO_0553723_pow_template/test.cpp @@ -55,4 +55,4 @@ int main() { STATIC_ASSERT(std::is_same_v); STATIC_ASSERT(std::is_same_v); STATIC_ASSERT(std::is_same_v); -} \ No newline at end of file +} From 9d15ef1eac30d2a7a7de946ff81d918e5e081b4c Mon Sep 17 00:00:00 2001 From: Berrysoft Date: Thu, 18 Jun 2020 17:54:49 +0800 Subject: [PATCH 06/10] Rename new test to GitHub issue. --- .../{VSO_0553723_pow_template => GH_000890_pow_template}/env.lst | 0 .../{VSO_0553723_pow_template => GH_000890_pow_template}/test.cpp | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/std/tests/{VSO_0553723_pow_template => GH_000890_pow_template}/env.lst (100%) rename tests/std/tests/{VSO_0553723_pow_template => GH_000890_pow_template}/test.cpp (100%) diff --git a/tests/std/tests/VSO_0553723_pow_template/env.lst b/tests/std/tests/GH_000890_pow_template/env.lst similarity index 100% rename from tests/std/tests/VSO_0553723_pow_template/env.lst rename to tests/std/tests/GH_000890_pow_template/env.lst diff --git a/tests/std/tests/VSO_0553723_pow_template/test.cpp b/tests/std/tests/GH_000890_pow_template/test.cpp similarity index 100% rename from tests/std/tests/VSO_0553723_pow_template/test.cpp rename to tests/std/tests/GH_000890_pow_template/test.cpp From 95ab352ea9dab1081322fc3cd924cd586fe9580d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 23 Jun 2020 14:17:05 -0700 Subject: [PATCH 07/10] Add new test to tests/std/test.lst. --- tests/std/test.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/std/test.lst b/tests/std/test.lst index e0c06acf279..4959069e96d 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -159,6 +159,7 @@ tests\GH_000457_system_error_message tests\GH_000545_include_compare tests\GH_000685_condition_variable_any tests\GH_000690_overaligned_function +tests\GH_000890_pow_template tests\LWG3018_shared_ptr_function tests\P0024R2_parallel_algorithms_adjacent_difference tests\P0024R2_parallel_algorithms_adjacent_find From 78ac59fc3559d175d51e323e7269aeff3ae0d1dd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 23 Jun 2020 15:50:43 -0700 Subject: [PATCH 08/10] Fix test: pow(float, float) is float. --- tests/std/tests/GH_000890_pow_template/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/GH_000890_pow_template/test.cpp b/tests/std/tests/GH_000890_pow_template/test.cpp index de25939325c..dc90ec0ecfa 100644 --- a/tests/std/tests/GH_000890_pow_template/test.cpp +++ b/tests/std/tests/GH_000890_pow_template/test.cpp @@ -30,7 +30,7 @@ int main() { STATIC_ASSERT(std::is_same_v); STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); + STATIC_ASSERT(std::is_same_v); STATIC_ASSERT(std::is_same_v); STATIC_ASSERT(std::is_same_v); STATIC_ASSERT(std::is_same_v); From 076db1b60c2425f1decafd25dabf8c35869c3b72 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 23 Jun 2020 15:56:44 -0700 Subject: [PATCH 09/10] Tiny style change: initializing long long with 2 is fine. --- tests/std/tests/GH_000890_pow_template/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/GH_000890_pow_template/test.cpp b/tests/std/tests/GH_000890_pow_template/test.cpp index dc90ec0ecfa..a569be84e82 100644 --- a/tests/std/tests/GH_000890_pow_template/test.cpp +++ b/tests/std/tests/GH_000890_pow_template/test.cpp @@ -10,7 +10,7 @@ int main() { long double ld = 10.0l; double d = 10.0; float f = 10.0f; - long long ll = 2ll; + long long ll = 2; int i = 2; short s = 2; From c899a4946523797cb0eff4844f5cf2e07bd63f97 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 23 Jun 2020 16:31:24 -0700 Subject: [PATCH 10/10] Follow the COMPILE-ONLY convention in GH_000890_pow_template. --- .../std/tests/GH_000890_pow_template/test.cpp | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/tests/std/tests/GH_000890_pow_template/test.cpp b/tests/std/tests/GH_000890_pow_template/test.cpp index a569be84e82..a9967b3b6e8 100644 --- a/tests/std/tests/GH_000890_pow_template/test.cpp +++ b/tests/std/tests/GH_000890_pow_template/test.cpp @@ -6,53 +6,53 @@ #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) -int main() { - long double ld = 10.0l; - double d = 10.0; - float f = 10.0f; - long long ll = 2; - int i = 2; - short s = 2; - - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); - STATIC_ASSERT(std::is_same_v); -} +int main() {} // COMPILE-ONLY + +constexpr long double ld = 10.0l; +constexpr double d = 10.0; +constexpr float f = 10.0f; +constexpr long long ll = 2; +constexpr int i = 2; +constexpr short s = 2; + +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); + +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); + +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); + +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); + +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); + +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v); +STATIC_ASSERT(std::is_same_v);