Hi Jonathan,
On 3 October 2017 at 16:31, Jonathan Wakely <jwakely@redhat.com> wrote:
On 02/10/17 15:13 +0100, Jonathan Wakely wrote:
+#ifndef _GLIBCXX_CHARCONV
+#define _GLIBCXX_CHARCONV 1
+
+#pragma GCC system_header
+
+#if __cplusplus >= 201402L
+
+#include <type_traits>
+#include <limits>
+#include <cctype>
+#include <bits/error_constants.h> // for std::errc
I forgot to mention that I've made this header work for C++14 not just
C++17. I
did this for similar reasons as we make some C++17 things available for
-std=gnu++11 and -std=gnu++14:
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
But in this case <charconv> is a completely new header so we don't have to
limit it to -std=gnu++NN modes only. The new functions won't pollute
namespace
std unless the new header gets included, which strictly-conforming C++14
code
won't do anyway.
Sorry for the delay, I'm still catching up after Linaro Connect.
I've noticed that one of the new tests (20_util/to_chars/1.cc)
fails to compile on ARM and AArch64 bare-metal targets (with Newlib).
That is, arm-none-eabi and aarch64-none-elf targets.
The error message I'm seeing is:
/libstdc++-v3/testsuite/20_util/to_chars/1.cc: In function 'void test01()':
/libstdc++-v3/testsuite/20_util/to_chars/1.cc:88: error:
'std::to_string' has not been declared
In file included from /libstdc++-v3/testsuite/20_util/to_chars/1.cc:38:
/libstdc++-v3/testsuite/20_util/to_chars/1.cc:90: error: 'to_string'
was not declared in this scope
/libstdc++-v3/testsuite/util/testsuite_hooks.h:57: note: in definition
of macro 'VERIFY'