1 // Build with "cl.exe /Zi /GR- /GX- every-pointer.cpp /link /debug /nodefaultlib /incremental:no /entry:main" 2 3 #include <stdint.h> 4 5 // clang-format off 6 void *__purecall = 0; 7 operator delete(void *,unsigned int)8void __cdecl operator delete(void *,unsigned int) {} operator delete(void *,unsigned __int64)9void __cdecl operator delete(void *,unsigned __int64) {} 10 11 12 struct Foo { 13 int X = 0; funcFoo14 int func() { return 42; } 15 }; 16 17 int *IntP = nullptr; 18 Foo *FooP = nullptr; 19 20 Foo F; 21 22 Foo __unaligned *UFooP = &F; 23 Foo * __restrict RFooP = &F; 24 25 const Foo * CFooP = &F; 26 volatile Foo * VFooP = &F; 27 const volatile Foo * CVFooP = &F; 28 f(T t)29template<typename T> void f(T t) {} 30 main(int argc,char ** argv)31int main(int argc, char **argv) { 32 f<int*>(IntP); 33 f<Foo*>(FooP); 34 35 f<Foo __unaligned *>(UFooP); 36 f<Foo *__restrict>(RFooP); 37 38 f<const Foo*>(CFooP); 39 f<volatile Foo*>(VFooP); 40 f<const volatile Foo*>(CVFooP); 41 42 f<Foo&>(F); 43 f<Foo&&>(static_cast<Foo&&>(F)); 44 45 f(&Foo::X); 46 f(&Foo::func); 47 return 0; 48 } 49