diff options
Diffstat (limited to 'test/SemaCXX/this.cpp')
-rw-r--r-- | test/SemaCXX/this.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/this.cpp b/test/SemaCXX/this.cpp new file mode 100644 index 0000000..0577d3c --- /dev/null +++ b/test/SemaCXX/this.cpp @@ -0,0 +1,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}} +} |