public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@linaro.org>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] LWG 2936: update path::compare logic and optimize string comparisons
Date: Wed, 19 Dec 2018 21:31:00 -0000	[thread overview]
Message-ID: <CAKdteOYQkRbmP6DiviLDnN_DLHEf6ZsobtKrnu5BQ1kjCT6kHQ@mail.gmail.com> (raw)
In-Reply-To: <20181218155135.GA8112@redhat.com>

On Tue, 18 Dec 2018 at 16:51, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> The resolution for LWG 2936 defines the comparison more precisely, which
> this patch implements. The patch also defines comparisons with strings
> to work without constructing a temporary path object (so avoids any
> memory allocations).
>
>         * include/bits/fs_path.h (path::compare(const string_type&))
>         (path::compare(const value_type*)): Add noexcept and construct a
>         string view to compare to instead of a path.
>         (path::compare(basic_string_view<value_type>)): Add noexcept. Remove
>         inline definition.
>         * src/filesystem/std-path.cc (path::_Parser): Track last type read
>         from input.
>         (path::_Parser::next()): Return a final empty component when the
>         input ends in a non-root directory separator.
>         (path::_M_append(basic_string_view<value_type>)): Remove special cases
>         for trailing non-root directory separator.
>         (path::_M_concat(basic_string_view<value_type>)): Likewise.
>         (path::compare(const path&)): Implement LWG 2936.
>         (path::compare(basic_string_view<value_type>)): Define in terms of
>         components returned by parser, consistent with LWG 2936.
>         * testsuite/27_io/filesystem/path/compare/lwg2936.cc: New.
>         * testsuite/27_io/filesystem/path/compare/path.cc: Test more cases.
>         * testsuite/27_io/filesystem/path/compare/strings.cc: Likewise.
>
> Tested x86_64-linux, committed to trunk.
>

Hi,

The updated test fails on aarch64-linux-gnu:
FAIL:    27_io/filesystem/path/compare/strings.cc execution test

In the logs I can see:
/libstdc++-v3/testsuite/27_io/filesystem/path/compare/strings.cc:40:
void test01(): Assertion 'p.compare(p0) == p.compare(s0)' failed.

Christophe

      reply	other threads:[~2018-12-19 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 15:51 Jonathan Wakely
2018-12-19 21:31 ` Christophe Lyon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKdteOYQkRbmP6DiviLDnN_DLHEf6ZsobtKrnu5BQ1kjCT6kHQ@mail.gmail.com \
    --to=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).