integral.bool.fail.cpp (849B)
1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // UNSUPPORTED: c++98, c++03, c++11 11 // <charconv> 12 13 // In 14 // 15 // to_chars_result to_chars(char* first, char* last, Integral value, 16 // int base = 10) 17 // 18 // Integral cannot be bool. 19 20 #include <charconv> 21 22 int main() 23 { 24 using std::to_chars; 25 char buf[10]; 26 bool lv = true; 27 28 to_chars(buf, buf + sizeof(buf), false); // expected-error {{call to deleted function}} 29 to_chars(buf, buf + sizeof(buf), lv, 16); // expected-error {{call to deleted function}} 30 }