[llvm-bugs] [Bug 48557] New: Parallel algorithms fail to enforce Mandates: requirements
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Sat Dec 19 05:57:01 PST 2020
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=48557
            Bug ID: 48557
           Summary: Parallel algorithms fail to enforce Mandates:
                    requirements
           Product: parallel STL
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: New
          Assignee: ldionne at apple.com
          Reporter: zilla at kayari.org
                CC: llvm-bugs at lists.llvm.org
For example:
Mandates: All of
 — binary_op(init, init),
 — binary_op(init, unary_op(*first)),
 — binary_op(unary_op(*first), init), and
 — binary_op(unary_op(*first), unary_op(*first))
are convertible to T.
This was stated with "Requires:" in C++17, but in C++20 violating the
requirement must be diagnosed.
Example:
#include <numeric>
#include <execution>
int main() {
  int a[]{ 1 };
  auto r = std::transform_reduce(
      std::execution::seq, a, a+1, 0,
      [](int& a, int b) {
        return a + b;
      },
      [](int i) { return i; });
}
This compiles without error using GCC's copy of the PSTL code.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201219/43ceff90/attachment.html>
    
    
More information about the llvm-bugs
mailing list