summaryrefslogtreecommitdiff
path: root/test/SemaCXX/this.cpp
blob: 27ee1e84a7079707585a1003426b3beeb00e1011 (plain)
1
2
3
4
5
6
// 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}}
}