[gcc/devel/c++-modules] libstdc++: Fix deleted overload of __absu(bool)

Nathan Sidwell nathan@gcc.gnu.org
Thu Sep 3 14:30:41 GMT 2020


https://gcc.gnu.org/g:0789600c597ff1f8ac06e84ffb584c853d1675d1

commit 0789600c597ff1f8ac06e84ffb584c853d1675d1
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Aug 29 18:24:08 2020 +0100

    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.

Diff:
---
 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<typename _Up> void __absu(bool) = delete;
 
   // GCD implementation
   template<typename _Tp>
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" }


More information about the Libstdc++-cvs mailing list