From patchwork Tue Jun 10 19:24:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 358193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 749C21400B8 for ; Wed, 11 Jun 2014 05:26:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ACioD5G3GAraj+xU6zMoyzuT/NwPm0rkp2j/H2docPscCh8DSr 4ZFP5GcdouE9L7yPsQNpQ6EcXebYsnCPREguWsannulNuwL89cgCqdVzw5QFpX7H G6SdLoeWXHTByQOiz2QX6L7wpgYyFTm4fPfE5mTIXIrdZl3VIv9AErTWw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=kxpTS2xHbuQ/YDwh8YHz/XiGDOs=; b=cOOPdT2skG7s4KAGmSYu pdlK6pVsfzEN2qSyU1iqjQxBATkhop3hI4CoXKlV+2SqeG5+xgDi93IZZneA5wpP uAT4WPqKMUBm8zd1ggqq2oG7thSfJgg19OrUI2MTuK7ingD5Fw3Jaxp4Y4yOH1mf q2OjrRkpnrMnPy82QITy+l0= Received: (qmail 19881 invoked by alias); 10 Jun 2014 19:25:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 19856 invoked by uid 89); 10 Jun 2014 19:25:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jun 2014 19:25:45 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WuRfw-0006is-Gf from Maciej_Rozycki@mentor.com ; Tue, 10 Jun 2014 12:25:40 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 10 Jun 2014 12:25:40 -0700 Received: from localhost (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Tue, 10 Jun 2014 20:25:38 +0100 Date: Tue, 10 Jun 2014 20:24:11 +0100 From: "Maciej W. Rozycki" To: CC: Subject: [PATCH] libstdc++/testsuite: Fix a 4402.cc compilation error Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Hi, I needed some diagnostics to sort out a failure observed on one of our targets in 27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc in the libstdc++ test suite and defined the `TEST_NUMPUT_VERBOSE' macro referred there. That resulted in a compilation error like below: .../libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc: In function 'void test02()': .../libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc:48:22: error: no match for 'operator<<' (operand types are 'std::basic_ostream' and 'std::basic_ostringstream::__string_type {aka std::basic_string}') cout << "result: " << os.str() << endl; ^ The reason is cout is a plain character stream and does not accept wide characters. An obvious fix is below, verified to produce correct output. OK to apply? 2014-06-10 Maciej W. Rozycki libstdc++-v3/ * testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc (test02) [TEST_NUMPUT_VERBOSE]: Use `wcout' rather than `cout'. Maciej gcc-test-libstdcxx-4402.patch Index: gcc-fsf-trunk-quilt/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc =================================================================== --- gcc-fsf-trunk-quilt.orig/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc 2014-05-16 15:58:07.177522688 +0100 +++ gcc-fsf-trunk-quilt/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc 2014-05-19 04:49:29.168978165 +0100 @@ -42,8 +42,8 @@ test02() wchar_t largebuf[512]; swprintf(largebuf, 512, L"%.*Le", prec, val); #ifdef TEST_NUMPUT_VERBOSE - cout << "expect: " << largebuf << endl; - cout << "result: " << os.str() << endl; + wcout << "expect: " << largebuf << endl; + wcout << "result: " << os.str() << endl; #endif VERIFY( os && os.str() == largebuf ); @@ -58,8 +58,8 @@ test02() swprintf(largebuf, 512, L"%.*f", 3, val2); #ifdef TEST_NUMPUT_VERBOSE - cout << "expect: " << largebuf << endl; - cout << "result: " << os2.str() << endl; + wcout << "expect: " << largebuf << endl; + wcout << "result: " << os2.str() << endl; #endif VERIFY( os2 && os2.str() == largebuf ); }