[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / expr / expr.prim / expr.prim.lambda / p15-star-this-capture.cpp
blobbae1e25add352faed418cb68b5b9bcfd84ff6771
1 // RUN: %clang_cc1 -fsyntax-only -std=c++1z %s -verify
3 class NonCopyable {
4 NonCopyable(const NonCopyable&) = delete; //expected-note3{{explicitly marked deleted here}}
5 int x = 10;
6 void foo() {
7 auto L = [this] { return x; };
8 const auto &M = [*this] { return x; };//expected-error{{call to deleted}}
9 const auto &M2 = [this] () -> auto&& {
10 ++x;
11 return [*this] { //expected-error{{call to deleted}} expected-warning{{reference to local}}
12 return ++x; //expected-error{{read-only}}
13 };
15 const auto &M3 = [*this] () mutable -> auto&& { //expected-error{{call to deleted}}
16 ++x;
17 return [this] { // expected-warning{{reference to local}}
18 return x;
19 };