libstdc++: Fix deleted overload of __absu(bool)
authorJonathan Wakely <jwakely@redhat.com>
Sat, 29 Aug 2020 17:24:08 +0000 (18:24 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 29 Aug 2020 17:24:08 +0000 (18:24 +0100)
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
libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc
libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc

index 8f2ed5c6a5e879083ee7cbcf47d49a7f703bfb91..bd70a52019b84a6e0a18e68e7adc09d071bd197d 100644 (file)
@@ -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>
index 707148a267043c4a71adf620e24566e22457d6c0..2e56bc650a75f13d1017d814ae4094c15a83f43f 100644 (file)
@@ -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" }
index d4aa6b59da8ed6e92b0c8e07f8d6b2612fff51b0..9e83fdcae0b640b8fe6c45a883c2db689c841d9f 100644 (file)
@@ -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" }