Issue 138255
Summary Pack indexing specifier can't be used with templated function declaration inside a class
Labels new issue
Assignees
Reporter n0F4x
    Example:
```cpp
#include <concepts>

template<typename... Ts>
using front_t = Ts...[0];

struct Foo {
    template<typename... Ts>
         requires std::same_as<Ts...[0], int>
    static auto buggy() -> void;

    template<typename... Ts>
 requires std::same_as<front_t<Ts...>, int>
    static auto working() -> void;
};

template<typename... Ts>
    requires std::same_as<Ts...[0], int>
auto Foo::buggy() -> void {}

template<typename... Ts>
    requires std::same_as<front_t<Ts...>, int>
auto Foo::working() -> void {}

int main() {
    Foo::buggy<int>();
 Foo::working<int>();
}
```
```
<source>:18:11: error: out-of-line definition of 'buggy' does not match any declaration in 'Foo'
   18 | auto Foo::buggy() -> void {}
      |           ^~~~~
<source>:6:8: note: Foo defined here
    6 | struct Foo {
      |        ^~~
1 error generated.
Compiler returned: 1
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to