Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 44853 invoked from network); 7 Sep 2007 14:47:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Sep 2007 14:47:54 -0000 Received: (qmail 63113 invoked by uid 500); 7 Sep 2007 14:47:48 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 63097 invoked by uid 500); 7 Sep 2007 14:47:48 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 63086 invoked by uid 99); 7 Sep 2007 14:47:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2007 07:47:48 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2007 14:49:15 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 139AC714208 for ; Fri, 7 Sep 2007 07:47:31 -0700 (PDT) Message-ID: <17403081.1189176451076.JavaMail.jira@brutus> Date: Fri, 7 Sep 2007 07:47:31 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Updated: (STDCXX-307) std::streambuf::imbue() stores locale when it shouldn't In-Reply-To: <29891715.1165624760975.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Sebor updated STDCXX-307: -------------------------------- Fix Version/s: 4.2.1 Scheduled for 4.2.1. > std::streambuf::imbue() stores locale when it shouldn't > ------------------------------------------------------- > > Key: STDCXX-307 > URL: https://issues.apache.org/jira/browse/STDCXX-307 > Project: C++ Standard Library > Issue Type: Bug > Components: 27. Input/Output > Affects Versions: 4.1.2, 4.1.3 > Environment: all > Reporter: Martin Sebor > Fix For: 4.2.1 > > > According to 27.5.2.4.1 [streambuf.virt.locales], p3, the default behavior of std::streambuf::imbue() is to do nothing. The program below detects > whether the function stores the locale passed to it (it's not expected to). When compiled against the latest trunk the program abots at runtime > indicating that the function does, in fact, store the locale, contrary to the requirement. > $ cat z.cpp && make z && ./z > #include > #include > #include > struct MyFacet: std::locale::facet { static std::locale::id id; }; > std::locale::id MyFacet::id; > int main () > { > struct MyBuf: std::streambuf { > void imbue (const std::locale &loc) { > std::streambuf::imbue (loc); > } > } buf; > const std::locale loc (buf.getloc (), new MyFacet); > assert (std::has_facet(loc)); > assert (!std::has_facet(buf.getloc ())); > buf.imbue (loc); > assert (!std::has_facet(buf.getloc ())); > } > gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long z.cpp > gcc z.o -o z -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm > Assertion failed: !std::has_facet(buf.getloc ()), file z.cpp, line 23 > Abort (core dumped) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.