[libcxx-commits] [PATCH] D103272: [libc++] Refactor the ranges::prev and ranges::next tests

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 27 12:09:47 PDT 2021


Quuxplusone added a comment.

Partly reviewed, but had to step away in the middle.



================
Comment at: libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.verify.cpp:19-25
 void proper_constraints() {
   auto p = std::unique_ptr<int>();
   std::ranges::next(p);    // expected-error {{no matching function for call}}
   std::ranges::next(p, p); // expected-error {{no matching function for call}}
   std::ranges::next(p, 5); // expected-error {{no matching function for call}}
   std::ranges::next(p, 7); // expected-error {{no matching function for call}}
 }
----------------
It would be even nicer to make this a real SFINAE test and enable it for gcc-10/gcc-11.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103272/new/

https://reviews.llvm.org/D103272



More information about the libcxx-commits mailing list