From: Nathaniel Shead <nathanieloshead@gmail.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: gcc-patches@gcc.gnu.org, Nathan Sidwell <nathan@acm.org>,
Jason Merrill <jason@redhat.com>
Subject: Re: [PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]
Date: Mon, 13 May 2024 22:03:58 +1000 [thread overview]
Message-ID: <664201b3.050a0220.3d9fe.21eb@mx.google.com> (raw)
In-Reply-To: <yddwmnx2a88.fsf@CeBiTec.Uni-Bielefeld.DE>
On Mon, May 13, 2024 at 01:59:51PM +0200, Rainer Orth wrote:
> Hi Nathaniel,
>
> > On Mon, May 13, 2024 at 10:40:30AM +0200, Rainer Orth wrote:
> >> g++.dg/modules/stdio-1_a.H currently FAILs on Solaris:
> >>
> >> FAIL: g++.dg/modules/stdio-1_a.H -std=c++17 scan-lang-dump module "Depset:0 decl entity:[0-9]* function_decl:'::printf'"
> >> FAIL: g++.dg/modules/stdio-1_a.H -std=c++2a scan-lang-dump module "Depset:0 decl entity:[0-9]* function_decl:'::printf'"
> >> FAIL: g++.dg/modules/stdio-1_a.H -std=c++2b scan-lang-dump module "Depset:0 decl entity:[0-9]* function_decl:'::printf'"
> >>
> >> The problem is that the module file doesn't contain
> >>
> >> Depset:0 decl entity:95 function_decl:'::printf'
> >>
> >> as expected by the test, but
> >>
> >> Depset:0 decl entity:26 function_decl:'::std::printf'
> >>
> >> This happens because Solaris <stdio.h> declares printf in namespace std
> >> as allowed by C++11, Annex D, D.5.
> >>
> >> This patch allows for both forms.
> >>
> >> Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
> >> x86_64-pc-linux-gnu.
> >>
> >> Ok for trunk?
> >>
> >> Rainer
> >
> > There are a couple of other tests that appear to potentially have a
> > similar issue:
> >
> > global-2_a.C
> > 21:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^\n']*'
> > added} module } }
> >
> > global-3_a.C
> > 15:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^'\n]*'
> > added} module } }
>
> neither module file contains "Reachable GMF" at all, with ::printf or
> otherwise.
>
Yes, I think the test is aiming to check that such a declaration is not
added at all, and so that's correct. But if for some reason on some
system it did add "::std::printf" that would be a bug that would not be
caught by this test.
> > Which I suppose maybe also should be updated in the same way; I guess
> > they don't fail on Solaris because they aren't actually correctly
> > testing what they think they are.
>
> Perhaps, but it would be useful to first understand what those tests are
> supposed to look like. WRT global-3_a.C, printf doesn't occur at all,
> so this may just be a case of copy-and-paste.
>
> Maybe Nathan, who authored the tests, can shed some light.
>
> > Otherwise LGTM.
>
> Thanks. I'll go ahead and commit the patch as is, asjusting the other
> two once it's become clear what they should look like.
>
Ah, I should have been clearer: I'm not sure I can approve, but I've
CC'd Jason in.
> Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
next prev parent reply other threads:[~2024-05-13 12:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-13 8:40 Rainer Orth
2024-05-13 11:48 ` Nathaniel Shead
2024-05-13 11:59 ` Rainer Orth
2024-05-13 12:03 ` Nathaniel Shead [this message]
2024-05-13 12:10 ` Rainer Orth
2024-05-14 22:11 ` Jason Merrill
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=664201b3.050a0220.3d9fe.21eb@mx.google.com \
--to=nathanieloshead@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=nathan@acm.org \
--cc=ro@cebitec.uni-bielefeld.de \
/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).