Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / cxx2a-lambda-equals-this.cpp
blobce6916322e5d1c797356f901a4f394ddb557241c
1 // RUN: %clang_cc1 -std=c++2a -verify %s
2 // expected-no-diagnostics
4 // This test does two things.
5 // Deleting the copy constructor ensures that an [=, this] capture doesn't copy the object.
6 // Accessing a member variable from the lambda ensures that the capture actually works.
7 class A {
8 A(const A &) = delete;
9 int i;
11 void func() {
12 auto L = [=, this]() -> int { return i; };
13 L();