public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@adacore.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org,
	Corentin Gay <gay@adacore.com>
Subject: Re: Add dg-require-wchars to libstdc++ testsuite
Date: Thu, 14 Jan 2021 19:20:46 -0300	[thread overview]
Message-ID: <orh7nji2ip.fsf@lxoliva.fsfla.org> (raw)
In-Reply-To: <20210114134142.GC7692@redhat.com> (Jonathan Wakely's message of "Thu, 14 Jan 2021 13:41:42 +0000")

On Jan 14, 2021, Jonathan Wakely <jwakely@redhat.com> wrote:

> The problem is that <bits/locale_conv.h> uses wchar_t in default
> template arguments:

> I think we should fix the header, not disable tests that don't use
> that default template argument. The attached patch should allow you to
> use wstring_convert and wbuffer_convert without wchar_t support. The
> tests which instantiate it with char16_t or char32_t instead of
> wchar_t should work with this patch, right?

Thanks, I'll give it a spin.  That said, ...

> <aside>
> Is it the case that the wchar_t type is defined on this target, it's
> just that libc doesn't have support for wcslen etc?

... it is definitely the case that the target currently defines wchar_t,
and it even offers wchar.h and a lot of (maybe all?) wcs* functions.
This was likely not the case when the patch was first written.

I'll double check whether any of the patch is still needed for current
versions.

I figured it would a waste to just discard Corentin's identification of
testcases that failed when glibc wchar_t support was not enabled.

This also means that the test results I'm going to get are likely to not
reflect the conditions for which these patches were originally written.


FWIW, I like very much the notion of offering a fallback wchar_t
implementation within libstdc++-v3, so that users get the expected C++
functionality even when libc doesn't offer it.  Even a (conditional?)
typedef to introduce wchar_t could be there.

Perhaps the test that sets or clears _GLIBCXX_USE_WCHAR_T should be used
to decide whether or not to offer a wchar.h header in libstdc++, and
then (pipe dream?) all other uses of this macro would be just gone?


> As François said, this could use the new proc. I'd also prefer if it
> was defined as an effective-target keyword so we can use:

> // { dg-require-effective-target wchars }

*nod*


> But we might not even need this new proc if the codecvt tests can be
> made to work using the attached patch.

Thanks,

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist         GNU Toolchain Engineer
        Vim, Vi, Voltei pro Emacs -- GNUlius Caesar

  parent reply	other threads:[~2021-01-14 22:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 21:12 Alexandre Oliva
2020-12-28 18:23 ` François Dumont
2021-01-13 17:29   ` Alexandre Oliva
2021-01-14 13:08     ` Jonathan Wakely
2020-12-28 18:27 ` François Dumont
2021-01-14 13:41 ` Jonathan Wakely
2021-01-14 13:47   ` Add dg-require-wchars to libstdc++ testsuite# Jonathan Wakely
2021-01-14 22:20   ` Alexandre Oliva [this message]
2021-01-15 10:09     ` Add dg-require-wchars to libstdc++ testsuite Jonathan Wakely
2021-01-15 16:18       ` Alexandre Oliva
2021-01-15 19:47         ` Jonathan Wakely
2021-10-09  7: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=orh7nji2ip.fsf@lxoliva.fsfla.org \
    --to=oliva@adacore.com \
    --cc=gay@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).