This defines the feature test macro when uselocale is available, because the floating-point std::from_chars support currently depends on that. Co-authored-by: Jakub Jelinek libstdc++-v3/ChangeLog: PR libstdc++/100146 * include/std/charconv (__cpp_lib_to_chars): Define conditionally. * include/std/version (__cpp_lib_to_chars): Likewise.. * testsuite/20_util/from_chars/4.cc: Only check feature test macro, not _GLIBCXX_HAVE_USELOCALE. * testsuite/20_util/from_chars/5.cc: Likewise. * testsuite/20_util/from_chars/6.cc: Likewise. * testsuite/20_util/to_chars/long_double.cc: Likewise. Tested x86_64-linux. Committed to trunk. I'll also backport to gcc-11.