[libcxx-commits] [PATCH] D118686: [libc++][ranges][NFC] Test the specializations of `tuple_{size, element}` for ranges.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 1 17:03:48 PST 2022


var-const marked an inline comment as done.
var-const added a comment.

In D118686#3288925 <https://reviews.llvm.org/D118686#3288925>, @ldionne wrote:

> shouldn't we be doing that via `libcxx/utils/generate_header_inclusion_tests.py` instead?

The Standard says in [`tuple.helper`](https://eel.is/c++draft/tuple.helper#6):

  In addition to being available via inclusion of the `<tuple>` header, the template is available when any of the headers `<array>`, `<ranges>`, or `<utility>` are included.

(the templates in question are `tuple_size` and `tuple_element`)

I don't think `generate_header_inclusion_tests.py` can do that because it checks for inclusion of headers, not for the availability of particular classes and functions.

The existing tests for the similar requirement in `<array>` and `<utility>` do it by instantiating every distinct specialization of `array` and `pair`, respectively (`test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp` and `test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp`). Now that I think about it, it seems like I should move the new tests under `test/std/utilities/tuple/tuple.tuple/tuple.helper`, what do you think? Also, would it make sense to instantiate `tuple_size` and `tuple_element` for something other than the range specializations (because if I'm reading the requirement correctly, the templates should become generally available, not just the specializations)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118686



More information about the libcxx-commits mailing list