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.
This commit is contained in:
Jonathan Wakely 2020-08-29 18:24:08 +01:00
parent cd0233527a
commit 0789600c59
3 changed files with 3 additions and 1 deletions

View 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>

View 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" }

View 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" }