wash added a comment.

I think the test `reduce_iter_iter_T.pass.cpp` can be improved a little bit.

Right now, it:

- Tests that the three argument overload (iterators + init) work correctly when 
the iterator value type is the same as the init type.
- Tests that the return type of the three argument overload is correct in cases 
where the iterator value type differs from the init type.

It does not, however, test whether the result is correct when the iterator 
value type differs from the init type.

I'd suggest:

  void
  test_different_init_type()
  {
      char ca[] = {CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX};
      unsigned sa = sizeof(ca) / sizeof(ca[0]);
      test(ca, ca, int{0}, int{0});
      test(ca, ca+1, int{0}, int{CHAR_MAX});
      test(ca, ca+2, int{0}, int{2*CHAR_MAX});
      test(ca, ca+sa, int{0}, int{4*CHAR_MAX});
  }


https://reviews.llvm.org/D33997



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to