1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <iomanip> 10 11 // quoted 12 13 // UNSUPPORTED: c++03, c++11 14 15 #include <iomanip> 16 #include <sstream> 17 #include <string> 18 #include <cassert> 19 20 #include "test_macros.h" 21 22 // Test that mismatches between strings and wide streams are diagnosed 23 round_trip(const char * p)24void round_trip ( const char *p ) { 25 std::wstringstream ss; 26 ss << std::quoted(p); // expected-error {{invalid operands to binary expression}} 27 std::string s; 28 ss >> std::quoted(s); // expected-error {{invalid operands to binary expression}} 29 } 30 main(int,char **)31int main(int, char**) { 32 round_trip("Hi Mom"); 33 } 34