aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-05-12 11:34:01 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2025-05-15 16:33:16 +0100
commit6dbcbd96e90159e87a339b98192b7e6e5534b0d7 (patch)
treedcf3d3c26e9877ba7bb55b7cb9190e91ecf80c8b /libstdc++-v3/testsuite
parent87d0daab1ec9d5c901295e8045cbd67f80b2fa23 (diff)
downloadgcc-6dbcbd96e90159e87a339b98192b7e6e5534b0d7.zip
gcc-6dbcbd96e90159e87a339b98192b7e6e5534b0d7.tar.gz
gcc-6dbcbd96e90159e87a339b98192b7e6e5534b0d7.tar.bz2
libstdc++: Deprecate non-standard std::fabs(const complex<T>&) [PR120235]
There was an overload of fabs for std::complex in TR1 and in some C++0x drafts, but it was removed from the working draft by LWG 595. Since we've been providing it for decades we should deprecate it before removing it. libstdc++-v3/ChangeLog: PR libstdc++/120235 * doc/html/*: Regenerate. * doc/xml/manual/evolution.xml: Document deprecation. * include/std/complex: Replace references to TR1 subclauses with corresponding C++11 subclauses. (fabs): Add deprecated attribute. * testsuite/26_numerics/complex/fabs_neg.cc: New test. Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/fabs_neg.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/fabs_neg.cc b/libstdc++-v3/testsuite/26_numerics/complex/fabs_neg.cc
new file mode 100644
index 0000000..36c483e
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/complex/fabs_neg.cc
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// Bug 120235 std::fabs(const std::complex<T>&) should not be defined
+
+#include <complex>
+
+void test_pr120235(std::complex<double> c)
+{
+ (void) std::fabs(c);
+ // { dg-error "no matching function" "" { target c++98_only } 8 }
+ // { dg-warning "deprecated: use 'std::abs'" "" { target c++11 } 8 }
+}
+
+// { dg-prune-output "no type named '__type'" }