<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Jun 28, 2019 at 7:45 AM Steven Lengieza via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org">libcxx-dev@lists.llvm.org</a>> wrote:<br>Hi,<br><br>I am using the following lines of code to get a locale-specific decimal point however, it is causing a crash. I am unable to find any libc++ specific documentation for using std::locale but according to the STL an empty string should always be a valid locale. Does this indicate a bug in the libc++ implementation or are we doing something wrong?<br><br> <br>      std::locale my_locale("");<br>      const std::moneypunct<char>& mp =<br>          std::use_facet<std::moneypunct<char>>(my_locale);<br>      text += mp.decimal_point();<br></blockquote><div><br></div><div>When I paste that into a program, add the correct includes, declare text as a string, it works fine. (and prints '.')</div><div>What version of clang are you using, what system, what C library, etc?</div><div><br></div><div>#include <locale><br>#include <iostream><br>#include <string><br><br>int main () { <br>      std::locale my_locale("");<br>      const std::moneypunct<char>& mp =<br>          std::use_facet<std::moneypunct<char>>(my_locale);<br>      std::string text;<br>      text += mp.decimal_point();<br>std::cout << "'" << text << "'" << std::endl;<br>}<br></div><div><br></div><div>-- Marshall</div><div><br></div></div></div>