https://bugs.llvm.org/show_bug.cgi?id=44846
Bug ID: 44846
Summary: std::to_address isn't SFINAE friendly
Product: libc++
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: cjdb...@gmail.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
The following example should compile, but causes an instantiation error.
```
#include <memory>
struct dummy {};
struct iterator {
using element_type = dummy;
int* operator->() const;
};
template<typename I>
concept passing = requires(I const& i) {
std::to_address(i);
};
static_assert(not passing<iterator>);
```
Because `std::to_address` has a deduced return type, the concept `passing` must
instantiate `std::to_address`, which means that it ironically causes a hard
error when trying to check if the expression is well-formed (the concept is not
at fault here). Changing `std::to_address` to be SFINAE-friendly will be
necessary to implement `std::contiguous_iterator`.
Related issue: https://bugs.llvm.org/show_bug.cgi?id=44674
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs