On 05/10/17 22:00 +0200, Christophe Lyon wrote:
Hi Jonathan,

On 3 October 2017 at 16:31, Jonathan Wakely <jwak...@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'

Should be fixed with the attached patch.

commit f6ea2112cdbd2c52302032b3991cef0a3af1c1b4
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Oct 5 21:14:46 2017 +0100

    Fix new testsuite failure on newlib targets
    
            * testsuite/20_util/to_chars/1.cc: Add dg-require-string-conversions.

diff --git a/libstdc++-v3/testsuite/20_util/to_chars/1.cc b/libstdc++-v3/testsuite/20_util/to_chars/1.cc
index bdd961104a2..12dfd3d49f3 100644
--- a/libstdc++-v3/testsuite/20_util/to_chars/1.cc
+++ b/libstdc++-v3/testsuite/20_util/to_chars/1.cc
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++17" }
 // { dg-do run { target c++17 } }
+// { dg-require-string-conversions "" }
 
 #include <charconv>
 #include <string_view>

Reply via email to