[libcxx-commits] [PATCH] D149595: [libc++][PSTL] Fix nasty macros test

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 1 09:50:41 PDT 2023


philnik created this revision.
philnik added a reviewer: ldionne.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149595

Files:
  libcxx/include/__pstl/internal/execution_defs.h
  libcxx/test/libcxx/nasty_macros.compile.pass.cpp


Index: libcxx/test/libcxx/nasty_macros.compile.pass.cpp
===================================================================
--- libcxx/test/libcxx/nasty_macros.compile.pass.cpp
+++ libcxx/test/libcxx/nasty_macros.compile.pass.cpp
@@ -9,9 +9,6 @@
 // Test that headers are not tripped up by the surrounding code defining various
 // alphabetic macros.
 
-// FIXME: This should pass with the PSTL enabled
-// XFAIL: with-pstl
-
 // Prevent <ext/hash_map> from generating deprecated warnings for this test.
 #if defined(__DEPRECATED)
 #    undef __DEPRECATED
Index: libcxx/include/__pstl/internal/execution_defs.h
===================================================================
--- libcxx/include/__pstl/internal/execution_defs.h
+++ libcxx/include/__pstl/internal/execution_defs.h
@@ -38,7 +38,7 @@
 constexpr unsequenced_policy unseq{};
 
 // 2.3, Execution policy type trait
-template <class T>
+template <class>
 struct is_execution_policy : std::false_type {};
 
 template <>
@@ -51,18 +51,18 @@
 struct is_execution_policy<__pstl::execution::unsequenced_policy> : std::true_type {};
 
 #if defined(_PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT)
-template <class T>
-constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy<T>::value;
+template <class _Tp>
+constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy<_Tp>::value;
 #endif
 
 } // namespace v1
 } // namespace execution
 
 namespace __internal {
-template <class ExecPolicy, class T>
+template <class _ExecPolicy, class _Tp>
 using __enable_if_execution_policy =
-    typename std::enable_if<__pstl::execution::is_execution_policy<typename std::decay<ExecPolicy>::type>::value,
-                            T>::type;
+    typename std::enable_if<__pstl::execution::is_execution_policy<typename std::decay<_ExecPolicy>::type>::value,
+                            _Tp>::type;
 
 template <class _IsVector>
 struct __serial_tag;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149595.518475.patch
Type: text/x-patch
Size: 1930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230501/3135da74/attachment.bin>


More information about the libcxx-commits mailing list