brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · c439bc2 Raw
62 lines · cpp
1// Build with "cl.exe /Z7 /GR- /GS- /GX- every-class.cpp /link /debug:full /nodefaultlib /incremental:no /entry:main"2 3#include <stdint.h>4 5// clang-format off6void *__purecall = 0;7 8void __cdecl operator delete(void *, unsigned int) {}9void __cdecl operator delete(void *, unsigned __int64) {}10 11struct Nothing {};12struct Constructor { Constructor() {} };13struct Assignment {14  Assignment &operator=(Assignment Other) { return *this; }15};16struct Cast {17  operator int() { return 42; }18};19 20struct Nested {21  struct F {};22};23struct Operator {24  int operator+(int X) { return 42; }25};26 27class Class {};28 29union Union {};30 31enum class Enum {A};32 33 34template<typename T> void f(T t) {}35 36int main(int argc, char **argv) {37  struct Scoped {};38  39  struct { } Anonymous;40 41  f(Nothing{});42  f(Constructor{});43  f(Assignment{});44  f(Cast{});45  f(Nested{});46  f(Operator{});47  f(Nested::F{});48  f(Scoped{});49  f(Class{});50  f(Union{});51  f(Anonymous);52  f(Enum::A);53  54 55  f<const Nothing>(Nothing{});56  f<volatile Nothing>(Nothing{});57  f<const volatile Nothing>(Nothing{});58  f<__unaligned Nothing>(Nothing{});59 60  return 0;61}62