[libcxx-commits] [PATCH] D108855: [libcxx] contiguous iterator concept: don't require pointer or complete element types

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Aug 29 10:42:12 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.verify.cpp:15-18
+#include <concepts>
+#include <compare>
+#include <cstddef>
+#include <iterator>
----------------
```
#include <iterator>
#include <compare>
#include <cstddef>
```
@cjdb points out that `contiguous_iterator` comes from `<iterator>`, not `<concepts>`; thus `<iterator>` is the header-under-test here. Oops.


================
Comment at: libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.verify.cpp:57-58
+    // when used with a type missing an `element_type` type alias.
+    (void) std::contiguous_iterator<no_element_type>; // expected-note at __iterator/concepts.h:*  {{to_address}}
+    // expected-error@*:* {{implicit instantiation of undefined template}}
+}
----------------
My earlier comment was meant to implicitly apply to both `expected-` thingies. And let's reorganize the lines while we're at it:
```
(void) std::contiguous_iterator<no_element_type>;
// expected-error@*:* {{implicit instantiation of undefined template}}
// expected-note@*:* {{to_address}}
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108855



More information about the libcxx-commits mailing list