Lines Matching full:new

1 // RUN: %check_clang_tidy -std=c++11 -check-suffixes=ALL,CPP11 %s bugprone-multiple-new-in-one-expr…
2 // RUN: %check_clang_tidy -std=c++17 -check-suffixes=ALL,CPP17 %s bugprone-multiple-new-in-one-expr…
13 void *operator new(std::size_t, const std::nothrow_t &) noexcept;
14 void *operator new(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept;
15 void *operator new(std::size_t, void *) noexcept;
16 void *operator new(std::size_t, char);
47 (void)f(new A, new B); in test_function_parameter()
49 (void)f(new A, new B); in test_function_parameter()
53 (void)f(new A, new B); in test_function_parameter()
55 (void)f(f(new A, new B)); in test_function_parameter()
57 int X = f(new A, new B); in test_function_parameter()
59 X = f(new A, new B); in test_function_parameter()
61 X = 1 + f(new A, new B); in test_function_parameter()
64 (void)f(g(new A), new B); in test_function_parameter()
67 (void)f(1 + f(new A), new B); in test_function_parameter()
69 (void)f(XA = new A, new B); in test_function_parameter()
71 (void)f(1 + f(new A), XB = new B); in test_function_parameter()
78 (void)(f(new A) + f(new B)); in test_operator()
80 (void)(f(new A) + f(new B)); in test_operator()
82 (void)f(f(new A) + f(new B)); in test_operator()
84 int X = f(new A) + f(new B); in test_operator()
86 X = f(new A) + f(new B); in test_operator()
88 X = 1 + f(new A) + 1 + f(new B); in test_operator()
91 (void)(f(g(new A)) + f(new B)); in test_operator()
94 (void)(f(1 + f(new A)) + f(new B)); in test_operator()
96 (void)(f(1 + f(new A)) + f(1 + f(new B))); in test_operator()
99 (void)((new A)->VarI + (new A)->VarI); in test_operator()
101 (void)(f(new A) + ((*G1) += new A)); in test_operator()
108 (void)(G(new A, new B)); in test_construct()
110 (void)(G(new A, new B)); in test_construct()
112 (void)(G(new A, nullptr) + G(nullptr, new B)); in test_construct()
114 f(G(new A, nullptr), G(new A, nullptr)); in test_construct()
117 (void)new G(new A, nullptr); in test_construct()
120 (void)new G(nullptr, (new A)->PtrB); in test_construct()
121 G *Z = new G(new A, nullptr); in test_construct()
124 Z = new G(g(new A), nullptr); in test_construct()
127 G *Z1, *Z2 = new G(nullptr, (new A)->PtrB), *Z3; in test_construct()
136 (X = new A)->VarI = (Y = new A)->VarI; in test_new_assign()
138 (X = new A)->VarI = (Y = new A)->VarI; in test_new_assign()
140 (new A)->VarI = (Y = new A)->VarI; in test_new_assign()
142 (X = new A)->VarI = (new A)->VarI; in test_new_assign()
144 (new A)->VarI = (new A)->VarI; in test_new_assign()
145 (new A)->PtrI = new int; in test_new_assign()
147 (X = new A)->VarI += (new A)->VarI; in test_new_assign()
154 (void)(f((f(new A) || f(0)) + f(new B[L]))); in test_operator_fixed_order()
156 (void)(f(new A) || f(new B)); in test_operator_fixed_order()
157 (void)(f(new A) && f(new B)); in test_operator_fixed_order()
158 (void)(f(new A) || f(new B) || f(new A)); in test_operator_fixed_order()
160 (void)(f(new A), f(new B)); in test_operator_fixed_order()
162 int Y = f(0, new B) ? f(new A) : f(new B); in test_operator_fixed_order()
163 Y = f(new A) ? 1 : f(new B); in test_operator_fixed_order()
164 Y = f(new A) ? f(new B) : 1; in test_operator_fixed_order()
166 G g{new A, new B}; in test_operator_fixed_order()
167 H h{new int, new int}; in test_operator_fixed_order()
168 f({new int, new int}); in test_operator_fixed_order()
169 (void)f({new A, new B}, {nullptr, nullptr}); in test_operator_fixed_order()
170 (void)f({new A, new B}, {new A, nullptr}); in test_operator_fixed_order()
173 (void)(f((f(new A) || f(0)) + f(new B[L]))); in test_operator_fixed_order()
181 f1(static_cast<void *>(new A), new B); in test_cast()
189 (void)f(new(std::nothrow) A, new B); in test_nothrow()
190 (void)f(new A, new(std::nothrow) B); in test_nothrow()
191 (void)f(new(static_cast<std::align_val_t>(8), std::nothrow) A, new B); in test_nothrow()
192 (void)f(new(P) A, new B); in test_nothrow()
193 (void)f(new('a') A, new B); in test_nothrow()