Index: include/pstl/internal/glue_numeric_defs.h =================================================================== --- include/pstl/internal/glue_numeric_defs.h +++ include/pstl/internal/glue_numeric_defs.h @@ -57,7 +57,7 @@ _ForwardIterator2 __result, _Tp __init); template -_ForwardIterator2 +__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op); Index: include/pstl/internal/glue_numeric_impl.h =================================================================== --- include/pstl/internal/glue_numeric_impl.h +++ include/pstl/internal/glue_numeric_impl.h @@ -101,7 +101,7 @@ } template -_ForwardIterator2 +__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op) { Index: test/CMakeLists.txt =================================================================== --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -23,7 +23,7 @@ target_link_libraries(test_stdlib INTERFACE pstl::ParallelSTL) target_compile_options(test_stdlib INTERFACE -Wno-gnu-include-next) -file(GLOB_RECURSE UNIT_TESTS "*.pass.cpp") +file(GLOB_RECURSE UNIT_TESTS "*.pass.cpp" "*.fail.cpp") foreach(_file IN LISTS UNIT_TESTS) file(RELATIVE_PATH _target "${CMAKE_CURRENT_SOURCE_DIR}" "${_file}") string(REPLACE ".cpp" "" _target "${_target}") Index: test/std/numerics/numeric.ops/scan.fail.cpp =================================================================== --- /dev/null +++ test/std/numerics/numeric.ops/scan.fail.cpp @@ -0,0 +1,36 @@ +// -*- C++ -*- +//===-- scan.fail.cpp -----------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include + +class CustomPolicy { +}; + +template +typename std::enable_if::value, void>::type +run_algo() { + + CustomPolicy policy; + int *first = nullptr, *last=nullptr, *result = nullptr; + + std::exclusive_scan(policy, first, last, result, 0); + std::exclusive_scan(policy, first, last, result, 0, std::plus()); +} + +template +typename std::enable_if::value, void>::type +run_algo() {} + +int32_t +main() +{ + run_algo(); + return 0; +}