New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++26 Pack-indexing have BUG #91884
Comments
@llvm/issue-subscribers-clang-frontend Author: mq白 (Mq-b)
```cpp
auto print(auto&&...args){
[&]<std::size_t... idx>(std::index_sequence<idx...>){
std::print("{} {} {} {}",args...[idx]...);
}(std::make_index_sequence<sizeof...(args)>());
}
int main(){
Error ! godbolt.. If changed to: void print_one(auto& arg){
std::print("{} ", arg);
}
void print(auto&&...args){
[&]<std::size_t... idx>(std::index_sequence<idx...>){
(::print_one<decltype((args...[idx]))>(args...[idx]), ...);
}(std::make_index_sequence<sizeof...(args)>());
} OK ! godbolt.. Seems to be moving out? But it doesn't matter. It's a BUG. |
@Sirraide didn't you look at something very similar recently? |
Given `foo...[idx]` if idx is value dependent, the expression is type dependent. Fixes llvm#91885 Fixes llvm#91884
Given `foo...[idx]` if idx is value dependent, the expression is type dependent. Fixes llvm#91885 Fixes llvm#91884
That was specifically about dependence of lambdas captures in lambdas with explicit object parameters that should have been dependent if the type of the explicit object parameter is. |
…#91933) Given `foo...[idx]` if idx is value dependent, the expression is type dependent. Fixes llvm#91885 Fixes llvm#91884
OK ! godbolt..
Error ! godbolt..
If changed to:
OK ! godbolt..
Seems to be moving out? But it doesn't matter. It's a BUG.
The text was updated successfully, but these errors were encountered: