public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/c++-contracts] c++: fix assume test
Date: Thu,  3 Nov 2022 19:45:53 +0000 (GMT)	[thread overview]
Message-ID: <20221103194554.43DC33858C36@sourceware.org> (raw)

https://gcc.gnu.org/g:a05f106bafd5a74e677e3bddab6eeabbae362dc8

commit a05f106bafd5a74e677e3bddab6eeabbae362dc8
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Nov 2 14:50:04 2022 -0400

    c++: fix assume test

Diff:
---
 gcc/testsuite/g++.dg/contracts/contracts-assume5.C | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/gcc/testsuite/g++.dg/contracts/contracts-assume5.C b/gcc/testsuite/g++.dg/contracts/contracts-assume5.C
index 67b28647786..372c0deb13a 100644
--- a/gcc/testsuite/g++.dg/contracts/contracts-assume5.C
+++ b/gcc/testsuite/g++.dg/contracts/contracts-assume5.C
@@ -1,7 +1,6 @@
-// test that assumed constexpr contracts that reference defined entities cause
-// constexpr eval failure when the predicate is constexpr false
-// test that assumed constexpr contracts that reference undefined entities in
-// an unevaluated context cause constexpr eval failure
+// test that assumed constexpr contracts that reference defined entities, or
+// undefined entities in unevaluated context, cause constexpr eval failure when
+// the predicate is constexpr false
 // { dg-do compile }
 // { dg-options "-std=c++2a -fcontracts" }
 
@@ -20,16 +19,16 @@ constexpr int undef(int t);
 
 constexpr int dummy2()
 {
-  [[ assert assume: sizeof(decltype(f(1))) < 0 ]];
+  [[ assert assume: sizeof(decltype(undef(1))) < 0 ]];
   return -1;
 }
 
 int main()
 {
   constexpr int n = dummy(); // { dg-message "in .constexpr. expansion" }
-  // { dg-error "contract predicate" "" { target *-*-* } 15 }
+  // { dg-error "contract predicate" "" { target *-*-* } 14 }
   constexpr int m = dummy2(); // { dg-message "in .constexpr. expansion" }
-  // { dg-error "contract predicate" "" { target *-*-* } 23 }
+  // { dg-error "contract predicate" "" { target *-*-* } 22 }
   return 0;
 }

                 reply	other threads:[~2022-11-03 19:45 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=20221103194554.43DC33858C36@sourceware.org \
    --to=jason@gcc.gnu.org \
    --cc=gcc-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).