1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s 2*f4a2713aSLionel Sambuc #include <stddef.h> 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc struct A { operator newA5*f4a2713aSLionel Sambuc void *operator new(size_t) { 6*f4a2713aSLionel Sambuc return this; // expected-error {{invalid use of 'this' outside of a non-static member function}} 7*f4a2713aSLionel Sambuc } operator new[]A8*f4a2713aSLionel Sambuc void *operator new[](size_t) { 9*f4a2713aSLionel Sambuc return this; // expected-error {{invalid use of 'this' outside of a non-static member function}} 10*f4a2713aSLionel Sambuc } 11*f4a2713aSLionel Sambuc }; 12