[libcxx] r194725 - Fixed bug in quoted strings implementation. Added test to be sure. Thanks to Peter Sommerlad for the report (and suggested fix)

Marshall Clow mclow.lists at gmail.com
Thu Nov 14 12:01:39 PST 2013


Author: marshall
Date: Thu Nov 14 14:01:38 2013
New Revision: 194725

URL: http://llvm.org/viewvc/llvm-project?rev=194725&view=rev
Log:
Fixed bug in quoted strings implementation. Added test to be sure. Thanks to Peter Sommerlad for the report (and suggested fix)

Modified:
    libcxx/trunk/include/iomanip
    libcxx/trunk/test/input.output/iostream.format/quoted.manip/quoted.pass.cpp

Modified: libcxx/trunk/include/iomanip
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/iomanip?rev=194725&r1=194724&r2=194725&view=diff
==============================================================================
--- libcxx/trunk/include/iomanip (original)
+++ libcxx/trunk/include/iomanip Thu Nov 14 14:01:38 2013
@@ -14,6 +14,8 @@
 /*
     iomanip synopsis
 
+namespace std {
+
 // types T1, T2, ... are unspecified implementation types
 T1 resetiosflags(ios_base::fmtflags mask);
 T2 setiosflags (ios_base::fmtflags mask);
@@ -604,7 +606,7 @@ basic_ostream<_CharT, _Traits>& operator
         basic_ostream<_CharT, _Traits>& __os, 
         const __quoted_proxy<_CharT, _Traits, _Allocator> & __proxy)
 {
-    return __quoted_output (__os, __proxy.string.cbegin (), __proxy.string.cend (), __proxy.__delim, __proxy.__escape);
+    return __quoted_output (__os, __proxy.__string.cbegin (), __proxy.__string.cend (), __proxy.__delim, __proxy.__escape);
 }
 
 //  extractor for non-const basic_string& proxies

Modified: libcxx/trunk/test/input.output/iostream.format/quoted.manip/quoted.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostream.format/quoted.manip/quoted.pass.cpp?rev=194725&r1=194724&r2=194725&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostream.format/quoted.manip/quoted.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostream.format/quoted.manip/quoted.pass.cpp Thu Nov 14 14:01:38 2013
@@ -18,6 +18,16 @@
 
 #if _LIBCPP_STD_VER > 11
 
+void both_ways ( const char *p ) {
+	std::string str(p);
+	auto q = std::quoted(s);
+
+    std::stringstream ss;
+    bool skippingws = is_skipws ( &ss );
+	ss << q;
+	ss >> q;
+    }
+
 bool is_skipws ( const std::istream *is ) {
     return ( is->flags() & std::ios_base::skipws ) != 0;
     }
@@ -140,6 +150,8 @@ std::wstring unquote ( const wchar_t *p,
 
 int main()
 {
+    both_ways ( "" );   // This is a compilation check
+
     round_trip    (  "" );
     round_trip_ws (  "" );
     round_trip_d  (  "", 'q' );





More information about the cfe-commits mailing list