// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
typedef __SIZE_TYPE__ size_t;#if __cplusplus >= 201103L
structS1{void*operator new(size_t n){returnnullptr;// expected-warning {{'operator new' should not return a null pointer unless it is declared 'throw()' or 'noexcept'}}
}void*operator new[](size_t n)noexcept{return __null;}};#endifstructS2{staticsize_t x;void*operator new(size_t n)throw(){return0;}void*operator new[](size_t n){return(void*)0;#if __cplusplus >= 201103L
// expected-warning@-2 {{'operator new[]' should not return a null pointer unless it is declared 'throw()' or 'noexcept'}}
#else// expected-warning-re@-4 {{'operator new[]' should not return a null pointer unless it is declared 'throw()'{{$}}}}
#endif}};structS3{void*operator new(size_t n){return1-1;#if __cplusplus >= 201103L
// expected-error@-2 {{cannot initialize return object of type 'void *' with an rvalue of type 'int'}}
#else// expected-warning@-4 {{expression which evaluates to zero treated as a null pointer constant of type 'void *'}}
// expected-warning@-5 {{'operator new' should not return a null pointer unless it is declared 'throw()'}}
#endif}void*operator new[](size_t n){return(void*)(1-1);// expected-warning {{'operator new[]' should not return a null pointer unless it is declared 'throw()'}}
}};#if __cplusplus >= 201103L
template<bool B>structS4{void*operator new(size_t n)noexcept(B){return0;// expected-warning {{'operator new' should not return a null pointer}}
}};templatestruct S4<true>;templatestruct S4<false>;// expected-note {{in instantiation of}}
#endiftemplate<typename...T>structS5{// expected-warning 0-1{{extension}}
void*operator new(size_t n)throw(T...){return0;// expected-warning {{'operator new' should not return a null pointer}}
}};templatestruct S5<>;templatestruct S5<int>;// expected-note {{in instantiation of}}