Debian Codegraph @

libstdc++-v3/testsuite/20_util/to_chars/requirements.cc

raw
1 // Copyright (C) 2017-2025 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 // { dg-require-normal-namespace "" }
20
21 #include <charconv>
22
23 namespace std
24 {
25 struct to_chars_result;
26
27 char* to_chars_result::*pm2 = &to_chars_result::ptr;
28 errc to_chars_result::*pm1 = &to_chars_result::ec;
29
30 to_chars_result (*f1)(char*, char*, char, int) = &to_chars;
31 to_chars_result (*f2)(char*, char*, signed char, int) = &to_chars;
32 to_chars_result (*f3)(char*, char*, unsigned char, int) = &to_chars;
33 to_chars_result (*f4)(char*, char*, signed short, int) = &to_chars;
34 to_chars_result (*f5)(char*, char*, unsigned short, int) = &to_chars;
35 to_chars_result (*f6)(char*, char*, signed int, int) = &to_chars;
36 to_chars_result (*f7)(char*, char*, unsigned int, int) = &to_chars;
37 to_chars_result (*f8)(char*, char*, signed long, int) = &to_chars;
38 to_chars_result (*f9)(char*, char*, unsigned long, int) = &to_chars;
39 to_chars_result (*f10)(char*, char*, signed long long, int) = &to_chars;
40 to_chars_result (*f11)(char*, char*, unsigned long long, int) = &to_chars;
41 }
42
43 void bind()
44 {
45 char buf[1];
46 auto [p, e] = std::to_chars(buf, buf + 1, 1, 10);
47 char** pa = &p;
48 std::errc* ea = &e;
49 }