Skip to content

[clang][regression][rejects-valid] clang trunk rejecting valid pack expansion #91787

@ericniebler

Description

@ericniebler

I believe the following C++20 code should compile:

template <class...>
concept True = true;

template <bool>
struct I {
  template <template <class...> class F, class... As>
  using f = F<As...>;
};

template <template <class...> class F, class... As>
using meval = I<True<As...>>::template f<F, As...>;

template <class F, class... As>
concept P = true;

template <class F, class... As>
  requires P<F, As...>
using V = void;

template <class...Ts>
auto f() -> meval<V, int, Ts...> {
}

int main() {
  f();
}

Clang 18 and earlier accepts it, as does gcc. With clang-trunk, I get:

<source>:10:29: error: pack expansion used as argument for non-pack parameter of alias template
   10 | template <template <class...> class F, class... As>
      |                             ^
1 error generated.
Compiler returned: 1

See repro here: https://godbolt.org/z/c1dG74EPd

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicaterejects-valid

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions