public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Fix test that fails in C++20 mode [PR 99995]
Date: Mon, 12 Apr 2021 11:35:42 +0100	[thread overview]
Message-ID: <YHQifi+Uwxm6pw8F@redhat.com> (raw)

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

The 17_intro/headers/c++1998/49745.cc test fails for C++20 mode with PCH
enabled, because PCH makes it include <bits/stdc++.h>, which includes
<atomic>, and that includes <unistd.h> in C++20 mode. The <unistd.h>
dependency should go away when C++20 atomic waiting is stable, but will
probably remain while the feature is experimental. Change the test to
always include <bits/stdc++.h>, and XFAIL for C++20 and later.

libstdc++-v3/ChangeLog:

	PR libstdc++/99995
	* testsuite/17_intro/headers/c++1998/49745.cc: Include all
	standard headers and XFAIL for effective-target c++20.

Tested x86_64-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1329 bytes --]

commit 29046e02b84a16b6315d952d7f76c502d0d021c2
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 12 11:12:47 2021

    libstdc++: Fix test that fails in C++20 mode [PR 99995]
    
    The 17_intro/headers/c++1998/49745.cc test fails for C++20 mode with PCH
    enabled, because PCH makes it include <bits/stdc++.h>, which includes
    <atomic>, and that includes <unistd.h> in C++20 mode. The <unistd.h>
    dependency should go away when C++20 atomic waiting is stable, but will
    probably remain while the feature is experimental. Change the test to
    always include <bits/stdc++.h>, and XFAIL for C++20 and later.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/99995
            * testsuite/17_intro/headers/c++1998/49745.cc: Include all
            standard headers and XFAIL for effective-target c++20.

diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc b/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
index a13a40ec7db..204975e0316 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
@@ -18,5 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // libstdc++/49745
-#include <iostream>
+#include <bits/stdc++.h>
 int truncate = 0;
+
+// { dg-xfail-if "PR libstdc++/99995" { c++20 } }

             reply	other threads:[~2021-04-12 10:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 10:35 Jonathan Wakely [this message]
2021-04-12 11:31 ` 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=YHQifi+Uwxm6pw8F@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).