public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/97600] New: [ranges] result of static assertion depends on unrelated statement
@ 2020-10-27 18:45 ppalka at gcc dot gnu.org
  2020-10-27 19:22 ` [Bug libstdc++/97600] " ppalka at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-10-27 18:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97600

            Bug ID: 97600
           Summary: [ranges] result of static assertion depends on
                    unrelated statement
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat testcase.C
$#include <sstream>
#include <ranges>

int main() {
  using namespace std::ranges;
  basic_istream_view<int, char, std::char_traits<char>> v;
  v.begin();
  static_assert(range<decltype(v)>);
}

$ g++ -std=c++20 testcase.C
testcase.C:8:17: error: static assertion failed
    8 |   static_assert(range<decltype(v)>);
      |                 ^~~~~~~~~~~~~~~~~~


Unexpectedly, this static assert fails.  Even more unexpectedly, if we remove
the 'v.begin()' line before it, then the static assert succeeds.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-21 14:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 18:45 [Bug libstdc++/97600] New: [ranges] result of static assertion depends on unrelated statement ppalka at gcc dot gnu.org
2020-10-27 19:22 ` [Bug libstdc++/97600] " ppalka at gcc dot gnu.org
2020-10-27 19:39 ` ppalka at gcc dot gnu.org
2020-10-28 16:59 ` [Bug libstdc++/97600] [ranges] satisfaction value of range<basic_istream_view> affected by prior use of basic_istream_view::begin() ppalka at gcc dot gnu.org
2020-10-31  0:34 ` cvs-commit at gcc dot gnu.org
2020-12-11 20:41 ` cvs-commit at gcc dot gnu.org
2021-04-21  3:27 ` cvs-commit at gcc dot gnu.org
2021-04-21 14:18 ` ppalka at gcc dot gnu.org

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).