p1.cpp revision 67bf2e7706b82d5debd5c189d9454130df7db0d8
1// RUN: clang-cc -fsyntax-only -verify %s
2#include <stddef.h>
3
4struct A {
5  void *operator new(size_t) {
6    return this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
7  }
8  void *operator new[](size_t) {
9    return this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
10  }
11};
12