aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx2a-lambda-equals-this.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
commit486754660bb926339aefcf012a3f848592babb8b (patch)
treeecdbc446c9876f4f120f701c243373cd3cb43db3 /test/SemaCXX/cxx2a-lambda-equals-this.cpp
parent55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff)
Notes
Diffstat (limited to 'test/SemaCXX/cxx2a-lambda-equals-this.cpp')
-rw-r--r--test/SemaCXX/cxx2a-lambda-equals-this.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/SemaCXX/cxx2a-lambda-equals-this.cpp b/test/SemaCXX/cxx2a-lambda-equals-this.cpp
index ce6916322e5d..652fb8da9b6d 100644
--- a/test/SemaCXX/cxx2a-lambda-equals-this.cpp
+++ b/test/SemaCXX/cxx2a-lambda-equals-this.cpp
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -std=c++2a -verify %s
-// expected-no-diagnostics
+// RUN: %clang_cc1 -std=c++2a -verify %s -Wdeprecated
// This test does two things.
// Deleting the copy constructor ensures that an [=, this] capture doesn't copy the object.
@@ -13,3 +12,12 @@ class A {
L();
}
};
+
+struct B {
+ int i;
+ void f() {
+ (void) [=] { // expected-note {{add an explicit capture of 'this'}}
+ return i; // expected-warning {{implicit capture of 'this' with a capture default of '=' is deprecated}}
+ };
+ }
+};