integral.bool.fail.cpp (877B)
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 // from_chars_result from_chars(const char* first, const char* last, 16 // Integral& value, int base = 10) 17 // 18 // Integral cannot be bool. 19 20 #include <charconv> 21 22 int main() 23 { 24 using std::from_chars; 25 char buf[] = "01001"; 26 bool lv; 27 28 from_chars(buf, buf + sizeof(buf), lv); // expected-error {{call to deleted function}} 29 from_chars(buf, buf + sizeof(buf), lv, 16); // expected-error {{call to deleted function}} 30 }