Issue 135550
Summary Clang pretends to supports indexing a pack of template-names
Labels clang, clang:frontend, crash-on-invalid, c++26
Assignees
Reporter cor3ntin
    ```cpp
template <
    template <typename> typename... TT>
struct S {
    using First = TT...[0];
};

template <typename T>
struct U;
using A = S<U>::First;
A a;
```

https://compiler-explorer.com/z/b663d38hs


This code is not valid C++26 as pack indexing is only supported for types and expressions.
Clang fails to reject it, which subsequently leads to a crash at codegen.


Note that I'm writing the paper to make this well-formed, and I wonder if we shouldn't preemptively accept that as an extension or do nothing until the next WG21 meeting.

At the same time, adding a diagnostic to reject it should be easy.






_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to