From d0d99fc6b6c4f1c3fa8a9427f461103c78ab457b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 18 Oct 2024 12:02:45 +0100 Subject: libstdc++: Improve 26_numerics/headers/cmath/types_std_c++0x_neg.cc This test checks that the special functions in are not declared prior to C++17. But we can remove the target selector and allow it to be tested for C++17 and later, and add target selectors to the individual dg-error directives instead. Also rename the test to match what it actually tests. libstdc++-v3/ChangeLog: * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Move to ... * testsuite/26_numerics/headers/cmath/specfun_c++17.cc: here and adjust test to be valid for all -std dialects. --- .../26_numerics/headers/cmath/specfun_c++17.cc | 49 ++++++++++++++++++++++ .../headers/cmath/types_std_c++0x_neg.cc | 48 --------------------- 2 files changed, 49 insertions(+), 48 deletions(-) create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/specfun_c++17.cc delete mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/specfun_c++17.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/specfun_c++17.cc new file mode 100644 index 0000000..efb60ea --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/specfun_c++17.cc @@ -0,0 +1,49 @@ +// { dg-do compile } + +// Copyright (C) 2007-2024 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +namespace gnu +{ + // C++17 additions from TR1. + using std::assoc_laguerre; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::assoc_legendre; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::beta; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::comp_ellint_1; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::comp_ellint_2; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::comp_ellint_3; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::cyl_bessel_i; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::cyl_bessel_j; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::cyl_bessel_k; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::cyl_neumann; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::ellint_1; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::ellint_2; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::ellint_3; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::expint; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::hermite; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::laguerre; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::legendre; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::riemann_zeta; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::sph_bessel; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::sph_legendre; // { dg-error "has not been declared" "" { target { ! c++17 } } } + using std::sph_neumann; // { dg-error "has not been declared" "" { target { ! c++17 } } } + // These two were in TR1 but not added to C++17. + using std::conf_hyperg; // { dg-error "has not been declared" } + using std::hyperg; // { dg-error "has not been declared" } +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc deleted file mode 100644 index 977f800..0000000 --- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc +++ /dev/null @@ -1,48 +0,0 @@ -// { dg-do compile { target { ! c++17 } } } - -// Copyright (C) 2007-2024 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -namespace gnu -{ - // C++11 changes from TR1. - using std::assoc_laguerre; // { dg-error "has not been declared" } - using std::assoc_legendre; // { dg-error "has not been declared" } - using std::beta; // { dg-error "has not been declared" } - using std::comp_ellint_1; // { dg-error "has not been declared" } - using std::comp_ellint_2; // { dg-error "has not been declared" } - using std::comp_ellint_3; // { dg-error "has not been declared" } - using std::conf_hyperg; // { dg-error "has not been declared" } - using std::cyl_bessel_i; // { dg-error "has not been declared" } - using std::cyl_bessel_j; // { dg-error "has not been declared" } - using std::cyl_bessel_k; // { dg-error "has not been declared" } - using std::cyl_neumann; // { dg-error "has not been declared" } - using std::ellint_1; // { dg-error "has not been declared" } - using std::ellint_2; // { dg-error "has not been declared" } - using std::ellint_3; // { dg-error "has not been declared" } - using std::expint; // { dg-error "has not been declared" } - using std::hermite; // { dg-error "has not been declared" } - using std::hyperg; // { dg-error "has not been declared" } - using std::laguerre; // { dg-error "has not been declared" } - using std::legendre; // { dg-error "has not been declared" } - using std::riemann_zeta; // { dg-error "has not been declared" } - using std::sph_bessel; // { dg-error "has not been declared" } - using std::sph_legendre; // { dg-error "has not been declared" } - using std::sph_neumann; // { dg-error "has not been declared" } -} -- cgit v1.1