diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
| commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
| tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /test/SemaCXX/cxx2a-lambda-equals-this.cpp | |
| parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/cxx2a-lambda-equals-this.cpp')
| -rw-r--r-- | test/SemaCXX/cxx2a-lambda-equals-this.cpp | 12 |
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}} + }; + } +}; |
