public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Moritz Sichert <sichert@in.tum.de>
Cc: Patrick Palka <ppalka@redhat.com>,
	libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Avoid accidental ADL when calling make_reverse_iterator
Date: Tue, 23 Mar 2021 16:25:29 +0000	[thread overview]
Message-ID: <20210323162529.GY3008@redhat.com> (raw)
In-Reply-To: <38f0dca9-d993-f124-e304-6e37cf8dcd91@in.tum.de>

On 03/03/21 20:26 +0100, Moritz Sichert via Libstdc++ wrote:
>Thanks for the review. I attached the updated patch.
>
>Can you commit this for me or point me to what I should do next? This is my first contribution here.

I was about to do this, but ...

>+namespace test_ns
>+{
>+  struct A {};
>+  template <typename T>
>+  void make_reverse_iterator(T&&) {}
>+} // namespace test_ns
>+
>+void test()
>+{
>+  test_ns::A as[] = {{}, {}};
>+  auto v = as | std::views::reverse;
>+  static_assert(std::ranges::view<decltype(v)>);
>+  static_assert(std::ranges::view<const decltype(v)>);

Was this tested? A view must be movable, which requires
move-assignable. You can't assign to a const view, so const
decltype(v) does not model movable so does not model view.


  parent reply	other threads:[~2021-03-23 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 17:25 Moritz Sichert
2021-03-03 18:02 ` Patrick Palka
2021-03-03 19:26   ` Moritz Sichert
2021-03-19 14:48     ` Moritz Sichert
2021-03-23 16:25     ` Jonathan Wakely [this message]
2021-03-23 17:09       ` Jonathan Wakely
2021-03-23 17:45         ` Moritz Sichert
2021-03-23 18:25           ` Jonathan Wakely

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=20210323162529.GY3008@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ppalka@redhat.com \
    --cc=sichert@in.tum.de \
    /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).