public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-7470] libstdc++: Use non-debug vector in constexpr test [PR104748]
Date: Thu,  3 Mar 2022 22:35:42 +0000 (GMT)	[thread overview]
Message-ID: <20220303223542.62067385800C@sourceware.org> (raw)

https://gcc.gnu.org/g:5706a5db88a0eeaf82071debe1364f4533896a65

commit r12-7470-g5706a5db88a0eeaf82071debe1364f4533896a65
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Mar 3 22:28:48 2022 +0000

    libstdc++: Use non-debug vector in constexpr test [PR104748]
    
    The std::__debug::vector isn't usable in constant expressions, so this
    test fails in debug mode. Until the debug vector is fixed we can just
    make the test use the non-debug one.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/104748
            * testsuite/std/ranges/adaptors/all.cc: Use non-debug vector for
            constexpr test.

Diff:
---
 libstdc++-v3/testsuite/std/ranges/adaptors/all.cc | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/all.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/all.cc
index e457462825d..a4924b9909f 100644
--- a/libstdc++-v3/testsuite/std/ranges/adaptors/all.cc
+++ b/libstdc++-v3/testsuite/std/ranges/adaptors/all.cc
@@ -164,20 +164,26 @@ test07()
 constexpr bool
 test08()
 {
+#ifdef _GLIBCXX_DEBUG
+  using std::_GLIBCXX_STD_C::vector;
+#else
+  using std::vector;
+#endif
+
   // Verify P2415R2 "What is a view?" changes.
   // In particular, rvalue non-view non-borrowed ranges are now viewable.
-  static_assert(ranges::viewable_range<std::vector<int>&&>);
-  static_assert(!ranges::viewable_range<const std::vector<int>&&>);
+  static_assert(ranges::viewable_range<vector<int>&&>);
+  static_assert(!ranges::viewable_range<const vector<int>&&>);
 
   static_assert(ranges::viewable_range<std::initializer_list<int>&>);
   static_assert(ranges::viewable_range<const std::initializer_list<int>&>);
   static_assert(!ranges::viewable_range<std::initializer_list<int>&&>);
   static_assert(!ranges::viewable_range<const std::initializer_list<int>&&>);
 
-  using type = views::all_t<std::vector<int>&&>;
-  using type = ranges::owning_view<std::vector<int>>;
+  using type = views::all_t<vector<int>&&>;
+  using type = ranges::owning_view<vector<int>>;
 
-  std::same_as<type> auto v = std::vector<int>{{1,2,3}} | views::all;
+  std::same_as<type> auto v = vector<int>{{1,2,3}} | views::all;
 
   VERIFY( ranges::equal(v, (int[]){1,2,3}) );
   VERIFY( ranges::size(v) == 3 );


                 reply	other threads:[~2022-03-03 22:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220303223542.62067385800C@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).