[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 26 04:34:11 PDT 2024
================
@@ -160,3 +160,22 @@ namespace GH88929 {
using E = P...[0]; // expected-error {{unknown type name 'P'}} \
// expected-error {{expected ';' after alias declaration}}
}
+
+namespace GH88925 {
+template <typename...> struct S {};
+
+template <int...> struct sequence {};
+
+template <typename... Args, int... indices> auto f(sequence<indices...>) {
+ return S<Args...[indices]...>(); // #use
+}
+
----------------
cor3ntin wrote:
I suspect there is the same problem for expressions
```cpp
template <auto...> struct S2 {};
template <auto... Args, int... indices> auto f(sequence<indices...>) {
return S2<Args...[indices]...>(); // #use
}
```
https://github.com/llvm/llvm-project/pull/90195
More information about the cfe-commits
mailing list