public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/102181] std::advance and std::views::iota<std::int64_t> don't work
Date: Thu, 02 Sep 2021 22:13:03 +0000 [thread overview]
Message-ID: <bug-102181-4-abmALGddOY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102181-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102181
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Raffael Casagrande from comment #3)
> MSVC compiles the snippet without problems...
It looks like they do not correctly implement iota_view. This C++20 proposal,
specifically:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1522r1.pdf
This program fails with MSVC:
#include <ranges>
int main() {
using type = uint64_t; // using type = int works!
auto v = std::views::iota(0ull, ~0ull);
auto b = v.end() - v.begin();
static_assert(!std::same_as<decltype(b), int64_t>);
}
It is required to compile. You cannot use int64_t to represent the difference
type of an iota_view with that many elements.
I think GCC is correct according to the standard.
next prev parent reply other threads:[~2021-09-02 22:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 20:28 [Bug libstdc++/102181] New: " raffael at casagrande dot ch
2021-09-02 21:36 ` [Bug libstdc++/102181] " redi at gcc dot gnu.org
2021-09-02 21:44 ` redi at gcc dot gnu.org
2021-09-02 21:51 ` raffael at casagrande dot ch
2021-09-02 21:59 ` redi at gcc dot gnu.org
2021-09-02 22:13 ` redi at gcc dot gnu.org [this message]
2021-09-02 23:35 ` redi at gcc dot gnu.org
2021-10-12 15:49 ` cvs-commit at gcc dot gnu.org
2021-10-12 16:11 ` [Bug libstdc++/102181] [DR 3197] " redi at gcc dot gnu.org
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=bug-102181-4-abmALGddOY@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@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).