summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/this.cpp
blob: 0577d3c2b9bf1733f676c4afb84e25c91ee0264e (plain)
1
2
3
4
5
6
// RUN: clang-cc -fsyntax-only -verify %s 
int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}

void f() {
  int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
}
OpenPOWER on IntegriCloud