[PATCH 4/4]: C++ P1423R3 char8_t remediation: New tests

Jonathan Wakely jwakely@redhat.com
Tue Dec 3 09:16:00 GMT 2019


On 03/12/19 09:11 +0100, Christophe Lyon wrote:
>On Mon, 16 Sep 2019 at 04:34, Tom Honermann <tom@honermann.net> wrote:
>>
>> A revised patch is attached that modifies the tests for deleted ostream
>> inserters to require C++2a.  This is required by the revision of patch
>> 2/4 that adds proper preprocessor conditionals to the definitions.
>>
>> Tom.
>>
>> On 9/15/19 3:40 PM, Tom Honermann wrote:
>> > This patch adds new tests to validate new deleted overloads of wchar_t,
>> > char8_t, char16_t, and char32_t for ordinary and wide formatted
>> > character and string ostream inserters.
>> >
>> > Additionally, new tests are added to validate invocations of u8path with
>> > sequences of char8_t for both the C++17 and filesystem TS implementations.
>> >
>> > libstdc++-v3/ChangeLog:
>> >
>> > 2019-09-15  Tom Honermann  <tom@honermann.net>
>> >
>> >       *
>> > libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc:
>> >
>> >         New test to validate deleted overloads of character and string
>> >         inserters for narrow ostreams.
>> >       *
>> > libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/deleted.cc:
>> >
>> >         New test to validate deleted overloads of character and string
>> >         inserters for wide ostreams.
>> >       *
>> > libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path-char8_t.cc:
>> >         New test to validate u8path invocations with sequences of
>> >         char8_t.
>> >       *
>> > libstdc++-v3/testsuite/experimental/filesystem/path/factory/u8path-char8_t.cc
>> >
>> >         New test to validate u8path invocations with sequences of
>> >         char8_t.
>> >
>
>Hi,
>
>I've noticed that the new test
>27_io/filesystem/path/factory/u8path-char8_t.cc
>fails to compile on arm-none-eabi with default cpu/fpu, because:
>/tools/arm-none-eabi/bin/ld:
>/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/src/.libs/libstdc++.a(string-inst.o):
>in function `_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_':
>string-inst.cc:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_]+0xf4):
>undefined reference to `_ZSt15__alloc_on_moveISaIcEEvRT_S2_'
>[etc...]

That function is defined inline and so should be instantiated in any
TU that needs it, and so should not give linker errors. There was a
similar bug reported the other day that turned out to be pilot error:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92733

>The one in experimental is unsupported thanks to
>// { dg-require-filesystem-ts "" }
>Should that be added to the version in 27_io?

No, the std::filesystem::path class has no dependencies, it should
work everywhere. I'm not sure what's happening here.



More information about the Gcc-patches mailing list