Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / lambda-pack-expansion.cpp
blob936e7c6b0e5c5ad982f165d86cfda85abf7f2143
1 // RUN: %clang_cc1 -std=c++20 -Wno-unused-value -fsyntax-only -verify %s
3 namespace GH49266 {
4 struct X {
5 X() = default;
6 X(X const&) = delete; // expected-note {{'X' has been explicitly marked deleted here}}
7 };
9 void take_by_copy(auto &...args) {
10 [...args = args] {}(); // expected-error {{call to deleted constructor}}
11 // expected-note@-1 {{substituting into a lambda}}
14 void take_by_ref(auto &...args) {
15 [&...args = args] {}(); // args is passed by reference and not copied.
18 void foo() {
19 X x;
20 take_by_copy(x); // expected-note {{in instantiation of function template specialization}}
21 take_by_ref(x);