diff options
Diffstat (limited to 'test/CXX/special/class.free/p6.cpp')
| -rw-r--r-- | test/CXX/special/class.free/p6.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CXX/special/class.free/p6.cpp b/test/CXX/special/class.free/p6.cpp new file mode 100644 index 000000000000..8334817ca2b5 --- /dev/null +++ b/test/CXX/special/class.free/p6.cpp @@ -0,0 +1,11 @@ +// RUN: clang-cc -fsyntax-only -verify %s +#include <stddef.h> + +struct A { + void operator delete(size_t) { + (void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + } + void operator delete[](void*) { + (void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + } +}; |
