MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / main

Function main

tests/ClassOperatorHandler6Test.cpp:81–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80
81int main()
82{
83 Foo f1{1};
84 Foo f2{2};
85
86 const bool b = f1 == f2;
87 void *t;
88
89 if( b ) {
90 return 0;
91 } else {
92 return 1;
93 }
94
95 // PredefinedExpr
96 const bool b2 = f1 == __func__;
97
98 // CXXTypeidExpr
99 const bool b3 = f1 == typeid(f2);
100
101 // GNUNullExpr
102 const bool b4 = f1 == __null;
103
104 // NullptrExpr
105 const bool b5 = f1 == (t == nullptr);
106
107 // CXXNamedCastExpr
108 unsigned long l = 2;
109 const bool b6 = f1 == static_cast<int>(l);
110
111 // CXXNamedCastExpr
112 const bool b7 = f1 == dynamic_cast<Bar*>(&f2);
113
114
115 // ExplicitCastExpr
116 const bool b8 = f1 == (char*)t;
117
118 // ExplicitCastExpr
119 const bool b9 = f1 == new char[2];
120 const bool b10 = f1 == new char[2] { 1, 2};
121
122 char buffer[1024];
123 const bool b11 = f1 == new (buffer) char[2] { 1, 2};
124
125 const bool b12 = f1 == new Woo{ 1, 'a'};
126
127 const bool b13 = f1 == Woo{ 1, 'a'};
128
129 // thould trigger thisExpr
130 Foo f3{'c'};
131}
132

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected