From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3863 invoked by alias); 20 Feb 2003 18:36:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3836 invoked by uid 71); 20 Feb 2003 18:36:00 -0000 Resent-Date: 20 Feb 2003 18:36:00 -0000 Resent-Message-ID: <20030220183600.3835.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, bkoz@redhat.com Received: (qmail 2023 invoked by uid 48); 20 Feb 2003 18:33:55 -0000 Message-Id: <20030220183355.2022.qmail@sources.redhat.com> Date: Thu, 20 Feb 2003 18:36:00 -0000 From: bkoz@redhat.com Reply-To: bkoz@redhat.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/9780: issues with time_get, time_put not being tied to correct _punct facet. X-SW-Source: 2003-02/txt/msg01011.txt.bz2 List-Id: >Number: 9780 >Category: libstdc++ >Synopsis: issues with time_get, time_put not being tied to correct _punct facet. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Feb 20 18:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: bkoz@redhat.com >Release: gcc-3.2, gcc-3.3, gcc-3.4 not applicable to releases before gcc-3.2 >Organization: >Environment: x86/linux, gnu locale model >Description: See: http://gcc.gnu.org/ml/libstdc++/2003-01/msg00363.html And followups. Seems like an issue with __timepunct not really being used correctly with time_get and time_put facets. When fixing this, please double check the other facets for this behavior as well. Likely candidates are money_put, money_get, num_get, num_put, etc: anything that uses a *_punct facet for data collection. >How-To-Repeat: #include #include int main () { const std::locale loc ("de_DE"); const std::time_put &tpc = std::use_facet >(loc); std::tm t = std::tm (); for (t.tm_wday = 0; t.tm_wday != 7; ++t.tm_wday) tpc.put (std::cout.rdbuf (), std::cout, ' ', &t, 'A') = '\n'; } or #include #include int main (int argc, const char *argv[]) { const std::locale l1 (argc > 1 ? argv [1] : ""); const std::locale l2 (argc > 2 ? argv [2] : ""); const std::locale l1_l2 = std::locale (std::locale (std::locale::classic (), &std::use_facet >(l1)), &std::use_facet >(l2)); const std::time_get &tg = std::use_facet >(l1_l2); const std::time_put &tp = std::use_facet >(l1_l2); std::tm t = std::tm (); std::ios::iostate err = std::ios::goodbit; // benign but unnecessary // std::cin.imbue (l1_l2); // std::cout.imbue (l1_l2); tg.get_weekday (std::cin.rdbuf (), std::istreambuf_iterator(), std::cin, err, &t); if (err & std::ios::failbit) return 1; tp.put (std::cout.rdbuf (), std::cout, ' ', &t, 'A') = '\n'; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: