llvm-capstone/clang/test/SemaTemplate/sizeof-pack.cpp
Richard Smith b2997f579a [c++20] P0780R2: Support pack-expansion of init-captures.
This permits an init-capture to introduce a new pack:

  template<typename ...T> auto x = [...a = T()] { /* a is a pack */ };

To support this, the mechanism for allowing ParmVarDecls to be packs has
been extended to support arbitrary local VarDecls.

llvm-svn: 361300
2019-05-21 20:10:50 +00:00

14 lines
267 B
C++

// RUN: %clang_cc1 -std=c++11 -verify %s
template<int &...Ns> int f() {
return sizeof...(Ns);
}
template int f<>();
template<typename ...T> int g() {
return [...x = T()] { // expected-warning 2{{extension}}
return sizeof...(x);
}();
}
template int g<>();