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 r11-8129] libstdc++: Fix some tests that fail in C++20 mode
Date: Mon, 12 Apr 2021 11:30:35 +0000 (GMT)	[thread overview]
Message-ID: <20210412113035.C9D213896C12@sourceware.org> (raw)

https://gcc.gnu.org/g:91dd7954c44b201aa3b16e66b18d7a5df00fded9

commit r11-8129-g91dd7954c44b201aa3b16e66b18d7a5df00fded9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 12 11:45:21 2021 +0100

    libstdc++: Fix some tests that fail in C++20 mode
    
    The linear_congruential_engine negative tests fail with a different
    error in C++20 mode, because double is no longer an invalid type for
    NTTP. Adjust the expected errors.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc:
            Adjust expected error for C++20 mode.
            * testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc:
            Likewise.

Diff:
---
 .../random/linear_congruential_engine/requirements/non_uint_neg.cc    | 4 +++-
 .../random/linear_congruential/requirements/non_uint_neg.cc           | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
index e04e8ca6972..a36d63c6c7b 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
@@ -20,10 +20,12 @@
 
 // { dg-do compile { target c++11 } }
 // { dg-require-cstdint "" }
+// { dg-error "not a valid type" "" { target { ! c++20 } } 31 }
+// { dg-error "from 'int' to 'double'" "" { target c++20 } 31 }
 
 // 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
 // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
 
 #include <random>
 
-std::linear_congruential_engine<double, 48271, 0, 2147483647> x; // { dg-error "not a valid type" }
+std::linear_congruential_engine<double, 48271, 0, 2147483647> x;
diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc
index 5ad82db1def..53b15f32516 100644
--- a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc
+++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc
@@ -19,7 +19,8 @@
 
 // { dg-do compile }
 // { dg-options "-D_GLIBCXX_CONCEPT_CHECKS" }
-// { dg-error "not a valid type" "" { target *-*-* } 29 }
+// { dg-error "not a valid type" "" { target { ! c++20 } } 30 }
+// { dg-error "from 'int' to 'double'" "" { target c++20 } 30 }
 
 // 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong]
 // 5.1.4.1 [4]


                 reply	other threads:[~2021-04-12 11:30 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=20210412113035.C9D213896C12@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).