YouCompleteMe/cpp/llvm/tools/clang/test/SemaCXX/this.cpp

7 lines
257 B
C++
Raw Normal View History

// RUN: %clang_cc1 -fsyntax-only -verify %s
int x = this; // expected-error {{invalid use of 'this' outside of a non-static member function}}
void f() {
int x = this; // expected-error {{invalid use of 'this' outside of a non-static member function}}
}