aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/17_intro
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-02-11 00:24:47 +0000
committerJonathan Wakely <jwakely@redhat.com>2023-02-16 11:34:20 +0000
commitcb6beb887e64935c12a3508ead6d1806ef341ba2 (patch)
treede06cac451cc60edba9e1cb781ac9601a7e7fb25 /libstdc++-v3/testsuite/17_intro
parent0b9bd33d69d0c30330a465e6bad262d90c94d4ea (diff)
downloadgcc-cb6beb887e64935c12a3508ead6d1806ef341ba2.zip
gcc-cb6beb887e64935c12a3508ead6d1806ef341ba2.tar.gz
gcc-cb6beb887e64935c12a3508ead6d1806ef341ba2.tar.bz2
libstdc++: Fix non-reserved names in PSTL headers
libstdc++-v3/ChangeLog: * include/pstl/algorithm_fwd.h (__pattern_search_n) (__brick_unique_copy, __brick_adjacent_find) (__brick_generate_n, __pattern_generate_n): Use reserved names for parameters. * include/pstl/algorithm_impl.h (__brick_unique_copy) (__pattern_reverse, __brick_generate_n): Likewise. * include/pstl/execution_impl.h (__prefer_unsequenced_tag) (__prefer_parallel_tag): Likewise. * include/pstl/glue_algorithm_impl.h (transform): Likewise. * include/pstl/glue_numeric_defs.h (adjacent_difference): Likewise. * include/pstl/numeric_impl.h (__brick_adjacent_difference): Likewise. * include/pstl/parallel_backend_tbb.h (__merge_func): Likewise. * include/pstl/unseq_backend_simd.h (_Combiner) (__simd_min_element, __simd_minmax_element): Likewise. * testsuite/17_intro/names_pstl.cc: New test.
Diffstat (limited to 'libstdc++-v3/testsuite/17_intro')
-rw-r--r--libstdc++-v3/testsuite/17_intro/names_pstl.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/17_intro/names_pstl.cc b/libstdc++-v3/testsuite/17_intro/names_pstl.cc
new file mode 100644
index 0000000..e5f3ca9
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/names_pstl.cc
@@ -0,0 +1,16 @@
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" { target tbb_backend} }
+
+// The TBB headers use non-reserved names (because they're not part of the
+// implementation) so we need to include them before the macro definitions
+// in names.cc:
+#if __has_include(<tbb/tbb.h>)
+# include <tbb/tbb.h>
+#endif
+// Now we can define the macros to poison uses of non-reserved names:
+#include "names.cc"
+// And finally, include all the headers that have PSTL content:
+#include <execution>
+#include <algorithm>
+#include <memory>
+#include <numeric>