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