[HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations...
[llvm-project.git] / clang / test / CXX / basic / basic.stc / basic.stc.dynamic / basic.stc.dynamic.allocation / p1.cpp
blob3b77a62ce7d6f8832a232403212c4b1e50263305
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 #include <stddef.h>
4 struct A {
5 void *operator new(size_t);
6 };
8 namespace NS {
9 void *operator new(size_t);; // expected-error {{'operator new' cannot be declared inside a namespace}}
12 static void *operator new(size_t); // expected-error {{static declaration of 'operator new' follows non-static declaration}} expected-note {{previous}}
13 static void *operator new(size_t, int, int); // expected-error {{'operator new' cannot be declared static in global scope}}
15 struct B {
16 void operator new(size_t); // expected-error {{'operator new' must return type 'void *'}}
19 struct C {
20 void *operator new(); // expected-error {{'operator new' must have at least one parameter}}
23 struct D {
24 void *operator new(bool); // expected-error {{'operator new' takes type size_t}}
27 struct E {
28 void *operator new(size_t = 0); // expected-error {{parameter of 'operator new' cannot have a default argument}}
31 struct F {
32 template<typename T> void *operator new(size_t, int);
35 struct G {
36 template<typename T> T operator new(size_t, int); // expected-error {{'operator new' cannot have a dependent return type; use 'void *' instead}}
39 struct H {
40 template<typename T> void *operator new(T, int); // expected-error {{'operator new' cannot take a dependent type as first parameter; use size_t}}
43 struct I {
44 template<typename T> void *operator new(size_t); // expected-error {{'operator new' template must have at least two parameters}}