]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix unwanted #pragma messages from PSTL headers [PR113376]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 12 Jun 2024 15:47:17 +0000 (16:47 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 13 Jun 2024 13:08:36 +0000 (14:08 +0100)
When we rebased the PSTL on upstream, in r14-2109-g3162ca09dbdc2e, a
change to how _PSTL_USAGE_WARNINGS is set was missed out, but the change
to how it's tested was included. This means that the macro is always
defined, so testing it with #ifdef (instead of using #if to test its
value) doesn't work as intended.

Revert the test to use #if again, since that part of the upstream change
was unnecessary in the first place (the macro is always defined, so
there's no need to use #ifdef to avoid -Wundef warnings).

libstdc++-v3/ChangeLog:

PR libstdc++/113376
* include/pstl/pstl_config.h: Use #if instead of #ifdef to test
the _PSTL_USAGE_WARNINGS macro.

libstdc++-v3/include/pstl/pstl_config.h

index 7157a8a492ed9aceeeaeadb9b9c8b4fdd3777f99..6fae15460eac84587f2a5331cd82939f48fe43f7 100644 (file)
 
 #define _PSTL_PRAGMA_MESSAGE_IMPL(x) _PSTL_PRAGMA(message(_PSTL_STRING_CONCAT(_PSTL_PRAGMA_LOCATION, x)))
 
-#if defined(_PSTL_USAGE_WARNINGS)
+#if _PSTL_USAGE_WARNINGS
 #    define _PSTL_PRAGMA_MESSAGE(x) _PSTL_PRAGMA_MESSAGE_IMPL(x)
 #    define _PSTL_PRAGMA_MESSAGE_POLICIES(x) _PSTL_PRAGMA_MESSAGE_IMPL(x)
 #else