Issue 170763
Summary Non-portable test for `iter_difference_t<raw_storage_iterator<I, T>>`
Labels new issue
Assignees
Reporter jwakely
    https://github.com/llvm/llvm-project/blob/47de55f28438a4a3c3c96157fba66694587d8040/libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp#L27-L29

In libc++ `raw_storage_iterator` has a non-void `difference_type` in C++20 and later, which is a conforming extension because `raw_storage_iterator` was deprecated in C++17 and removed from C++20, so you can define it however you want.

But the test that checks for that non-standard extension is not portable to other implementations:

```
# | /home/jwakely/src/llvm/llvm-project/libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp:28:66: error: static assertion failed
# |    28 | static_assert(std::is_same<It::difference_type, std::ptrdiff_t>::value, "");
# |       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
```

This fails with libstdc++.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to