public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	libstdc++ <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix _GLIBCXX_DEBUG tests
Date: Mon, 14 Dec 2020 22:36:18 +0100	[thread overview]
Message-ID: <c2295088-256b-c9d5-a9a9-ae35f7000579@gmail.com> (raw)
In-Reply-To: <CAH6eHdQ4advx6gzVfqb9ay22W3amVnwGEZ=CWA2K0ZAsxc-+XQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1967 bytes --]

On 14/12/20 11:08 am, Jonathan Wakely wrote:
>
>
> On Mon, 14 Dec 2020, 06:51 François Dumont via Libstdc++, 
> <libstdc++@gcc.gnu.org <mailto:libstdc%2B%2B@gcc.gnu.org>> wrote:
>
>     On 13/12/20 11:17 pm, Jonathan Wakely wrote:
>     > On 13/12/20 15:52 +0100, François Dumont via Libstdc++ wrote:
>     >> Some tests are XPASS because array assertions have been
>     disabled for
>     >> a good reason in C++11.
>     >>
>     >> I wonder if the respective non-constexpr _GLIBCXX_ASSERTION checks
>     >> shouldn't target C++14 too. At the moment they are failing as
>     >> expected but because of an Undefined Behavior no ?
>     >
>     > Hmm, maybe my "fix" for the bug was too hasty, and I should have
>     done
>     > this instead:
>     >
>     > --- a/libstdc++-v3/include/bits/c++config
>     > +++ b/libstdc++-v3/include/bits/c++config
>     > @@ -684,7 +684,7 @@ namespace std
>     >
>     >  #undef _GLIBCXX_HAS_BUILTIN
>     >
>     > -#if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
>     > +#if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED && __cplusplus >=
>     > 201402L
>     >  # define __glibcxx_assert_1(_Condition)                \
>     >      if (__builtin_is_constant_evaluated())     \
>     >       {                                         \
>     >
>     > That would allow us to keep the std::array runtime assertions for
>     > C++11, and only disable them in constexpr contexts.
>
>     I already tried to restore this check in C++11 runtime without
>     success
>     but I didn't try this approach.
>
>     I'll have a try but C++11 forces constexpr to be just a return
>     statement
>     so I fear that it won't appreciate the additional assertion.
>
>
>
> Ah yes, we'd need something like Daniel suggested, and it's not worth 
> it just for C++11.
>
> Just limiting the tests to c++14 is fine.
>
>
Attached patch committed then.

François


[-- Attachment #2: debug.patch --]
[-- Type: text/x-patch, Size: 1675 bytes --]

diff --git a/libstdc++-v3/testsuite/23_containers/array/debug/back1_neg.cc b/libstdc++-v3/testsuite/23_containers/array/debug/back1_neg.cc
index 8216dea3cfb..ca3172e9e39 100644
--- a/libstdc++-v3/testsuite/23_containers/array/debug/back1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/debug/back1_neg.cc
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 //
 // { dg-options "-D_GLIBCXX_ASSERTIONS" }
-// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-do run { target c++14 xfail *-*-* } }
 
 #include <array>
 
diff --git a/libstdc++-v3/testsuite/23_containers/array/debug/front1_neg.cc b/libstdc++-v3/testsuite/23_containers/array/debug/front1_neg.cc
index c6871093d2a..0f102103fe5 100644
--- a/libstdc++-v3/testsuite/23_containers/array/debug/front1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/debug/front1_neg.cc
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 //
 // { dg-options "-D_GLIBCXX_ASSERTIONS" }
-// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-do run { target c++14 xfail *-*-* } }
 
 #include <array>
 
diff --git a/libstdc++-v3/testsuite/23_containers/array/debug/square_brackets_operator1_neg.cc b/libstdc++-v3/testsuite/23_containers/array/debug/square_brackets_operator1_neg.cc
index 3f1ea128902..130325620e8 100644
--- a/libstdc++-v3/testsuite/23_containers/array/debug/square_brackets_operator1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/debug/square_brackets_operator1_neg.cc
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 //
 // { dg-options "-D_GLIBCXX_ASSERTIONS" }
-// { dg-do run { target c++11  xfail *-*-* } }
+// { dg-do run { target c++14 xfail *-*-* } }
 
 #include <array>
 

  reply	other threads:[~2020-12-14 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13 14:52 François Dumont
2020-12-13 22:17 ` Jonathan Wakely
2020-12-14  6:50   ` François Dumont
2020-12-14 10:08     ` Jonathan Wakely
2020-12-14 21:36       ` François Dumont [this message]
2020-12-15 15:20         ` Jonathan Wakely
2020-12-15 15:41           ` 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=c2295088-256b-c9d5-a9a9-ae35f7000579@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --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).