[ADT] Conversion from ArrayRef<S:T> to ArrayRef<T> does not work
Open
llvm:adt
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Conversion of an `ArrayRef` of some class to an `ArrayRef` of the base class of that class fails with the following error message:
```
ArrayRef.h(94, 28): Candidate template ignored:
requirement 'std::conjunction_v, std::is_integral>' was not satisfied [with C = mlir::ArrayRef]
```
### Example
```c++
ArrayRef x;
ArrayRef y(x);
```
Contributor guide
Research direction
Start by locating the ArrayRef conversion constructors and constraints in the LLVM ADT implementation, then reproduce the StringAttr-to-Attribute example from the issue. Done means the shown conversion is accepted and covered by a regression test for derived-to-base ArrayRef conversion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100