Issue |
129636
|
Summary |
`__cpp_pack_indexing` value does not respect command-line C++ version
|
Labels |
new issue
|
Assignees |
|
Reporter |
elbeno
|
This code produces the same output whether compiled with `-std=c++20` or `-std=c++26`:
```cpp
template <int I, auto... Vs>
consteval auto nth() {
#if __cpp_pack_indexing >= 202311L
return Vs...[I];
#else
return 0;
#endif
}
int main() {
return nth<0, 1>();
}
```
This _might_ be technically allowed (I am not sure if it's strictly specified)? But if so it's not useful. It's at odds with what GCC does -- and indeed at odds with what clang does with other feature macros -- and it leads to surprisingly provoking a `-Wc++-26-extensions` warning: https://godbolt.org/z/fvjWcYqPG
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs