32 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <iomanip>10 11// quoted12 13// UNSUPPORTED: c++03, c++1114// XFAIL: no-wide-characters15 16#include <iomanip>17#include <sstream>18#include <string>19 20// Test that mismatches between strings and wide streams are diagnosed21 22void round_trip ( const char *p ) {23 std::wstringstream ss;24 ss << std::quoted(p); // expected-error {{invalid operands to binary expression}}25 std::string s;26 ss >> std::quoted(s); // expected-error {{invalid operands to binary expression}}27}28 29void f() {30 round_trip("Hi Mom");31}32