From 0789600c597ff1f8ac06e84ffb584c853d1675d1 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 29 Aug 2020 18:24:08 +0100 Subject: [PATCH] libstdc++: Fix deleted overload of __absu(bool) libstdc++-v3/ChangeLog: * include/std/numeric (__detail::__absu(bool)): Make deleted function a function template, so it will be chosen for calls with an explicit template argument list. * testsuite/26_numerics/gcd/gcd_neg.cc: Add dg-prune-output. * testsuite/26_numerics/lcm/lcm_neg.cc: Likewise. --- libstdc++-v3/include/std/numeric | 2 +- libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc | 1 + libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric index 8f2ed5c6a5e..bd70a52019b 100644 --- a/libstdc++-v3/include/std/numeric +++ b/libstdc++-v3/include/std/numeric @@ -95,7 +95,7 @@ namespace __detail return __val < 0 ? -(_Up)__val : (_Up)__val; } - void __absu(bool) = delete; + template void __absu(bool) = delete; // GCD implementation template diff --git a/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc b/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc index 707148a2670..2e56bc650a7 100644 --- a/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc +++ b/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc @@ -50,4 +50,5 @@ test01() // { dg-error "must be integers" "" { target *-*-* } 135 } // { dg-error "must not be bool" "" { target *-*-* } 136 } // { dg-error "must not be bool" "" { target *-*-* } 137 } +// { dg-prune-output "deleted function" } // { dg-prune-output "incomplete type .*make_unsigned" } diff --git a/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc b/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc index d4aa6b59da8..9e83fdcae0b 100644 --- a/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc +++ b/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc @@ -50,4 +50,5 @@ test01() // { dg-error "must be integers" "" { target *-*-* } 149 } // { dg-error "must not be bool" "" { target *-*-* } 150 } // { dg-error "must not be bool" "" { target *-*-* } 151 } +// { dg-prune-output "deleted function" } // { dg-prune-output "incomplete type .*make_unsigned" } -- 2.30.2