Skip to content

Commit d5ea55c

Browse files
zip_view: expanding workaround (#2627)
--------- Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
1 parent b2ae863 commit d5ea55c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

include/oneapi/dpl/pstl/onedpl_config.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,14 @@
346346
# define _ONEDPL_STD_RANGES_ALGO_CPP_FUN 0
347347
#endif
348348
349+
// Hidden friend functions defined in a sibling nested class are given access to the enclosing friend class's
350+
// other nested classes' private members for most compilers(CWG1699). GCC < 13 and MSVC do not grant this access.
351+
#if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__clang__) && _ONEDPL_GCC_VERSION < 130100)
352+
# define _ONEDPL_HIDDEN_FRIENDS_SIBLING_ACCESS_BROKEN 1
353+
#else
354+
# define _ONEDPL_HIDDEN_FRIENDS_SIBLING_ACCESS_BROKEN 0
355+
#endif
356+
349357
// -- Configure heterogeneous backends --
350358
351359
#if !defined(ONEDPL_ALLOW_DEFERRED_WAITING)

include/oneapi/dpl/pstl/zip_view_impl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ class zip_view : public std::ranges::view_interface<zip_view<_Views...>>
429429
private:
430430
friend class zip_view;
431431

432-
# if defined(_MSC_VER)
433-
//required for CL compiler, which does not find the friend iterator class
432+
# if _ONEDPL_HIDDEN_FRIENDS_SIBLING_ACCESS_BROKEN
434433
public:
435434
# endif
436435
decltype(auto)

0 commit comments

Comments
 (0)