]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix backwards logic in 17_intro/names.cc test [PR 97088]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 28 Jun 2021 14:13:34 +0000 (15:13 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 28 Jun 2021 14:15:16 +0000 (15:15 +0100)
I meant to undef the names that clash with newlib headers for newlib,
but I only undef'd them for non-newlib targets. This means they still
cause errors for newlib, and aren't tested for other targets.

This fixes the test to check those names for non-newlib targets, and to
undef them to avoid errors for newlib.

libstdc++-v3/ChangeLog:

PR libstdc++/97088
* testsuite/17_intro/names.cc: Fix #if condition for names used
by newlib headers.

libstdc++-v3/testsuite/17_intro/names.cc

index 805c1002c3f6f923b2e7e4e84958825b97a59c62..aca7a8e5812e26562832beb0584338418d53c918 100644 (file)
 #define ptr (
 #endif
 
+// This clashes with newlib so don't use it.
+# define __lockable            cannot be used as an identifier
+
+
 // Common template parameter names
 #define OutputIterator         OutputIterator is not a reserved name
 #define InputIterator          InputIterator is not a reserved name
 #undef y
 #endif
 
-#if __has_include(<newlib.h>)
-// newlib's <sys/cdefs.h> defines __lockable as a macro, so we can't use it.
-# define __lockable            cannot be used as an identifier
+#if __has_include(<newlib.h>)
+// newlib's <sys/cdefs.h> defines __lockable as a macro.
+#undef __lockable
 // newlib's <time.h> defines __tzrule_type with these members.
 #undef d
 #undef m