Details

[Home]

Issue of the Implementation # S0742

Brief

locale(locale const&, char const*, locale::category) creates broken locale

Detailed Description

Constructor locale(locale const&, char cosnt*, locale::category) creates locale for which facets, corresponding to the category, do not work. Example below cause crach on some systems(e.g. SLES10, Open SUSE 11, Ubuntu 8.10).

Problem location(s) in the standard

Linux Standard Base C++ Specification 3.2, Chapter 9. Libraries, 9.1. Interfaces for libstdcxx that refers ISO/IEC 14882: 2003 Programming languages --C++, section 22.1.1.2

Example

#include <locale>
using namespace std;

int main()
{
    locale loc(locale("C"), "en_US", locale::monetary);
    use_facet<moneypunct<char> >(loc).grouping();
    return 0;
}

Component

libstdc++

Accepted

GCC Bugzilla 40712

Status

Fixed in gcc-4.5.0

[Home]