]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 26_numerics / gcd / gcd_neg.cc
CommitLineData
a945c346 1// Copyright (C) 2016-2024 Free Software Foundation, Inc.
f2e79496
JW
2//
3// This file is part of the GNU ISO C++ Library. This library is free
4// software; you can redistribute it and/or modify it under the
5// terms of the GNU General Public License as published by the
6// Free Software Foundation; either version 3, or (at your option)
7// any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License along
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
17
7b936140 18// { dg-do compile { target c++17 } }
f2e79496
JW
19
20#include <numeric>
21
22void
23test01()
24{
25 std::gcd(true, 1); // { dg-error "from here" }
26 std::gcd(1, true); // { dg-error "from here" }
27 std::gcd(true, true); // { dg-error "from here" }
13545f19
VV
28 std::gcd<const bool, int>(true, 1); // { dg-error "from here" }
29 std::gcd<int, const bool>(1, true); // { dg-error "from here" }
30 std::gcd<const bool, const bool>(true, true); // { dg-error "from here" }
31 std::gcd<const bool&, int>(true, 1); // { dg-error "from here" }
32 std::gcd<int, const bool&>(1, true); // { dg-error "from here" }
33 std::gcd<const bool&, const bool&>(true, true); // { dg-error "from here" }
34 std::gcd<const volatile bool, int>(true, 1); // { dg-error "from here" }
35 std::gcd<int, const volatile bool>(1, true); // { dg-error "from here" }
36 std::gcd<const volatile bool,
37 const volatile bool>(true, true); // { dg-error "from here" }
38 std::gcd<volatile bool, int>(true, 1); // { dg-error "from here" }
39 std::gcd<int, volatile bool>(1, true); // { dg-error "from here" }
40 std::gcd<volatile bool,
41 volatile bool>(true, true); // { dg-error "from here" }
f2e79496
JW
42 std::gcd(0.1, 1); // { dg-error "from here" }
43 std::gcd(1, 0.1); // { dg-error "from here" }
44 std::gcd(0.1, 0.1); // { dg-error "from here" }
13545f19 45 std::gcd<const int&, const int&>(0.1, 0.1); // { dg-error "from here" }
f2e79496
JW
46}
47
671970a5
JW
48// { dg-error "must be integers" "" { target *-*-* } 0 }
49// { dg-error "must not be bool" "" { target *-*-* } 0 }
50// These prunes could be removed if a fix for PR c++/96286 stops them.
0789600c 51// { dg-prune-output "deleted function" }
82db1a42 52// { dg-prune-output "incomplete type .*make_unsigned" }
671970a5
JW
53// { dg-prune-output "does not have integral type" }
54// { dg-prune-output "non-integral type" }
55// { dg-prune-output "invalid specialization" }