[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / expr / expr.prim / expr.prim.general / p4-0x.cpp
blob54b2ff52895a0a87bf3345af3d6fbf3136af2761
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 struct S {
4 S *p = this; // ok
5 decltype(this) q; // expected-error {{invalid use of 'this' outside of a non-static member function}}
7 int arr[sizeof(this)]; // expected-error {{invalid use of 'this' outside of a non-static member function}}
8 int sz = sizeof(this); // ok
10 typedef auto f() -> decltype(this); // expected-error {{invalid use of 'this' outside of a non-static member function}}
13 namespace CaptureThis {
14 struct X {
15 int n = 10;
16 int m = [&]{return n + 1; }();
17 int o = [&]{return this->m + 1; }();
18 int p = [&]{return [&](int x) { return this->m + x;}(o); }();
21 X x;