[PATCH] libstdc++: testsuite: don't test for __unused
Jonathan Wakely
jwakely.gcc@gmail.com
Sun Jan 25 19:28:31 GMT 2026
On Sun, 25 Jan 2026, 16:06 Xi Ruoyao, <xry111@xry111.site> wrote:
> x86_64 glibc has started to use it since the 2.43 release.
>
The correct fix is to #undef it for glibc then. That way it's still defined
(and tested) for other targets.
> Link:
> https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b9579342c68b#patch67
> ---
> libstdc++-v3/testsuite/17_intro/badnames.cc | 2 +-
> libstdc++-v3/testsuite/17_intro/names.cc | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/testsuite/17_intro/badnames.cc
> b/libstdc++-v3/testsuite/17_intro/badnames.cc
> index ff590fcdf4d..de4d94faf14 100644
> --- a/libstdc++-v3/testsuite/17_intro/badnames.cc
> +++ b/libstdc++-v3/testsuite/17_intro/badnames.cc
> @@ -67,7 +67,7 @@
>
> // BSD adds:
> #define __used __used is a BADNAME
> -#define __unused __unused is a BADNAME
> + // __unused (glibc uses this so can't test here)
> // __inline (glibc uses this so can't test here)
> // _Complex (glibc uses this so can't test here)
> #define __istype __istype is a BADNAME
> diff --git a/libstdc++-v3/testsuite/17_intro/names.cc
> b/libstdc++-v3/testsuite/17_intro/names.cc
> index 106acfa641b..2249735baae 100644
> --- a/libstdc++-v3/testsuite/17_intro/names.cc
> +++ b/libstdc++-v3/testsuite/17_intro/names.cc
> @@ -150,7 +150,7 @@
> # define __lockable cannot be used as an identifier
> # define __null_sentinel cannot be used as an identifier
> # define __packed cannot be used as an identifier
> -# define __unused cannot be used as an identifier
> + // __unused (glibc uses this so can't test here)
> # define __used cannot be used as an identifier
>
> #ifndef __APPLE__
> --
> 2.52.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20260125/81395daf/attachment-0001.htm>
More information about the Libstdc++
mailing list