llvm / llvm/llvm-project

[ADT] Conversion from ArrayRef<S:T> to ArrayRef<T> does not work

Open
#169,314 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.