]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 26_numerics / lcm / lcm_neg.cc
1 // Copyright (C) 2016-2022 Free Software Foundation, Inc.
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
18 // { dg-do compile { target c++17 } }
19
20 #include <numeric>
21
22 void
23 test01()
24 {
25 std::lcm(true, 1); // { dg-error "from here" }
26 std::lcm(1, true); // { dg-error "from here" }
27 std::lcm(true, true); // { dg-error "from here" }
28 std::lcm<const bool, int>(true, 1); // { dg-error "from here" }
29 std::lcm<int, const bool>(1, true); // { dg-error "from here" }
30 std::lcm<const bool, const bool>(true, true); // { dg-error "from here" }
31 std::lcm<const bool&, int>(true, 1); // { dg-error "from here" }
32 std::lcm<int, const bool&>(1, true); // { dg-error "from here" }
33 std::lcm<const bool&, const bool&>(true, true); // { dg-error "from here" }
34 std::lcm<const volatile bool, int>(true, 1); // { dg-error "from here" }
35 std::lcm<int, const volatile bool>(1, true); // { dg-error "from here" }
36 std::lcm<const volatile bool,
37 const volatile bool>(true, true); // { dg-error "from here" }
38 std::lcm<volatile bool, int>(true, 1); // { dg-error "from here" }
39 std::lcm<int, volatile bool>(1, true); // { dg-error "from here" }
40 std::lcm<volatile bool,
41 volatile bool>(true, true); // { dg-error "from here" }
42 std::lcm(0.1, 1); // { dg-error "from here" }
43 std::lcm(1, 0.1); // { dg-error "from here" }
44 std::lcm(0.1, 0.1); // { dg-error "from here" }
45 std::lcm<const int&, const int&>(0.1, 0.1); // { dg-error "from here" }
46 }
47
48 // { dg-error "must be integers" "" { target *-*-* } 183 }
49 // { dg-error "must be integers" "" { target *-*-* } 184 }
50 // { dg-error "must not be bool" "" { target *-*-* } 185 }
51 // { dg-error "must not be bool" "" { target *-*-* } 186 }
52 // { dg-prune-output "deleted function" }
53 // { dg-prune-output "incomplete type .*make_unsigned" }