Files
clang-p2996/clang/test/SemaCXX/pr61460.cpp
Younan Zhang 868007a03c [clang][Sema] Avoid non-empty unexpanded pack assertion for FunctionParmPackExpr (#69224)
Closes https://github.com/llvm/llvm-project/issues/61460.

We have FunctionParmPackExpr that serves as the unexpanded expression
but from which the visitor collects none, which may lead to assertion
failure during the template instantiation.
2023-11-13 12:44:17 +08:00

14 lines
355 B
C++

// RUN: %clang_cc1 -std=c++17 %s -fsyntax-only -verify
template <typename... Ts> void g(Ts... p1s) {
(void)[&](auto... p2s) { ([&] { p1s; p2s; }, ...); };
}
void f1() {
g();
}
template <typename... Ts> void g2(Ts... p1s) {
(void)[&](auto... p2s) { [&] { p1s; p2s; }; }; // expected-error {{expression contains unexpanded parameter pack 'p2s'}}
}