[ https://issues.apache.org/jira/browse/STDCXX-680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586200#action_12586200 ] Martin Sebor commented on STDCXX-680: ------------------------------------- Test case: {noformat} $ cat t.cpp && gmake t && LC_ALL=en_US ./t #include #include struct MyNumpunct: std::numpunct { }; struct MyNumpunctByname: std::numpunct { }; int main () { const std::locale classic (std::locale::classic ()); const std::locale named (""); assert (std::has_facet >(classic)); assert (!std::has_facet(classic)); assert (!std::has_facet >(classic)); assert (!std::has_facet(classic)); if (named != classic) { assert (std::has_facet >(named)); assert (!std::has_facet(named)); assert (std::has_facet >(named)); assert (!std::has_facet(named)); } } xlCcore -c -I/amd/devco/sebor/stdcxx/include/ansi -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-xlC-9.0-8d/include -I/amd/devco/sebor/stdcxx/examples/include -O -qtemplateregistry=t.ti t.cpp xlCcore t.o -o t -I/amd/devco/sebor/stdcxx/include/ansi -liconv -brtl -L/build/sebor/stdcxx-xlC-9.0-8d/lib -Wl,-bsvr4,-R/build/sebor/stdcxx-xlC-9.0-8d/lib -lstd8d -lm -qtemplateregistry=t.ti Assertion failed: !std::has_facet(classic), file t.cpp, line 13 IOT/Abort trap (core dumped) {noformat} > use_facet and has_facet are unreliable unless dynamic_cast is available > ----------------------------------------------------------------------- > > Key: STDCXX-680 > URL: https://issues.apache.org/jira/browse/STDCXX-680 > Project: C++ Standard Library > Issue Type: Bug > Components: 22. Localization > Affects Versions: 4.2.0 > Reporter: Travis Vitek > > The function that is called by has_facet<>() and use_facet<>() uses _RWSTD_DYNAMIC_CAST in an attempt to check that the returned locale facet is of the requested type. Unfortunately, if RTTI is not supported or enabled, that cast becomes unreliable. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.