1 // RUN: rm -f %t
2 // RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-temporary-dtors=true -std=c++98 %s > %t 2>&1
3 // RUN: FileCheck --input-file=%t -check-prefix=CXX98 -check-prefix=CHECK %s
4 // RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-temporary-dtors=true -std=c++11 %s > %t 2>&1
5 // RUN: FileCheck --input-file=%t -check-prefix=CXX11 -check-prefix=CHECK %s
6
7 class A {
8 public:
A()9 A() {}
~A()10 ~A() {}
11
make()12 static A make() { return A(); }
13
operator bool()14 operator bool() { return false; }
operator int()15 operator int() { return 0; }
16 };
17
18 class B {
19 public:
B()20 B() {}
~B()21 ~B() {}
22
operator bool()23 operator bool() { return true; }
operator int()24 operator int() { return 1; }
operator A()25 operator A() { return A(); }
26 };
27
28 void foo(int);
29 void foo(bool);
30 void foo(const A&);
31
test_binary()32 void test_binary() {
33 int a = int(A()) + int(B());
34 foo(int(A()) + int(B()));
35 int b;
36 }
37
test_and()38 void test_and() {
39 bool a = A() && B();
40 foo(A() && B());
41 int b;
42 }
43
test_or()44 void test_or() {
45 bool a = A() || B();
46 foo(A() || B());
47 int b;
48 }
49
test_cond()50 void test_cond() {
51 A a = B() ? A() : A(B());
52 if (B()) { foo(0); } else { foo(0); }
53 int b;
54 }
55
56 struct C {
CC57 C():b_(true) {}
~CC58 ~C() {}
59
operator boolC60 operator bool() { return b_; }
61 bool b_;
62 };
63
64 struct D {
DD65 D():b_(true) {}
66
operator boolD67 operator bool() { return b_; }
68 bool b_;
69 };
70
test_cond_unnamed_custom_destructor()71 int test_cond_unnamed_custom_destructor() {
72 if (C()) { return 1; } else { return 0; }
73 }
74
test_cond_named_custom_destructor()75 int test_cond_named_custom_destructor() {
76 if (C c = C()) { return 1; } else { return 0; }
77 }
78
test_cond_unnamed_auto_destructor()79 int test_cond_unnamed_auto_destructor() {
80 if (D()) { return 1; } else { return 0; }
81 }
82
test_cond_named_auto_destructor()83 int test_cond_named_auto_destructor() {
84 if (D d = D()) { return 1; } else { return 0; }
85 }
86
test_cond_cref()87 void test_cond_cref() {
88 const A& a = B() ? A() : A(B());
89 foo(B() ? A() : A(B()));
90 int b;
91 }
92
test_cond_implicit()93 void test_cond_implicit() {
94 A a = A() ?: A();
95 int b;
96 }
97
test_cond_implicit_cref()98 void test_cond_implicit_cref() {
99 const A& a = A() ?: A();
100 foo(A() ?: A());
101 int b;
102 }
103
test_copy_init()104 void test_copy_init() {
105 A a = A();
106 int b;
107 }
108
test_cref_init()109 void test_cref_init() {
110 const A& a = A();
111 foo(A());
112 int b;
113 }
114
test_call_copy_init()115 void test_call_copy_init() {
116 A a = A::make();
117 int b;
118 }
119
test_call_cref_init()120 void test_call_cref_init() {
121 const A& a = A::make();
122 foo(A::make());
123 int b;
124 }
125
test_assign()126 void test_assign() {
127 int a;
128 a = A();
129 int b;
130 }
131
132 class TestCtorInits {
133 int a;
134 int b;
135 public:
136 TestCtorInits();
137 };
138
TestCtorInits()139 TestCtorInits::TestCtorInits()
140 : a(int(A()) + int(B()))
141 , b() {}
142
143 class NoReturn {
144 public:
145 ~NoReturn() __attribute__((noreturn));
146 void f();
147 };
148
test_noreturn1()149 void test_noreturn1() {
150 int a;
151 NoReturn().f();
152 int b;
153 }
154
test_noreturn2()155 void test_noreturn2() {
156 int a;
157 NoReturn(), 47;
158 int b;
159 }
160
161 extern bool check(const NoReturn&);
162
163 // PR16664 and PR18159
testConsistencyNestedSimple(bool value)164 int testConsistencyNestedSimple(bool value) {
165 if (value) {
166 if (!value || check(NoReturn())) {
167 return 1;
168 }
169 }
170 return 0;
171 }
172
173 // PR16664 and PR18159
testConsistencyNestedComplex(bool value)174 int testConsistencyNestedComplex(bool value) {
175 if (value) {
176 if (!value || !value || check(NoReturn())) {
177 return 1;
178 }
179 }
180 return 0;
181 }
182
183 // PR16664 and PR18159
testConsistencyNestedNormalReturn(bool value)184 int testConsistencyNestedNormalReturn(bool value) {
185 if (value) {
186 if (!value || value || check(NoReturn())) {
187 return 1;
188 }
189 }
190 return 0;
191 }
192
193 // CHECK: [B1 (ENTRY)]
194 // CHECK: Succs (1): B0
195 // CHECK: [B0 (EXIT)]
196 // CHECK: Preds (1): B1
197 // CHECK: [B1 (ENTRY)]
198 // CHECK: Succs (1): B0
199 // CHECK: [B0 (EXIT)]
200 // CHECK: Preds (1): B1
201 // CHECK: [B2 (ENTRY)]
202 // CHECK: Succs (1): B1
203 // CHECK: [B1]
204 // CHECK: 1: A() (CXXConstructExpr, class A)
205 // CHECK: 2: [B1.1] (BindTemporary)
206 // CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
207 // CHECK: 4: [B1.3]
208 // CHECK: 5: [B1.4] (CXXConstructExpr, class A)
209 // CHECK: 6: ~A() (Temporary object destructor)
210 // CHECK: 7: return [B1.5];
211 // CHECK: Preds (1): B2
212 // CHECK: Succs (1): B0
213 // CHECK: [B0 (EXIT)]
214 // CHECK: Preds (1): B1
215 // CHECK: [B2 (ENTRY)]
216 // CHECK: Succs (1): B1
217 // CHECK: [B1]
218 // CHECK: 1: false
219 // CHECK: 2: return [B1.1];
220 // CHECK: Preds (1): B2
221 // CHECK: Succs (1): B0
222 // CHECK: [B0 (EXIT)]
223 // CHECK: Preds (1): B1
224 // CHECK: [B2 (ENTRY)]
225 // CHECK: Succs (1): B1
226 // CHECK: [B1]
227 // CHECK: 1: 0
228 // CHECK: 2: return [B1.1];
229 // CHECK: Preds (1): B2
230 // CHECK: Succs (1): B0
231 // CHECK: [B0 (EXIT)]
232 // CHECK: Preds (1): B1
233 // CHECK: [B1 (ENTRY)]
234 // CHECK: Succs (1): B0
235 // CHECK: [B0 (EXIT)]
236 // CHECK: Preds (1): B1
237 // CHECK: [B1 (ENTRY)]
238 // CHECK: Succs (1): B0
239 // CHECK: [B0 (EXIT)]
240 // CHECK: Preds (1): B1
241 // CHECK: [B2 (ENTRY)]
242 // CHECK: Succs (1): B1
243 // CHECK: [B1]
244 // CHECK: 1: true
245 // CHECK: 2: return [B1.1];
246 // CHECK: Preds (1): B2
247 // CHECK: Succs (1): B0
248 // CHECK: [B0 (EXIT)]
249 // CHECK: Preds (1): B1
250 // CHECK: [B2 (ENTRY)]
251 // CHECK: Succs (1): B1
252 // CHECK: [B1]
253 // CHECK: 1: 1
254 // CHECK: 2: return [B1.1];
255 // CHECK: Preds (1): B2
256 // CHECK: Succs (1): B0
257 // CHECK: [B0 (EXIT)]
258 // CHECK: Preds (1): B1
259 // CHECK: [B2 (ENTRY)]
260 // CHECK: Succs (1): B1
261 // CHECK: [B1]
262 // CHECK: 1: A() (CXXConstructExpr, class A)
263 // CHECK: 2: [B1.1] (BindTemporary)
264 // CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
265 // CHECK: 4: [B1.3]
266 // CHECK: 5: [B1.4] (CXXConstructExpr, class A)
267 // CHECK: 6: ~A() (Temporary object destructor)
268 // CHECK: 7: return [B1.5];
269 // CHECK: Preds (1): B2
270 // CHECK: Succs (1): B0
271 // CHECK: [B0 (EXIT)]
272 // CHECK: Preds (1): B1
273 // CHECK: [B2 (ENTRY)]
274 // CHECK: Succs (1): B1
275 // CHECK: [B1]
276 // CHECK: 1: A() (CXXConstructExpr, class A)
277 // CHECK: 2: [B1.1] (BindTemporary)
278 // CHECK: 3: [B1.2].operator int
279 // CHECK: 4: [B1.2]
280 // CHECK: 5: [B1.4] (ImplicitCastExpr, UserDefinedConversion, int)
281 // CHECK: 6: int([B1.5]) (CXXFunctionalCastExpr, NoOp, int)
282 // CHECK: 7: B() (CXXConstructExpr, class B)
283 // CHECK: 8: [B1.7] (BindTemporary)
284 // CHECK: 9: [B1.8].operator int
285 // CHECK: 10: [B1.8]
286 // CHECK: 11: [B1.10] (ImplicitCastExpr, UserDefinedConversion, int)
287 // CHECK: 12: int([B1.11]) (CXXFunctionalCastExpr, NoOp, int)
288 // CHECK: 13: [B1.6] + [B1.12]
289 // CHECK: 14: int a = int(A()) + int(B());
290 // CHECK: 15: ~B() (Temporary object destructor)
291 // CHECK: 16: ~A() (Temporary object destructor)
292 // CHECK: 17: foo
293 // CHECK: 18: [B1.17] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
294 // CHECK: 19: A() (CXXConstructExpr, class A)
295 // CHECK: 20: [B1.19] (BindTemporary)
296 // CHECK: 21: [B1.20].operator int
297 // CHECK: 22: [B1.20]
298 // CHECK: 23: [B1.22] (ImplicitCastExpr, UserDefinedConversion, int)
299 // CHECK: 24: int([B1.23]) (CXXFunctionalCastExpr, NoOp, int)
300 // CHECK: 25: B() (CXXConstructExpr, class B)
301 // CHECK: 26: [B1.25] (BindTemporary)
302 // CHECK: 27: [B1.26].operator int
303 // CHECK: 28: [B1.26]
304 // CHECK: 29: [B1.28] (ImplicitCastExpr, UserDefinedConversion, int)
305 // CHECK: 30: int([B1.29]) (CXXFunctionalCastExpr, NoOp, int)
306 // CHECK: 31: [B1.24] + [B1.30]
307 // CHECK: 32: [B1.18]([B1.31])
308 // CHECK: 33: ~B() (Temporary object destructor)
309 // CHECK: 34: ~A() (Temporary object destructor)
310 // CHECK: 35: int b;
311 // CHECK: Preds (1): B2
312 // CHECK: Succs (1): B0
313 // CHECK: [B0 (EXIT)]
314 // CHECK: Preds (1): B1
315 // CHECK: [B10 (ENTRY)]
316 // CHECK: Succs (1): B9
317 // CHECK: [B1]
318 // CHECK: 1: ~A() (Temporary object destructor)
319 // CHECK: 2: int b;
320 // CHECK: Preds (2): B2 B3
321 // CHECK: Succs (1): B0
322 // CHECK: [B2]
323 // CHECK: 1: ~B() (Temporary object destructor)
324 // CHECK: Preds (1): B3
325 // CHECK: Succs (1): B1
326 // CHECK: [B3]
327 // CHECK: 1: [B5.8] && [B4.5]
328 // CHECK: 2: [B5.3]([B3.1])
329 // CHECK: T: (Temp Dtor) [B4.2]
330 // CHECK: Preds (2): B4 B5
331 // CHECK: Succs (2): B2 B1
332 // CHECK: [B4]
333 // CHECK: 1: B() (CXXConstructExpr, class B)
334 // CHECK: 2: [B4.1] (BindTemporary)
335 // CHECK: 3: [B4.2].operator bool
336 // CHECK: 4: [B4.2]
337 // CHECK: 5: [B4.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
338 // CHECK: Preds (1): B5
339 // CHECK: Succs (1): B3
340 // CHECK: [B5]
341 // CHECK: 1: ~A() (Temporary object destructor)
342 // CHECK: 2: foo
343 // CHECK: 3: [B5.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(_Bool))
344 // CHECK: 4: A() (CXXConstructExpr, class A)
345 // CHECK: 5: [B5.4] (BindTemporary)
346 // CHECK: 6: [B5.5].operator bool
347 // CHECK: 7: [B5.5]
348 // CHECK: 8: [B5.7] (ImplicitCastExpr, UserDefinedConversion, _Bool)
349 // CHECK: T: [B5.8] && ...
350 // CHECK: Preds (2): B6 B7
351 // CHECK: Succs (2): B4 B3
352 // CHECK: [B6]
353 // CHECK: 1: ~B() (Temporary object destructor)
354 // CHECK: Preds (1): B7
355 // CHECK: Succs (1): B5
356 // CHECK: [B7]
357 // CHECK: 1: [B9.5] && [B8.5]
358 // CHECK: 2: bool a = A() && B();
359 // CHECK: T: (Temp Dtor) [B8.2]
360 // CHECK: Preds (2): B8 B9
361 // CHECK: Succs (2): B6 B5
362 // CHECK: [B8]
363 // CHECK: 1: B() (CXXConstructExpr, class B)
364 // CHECK: 2: [B8.1] (BindTemporary)
365 // CHECK: 3: [B8.2].operator bool
366 // CHECK: 4: [B8.2]
367 // CHECK: 5: [B8.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
368 // CHECK: Preds (1): B9
369 // CHECK: Succs (1): B7
370 // CHECK: [B9]
371 // CHECK: 1: A() (CXXConstructExpr, class A)
372 // CHECK: 2: [B9.1] (BindTemporary)
373 // CHECK: 3: [B9.2].operator bool
374 // CHECK: 4: [B9.2]
375 // CHECK: 5: [B9.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
376 // CHECK: T: [B9.5] && ...
377 // CHECK: Preds (1): B10
378 // CHECK: Succs (2): B8 B7
379 // CHECK: [B0 (EXIT)]
380 // CHECK: Preds (1): B1
381 // CHECK: [B10 (ENTRY)]
382 // CHECK: Succs (1): B9
383 // CHECK: [B1]
384 // CHECK: 1: ~A() (Temporary object destructor)
385 // CHECK: 2: int b;
386 // CHECK: Preds (2): B2 B3
387 // CHECK: Succs (1): B0
388 // CHECK: [B2]
389 // CHECK: 1: ~B() (Temporary object destructor)
390 // CHECK: Preds (1): B3
391 // CHECK: Succs (1): B1
392 // CHECK: [B3]
393 // CHECK: 1: [B5.8] || [B4.5]
394 // CHECK: 2: [B5.3]([B3.1])
395 // CHECK: T: (Temp Dtor) [B4.2]
396 // CHECK: Preds (2): B4 B5
397 // CHECK: Succs (2): B2 B1
398 // CHECK: [B4]
399 // CHECK: 1: B() (CXXConstructExpr, class B)
400 // CHECK: 2: [B4.1] (BindTemporary)
401 // CHECK: 3: [B4.2].operator bool
402 // CHECK: 4: [B4.2]
403 // CHECK: 5: [B4.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
404 // CHECK: Preds (1): B5
405 // CHECK: Succs (1): B3
406 // CHECK: [B5]
407 // CHECK: 1: ~A() (Temporary object destructor)
408 // CHECK: 2: foo
409 // CHECK: 3: [B5.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(_Bool))
410 // CHECK: 4: A() (CXXConstructExpr, class A)
411 // CHECK: 5: [B5.4] (BindTemporary)
412 // CHECK: 6: [B5.5].operator bool
413 // CHECK: 7: [B5.5]
414 // CHECK: 8: [B5.7] (ImplicitCastExpr, UserDefinedConversion, _Bool)
415 // CHECK: T: [B5.8] || ...
416 // CHECK: Preds (2): B6 B7
417 // CHECK: Succs (2): B3 B4
418 // CHECK: [B6]
419 // CHECK: 1: ~B() (Temporary object destructor)
420 // CHECK: Preds (1): B7
421 // CHECK: Succs (1): B5
422 // CHECK: [B7]
423 // CHECK: 1: [B9.5] || [B8.5]
424 // CHECK: 2: bool a = A() || B();
425 // CHECK: T: (Temp Dtor) [B8.2]
426 // CHECK: Preds (2): B8 B9
427 // CHECK: Succs (2): B6 B5
428 // CHECK: [B8]
429 // CHECK: 1: B() (CXXConstructExpr, class B)
430 // CHECK: 2: [B8.1] (BindTemporary)
431 // CHECK: 3: [B8.2].operator bool
432 // CHECK: 4: [B8.2]
433 // CHECK: 5: [B8.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
434 // CHECK: Preds (1): B9
435 // CHECK: Succs (1): B7
436 // CHECK: [B9]
437 // CHECK: 1: A() (CXXConstructExpr, class A)
438 // CHECK: 2: [B9.1] (BindTemporary)
439 // CHECK: 3: [B9.2].operator bool
440 // CHECK: 4: [B9.2]
441 // CHECK: 5: [B9.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
442 // CHECK: T: [B9.5] || ...
443 // CHECK: Preds (1): B10
444 // CHECK: Succs (2): B7 B8
445 // CHECK: [B0 (EXIT)]
446 // CHECK: Preds (1): B1
447 // CHECK: [B11 (ENTRY)]
448 // CHECK: Succs (1): B10
449 // CHECK: [B1]
450 // CHECK: 1: int b;
451 // CHECK: 2: [B7.5].~A() (Implicit destructor)
452 // CHECK: Preds (2): B2 B3
453 // CHECK: Succs (1): B0
454 // CHECK: [B2]
455 // CHECK: 1: foo
456 // CHECK: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
457 // CHECK: 3: 0
458 // CHECK: 4: [B2.2]([B2.3])
459 // CHECK: Preds (1): B4
460 // CHECK: Succs (1): B1
461 // CHECK: [B3]
462 // CHECK: 1: foo
463 // CHECK: 2: [B3.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
464 // CHECK: 3: 0
465 // CHECK: 4: [B3.2]([B3.3])
466 // CHECK: Preds (1): B4
467 // CHECK: Succs (1): B1
468 // CHECK: [B4]
469 // CHECK: 1: ~B() (Temporary object destructor)
470 // CHECK: 2: B() (CXXConstructExpr, class B)
471 // CHECK: 3: [B4.2] (BindTemporary)
472 // CHECK: 4: [B4.3].operator bool
473 // CHECK: 5: [B4.3]
474 // CHECK: 6: [B4.5] (ImplicitCastExpr, UserDefinedConversion, _Bool)
475 // CHECK: 7: ~B() (Temporary object destructor)
476 // CHECK: T: if [B4.6]
477 // CHECK: Preds (2): B5 B6
478 // CHECK: Succs (2): B3 B2
479 // CHECK: [B5]
480 // CHECK: 1: ~A() (Temporary object destructor)
481 // CHECK: 2: ~A() (Temporary object destructor)
482 // CHECK: Preds (1): B7
483 // CHECK: Succs (1): B4
484 // CHECK: [B6]
485 // CHECK: 1: ~A() (Temporary object destructor)
486 // CHECK: 2: ~A() (Temporary object destructor)
487 // CHECK: 3: ~A() (Temporary object destructor)
488 // CHECK: 4: ~B() (Temporary object destructor)
489 // CHECK: Preds (1): B7
490 // CHECK: Succs (1): B4
491 // CHECK: [B7]
492 // CHECK: 1: [B10.5] ? [B8.6] : [B9.15]
493 // CHECK: 2: [B7.1] (ImplicitCastExpr, NoOp, const class A)
494 // CHECK: 3: [B7.2]
495 // CHECK: 4: [B7.3] (CXXConstructExpr, class A)
496 // CHECK: 5: A a = B() ? A() : A(B());
497 // CHECK: T: (Temp Dtor) [B9.2]
498 // CHECK: Preds (2): B8 B9
499 // CHECK: Succs (2): B6 B5
500 // CHECK: [B8]
501 // CHECK: 1: A() (CXXConstructExpr, class A)
502 // CHECK: 2: [B8.1] (BindTemporary)
503 // CHECK: 3: [B8.2] (ImplicitCastExpr, NoOp, const class A)
504 // CHECK: 4: [B8.3]
505 // CHECK: 5: [B8.4] (CXXConstructExpr, class A)
506 // CHECK: 6: [B8.5] (BindTemporary)
507 // CHECK: Preds (1): B10
508 // CHECK: Succs (1): B7
509 // CHECK: [B9]
510 // CHECK: 1: B() (CXXConstructExpr, class B)
511 // CHECK: 2: [B9.1] (BindTemporary)
512 // CHECK: 3: [B9.2].operator A
513 // CHECK: 4: [B9.2]
514 // CHECK: 5: [B9.4] (ImplicitCastExpr, UserDefinedConversion, class A)
515 // CHECK: 6: [B9.5] (BindTemporary)
516 // CHECK: 7: [B9.6] (ImplicitCastExpr, NoOp, const class A)
517 // CHECK: 8: [B9.7]
518 // CHECK: 9: [B9.8] (CXXConstructExpr, class A)
519 // CHECK: 10: [B9.9] (BindTemporary)
520 // CHECK: 11: A([B9.10]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
521 // CHECK: 12: [B9.11] (ImplicitCastExpr, NoOp, const class A)
522 // CHECK: 13: [B9.12]
523 // CHECK: 14: [B9.13] (CXXConstructExpr, class A)
524 // CHECK: 15: [B9.14] (BindTemporary)
525 // CHECK: Preds (1): B10
526 // CHECK: Succs (1): B7
527 // CHECK: [B10]
528 // CHECK: 1: B() (CXXConstructExpr, class B)
529 // CHECK: 2: [B10.1] (BindTemporary)
530 // CHECK: 3: [B10.2].operator bool
531 // CHECK: 4: [B10.2]
532 // CHECK: 5: [B10.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
533 // CHECK: T: [B10.5] ? ... : ...
534 // CHECK: Preds (1): B11
535 // CHECK: Succs (2): B8 B9
536 // CHECK: [B0 (EXIT)]
537 // CHECK: Preds (1): B1
538 // CHECK: [B2 (ENTRY)]
539 // CHECK: Succs (1): B1
540 // CHECK: [B1]
541 // CHECK: 1: true
542 // CHECK: 2: b_([B1.1]) (Member initializer)
543 // CHECK: Preds (1): B2
544 // CHECK: Succs (1): B0
545 // CHECK: [B0 (EXIT)]
546 // CHECK: Preds (1): B1
547 // CHECK: [B1 (ENTRY)]
548 // CHECK: Succs (1): B0
549 // CHECK: [B0 (EXIT)]
550 // CHECK: Preds (1): B1
551 // CHECK: [B2 (ENTRY)]
552 // CHECK: Succs (1): B1
553 // CHECK: [B1]
554 // CHECK: 1: this
555 // CHECK: 2: [B1.1]->b_
556 // CHECK: 3: [B1.2] (ImplicitCastExpr, LValueToRValue, _Bool)
557 // CHECK: 4: return [B1.3];
558 // CHECK: Preds (1): B2
559 // CHECK: Succs (1): B0
560 // CHECK: [B0 (EXIT)]
561 // CHECK: Preds (1): B1
562 // CHECK: [B2 (ENTRY)]
563 // CHECK: Succs (1): B1
564 // CHECK: [B1]
565 // CHECK: 1: true
566 // CHECK: 2: b_([B1.1]) (Member initializer)
567 // CHECK: Preds (1): B2
568 // CHECK: Succs (1): B0
569 // CHECK: [B0 (EXIT)]
570 // CHECK: Preds (1): B1
571 // CHECK: [B2 (ENTRY)]
572 // CHECK: Succs (1): B1
573 // CHECK: [B1]
574 // CHECK: 1: this
575 // CHECK: 2: [B1.1]->b_
576 // CHECK: 3: [B1.2] (ImplicitCastExpr, LValueToRValue, _Bool)
577 // CHECK: 4: return [B1.3];
578 // CHECK: Preds (1): B2
579 // CHECK: Succs (1): B0
580 // CHECK: [B0 (EXIT)]
581 // CHECK: Preds (1): B1
582 // CHECK: [B4 (ENTRY)]
583 // CHECK: Succs (1): B3
584 // CHECK: [B1]
585 // CHECK: 1: 0
586 // CHECK: 2: return [B1.1];
587 // CHECK: Preds (1): B3
588 // CHECK: Succs (1): B0
589 // CHECK: [B2]
590 // CHECK: 1: 1
591 // CHECK: 2: return [B2.1];
592 // CHECK: Preds (1): B3
593 // CHECK: Succs (1): B0
594 // CHECK: [B3]
595 // CHECK: 1: C() (CXXConstructExpr, struct C)
596 // CHECK: 2: [B3.1] (BindTemporary)
597 // CHECK: 3: [B3.2].operator bool
598 // CHECK: 4: [B3.2]
599 // CHECK: 5: [B3.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
600 // CHECK: 6: ~C() (Temporary object destructor)
601 // CHECK: T: if [B3.5]
602 // CHECK: Preds (1): B4
603 // CHECK: Succs (2): B2 B1
604 // CHECK: [B0 (EXIT)]
605 // CHECK: Preds (2): B1 B2
606 // CHECK: [B5 (ENTRY)]
607 // CHECK: Succs (1): B4
608 // CHECK: [B1]
609 // CHECK: 1: [B4.6].~C() (Implicit destructor)
610 // CHECK: Succs (1): B0
611 // CHECK: [B2]
612 // CHECK: 1: 0
613 // CHECK: 2: return [B2.1];
614 // CHECK: 3: [B4.6].~C() (Implicit destructor)
615 // CHECK: Preds (1): B4
616 // CHECK: Succs (1): B0
617 // CHECK: [B3]
618 // CHECK: 1: 1
619 // CHECK: 2: return [B3.1];
620 // CHECK: 3: [B4.6].~C() (Implicit destructor)
621 // CHECK: Preds (1): B4
622 // CHECK: Succs (1): B0
623 // CHECK: [B4]
624 // CHECK: 1: C() (CXXConstructExpr, struct C)
625 // CHECK: 2: [B4.1] (BindTemporary)
626 // CHECK: 3: [B4.2] (ImplicitCastExpr, NoOp, const struct C)
627 // CHECK: 4: [B4.3]
628 // CHECK: 5: [B4.4] (CXXConstructExpr, struct C)
629 // CHECK: 6: C c = C();
630 // CHECK: 7: ~C() (Temporary object destructor)
631 // CHECK: 8: c
632 // CHECK: 9: [B4.8].operator bool
633 // CHECK: 10: [B4.8]
634 // CHECK: 11: [B4.10] (ImplicitCastExpr, UserDefinedConversion, _Bool)
635 // CHECK: T: if [B4.11]
636 // CHECK: Preds (1): B5
637 // CHECK: Succs (2): B3 B2
638 // CHECK: [B0 (EXIT)]
639 // CHECK: Preds (3): B1 B2 B3
640 // CHECK: [B4 (ENTRY)]
641 // CHECK: Succs (1): B3
642 // CHECK: [B1]
643 // CHECK: 1: 0
644 // CHECK: 2: return [B1.1];
645 // CHECK: Preds (1): B3
646 // CHECK: Succs (1): B0
647 // CHECK: [B2]
648 // CHECK: 1: 1
649 // CHECK: 2: return [B2.1];
650 // CHECK: Preds (1): B3
651 // CHECK: Succs (1): B0
652 // CHECK: [B3]
653 // CHECK: 1: D() (CXXConstructExpr, struct D)
654 // CHECK: 2: [B3.1].operator bool
655 // CHECK: 3: [B3.1]
656 // CHECK: 4: [B3.3] (ImplicitCastExpr, UserDefinedConversion, _Bool)
657 // CHECK: T: if [B3.4]
658 // CHECK: Preds (1): B4
659 // CHECK: Succs (2): B2 B1
660 // CHECK: [B0 (EXIT)]
661 // CHECK: Preds (2): B1 B2
662 // CHECK: [B4 (ENTRY)]
663 // CHECK: Succs (1): B3
664 // CHECK: [B1]
665 // CHECK: 1: 0
666 // CHECK: 2: return [B1.1];
667 // CHECK: Preds (1): B3
668 // CHECK: Succs (1): B0
669 // CHECK: [B2]
670 // CHECK: 1: 1
671 // CHECK: 2: return [B2.1];
672 // CHECK: Preds (1): B3
673 // CHECK: Succs (1): B0
674 // CHECK: [B3]
675 // CHECK: 1: D() (CXXConstructExpr, struct D)
676 // CXX98: 2: [B3.1] (ImplicitCastExpr, NoOp, const struct D)
677 // CXX98: 3: [B3.2]
678 // CXX98: 4: [B3.3] (CXXConstructExpr, struct D)
679 // CXX98: 5: D d = D();
680 // CXX98: 6: d
681 // CXX98: 7: [B3.6].operator bool
682 // CXX98: 8: [B3.6]
683 // CXX98: 9: [B3.8] (ImplicitCastExpr, UserDefinedConversion, _Bool)
684 // CXX98: T: if [B3.9]
685 // CXX11: 2: [B3.1]
686 // CXX11: 3: [B3.2] (CXXConstructExpr, struct D)
687 // CXX11: 4: D d = D();
688 // CXX11: 5: d
689 // CXX11: 6: [B3.5].operator bool
690 // CXX11: 7: [B3.5]
691 // CXX11: 8: [B3.7] (ImplicitCastExpr, UserDefinedConversion, _Bool)
692 // CXX11: T: if [B3.8]
693 // CHECK: Preds (1): B4
694 // CHECK: Succs (2): B2 B1
695 // CHECK: [B0 (EXIT)]
696 // CHECK: Preds (2): B1 B2
697 // CHECK: [B14 (ENTRY)]
698 // CHECK: Succs (1): B13
699 // CHECK: [B1]
700 // CHECK: 1: ~B() (Temporary object destructor)
701 // CHECK: 2: int b;
702 // CHECK: 3: [B10.4].~A() (Implicit destructor)
703 // CHECK: Preds (2): B2 B3
704 // CHECK: Succs (1): B0
705 // CHECK: [B2]
706 // CHECK: 1: ~A() (Temporary object destructor)
707 // CHECK: 2: ~A() (Temporary object destructor)
708 // CHECK: Preds (1): B4
709 // CHECK: Succs (1): B1
710 // CHECK: [B3]
711 // CHECK: 1: ~A() (Temporary object destructor)
712 // CHECK: 2: ~A() (Temporary object destructor)
713 // CHECK: 3: ~A() (Temporary object destructor)
714 // CHECK: 4: ~B() (Temporary object destructor)
715 // CHECK: Preds (1): B4
716 // CHECK: Succs (1): B1
717 // CHECK: [B4]
718 // CHECK: 1: [B7.8] ? [B5.6] : [B6.15]
719 // CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
720 // CHECK: 3: [B4.2]
721 // CHECK: 4: [B7.3]([B4.3])
722 // CHECK: T: (Temp Dtor) [B6.2]
723 // CHECK: Preds (2): B5 B6
724 // CHECK: Succs (2): B3 B2
725 // CHECK: [B5]
726 // CHECK: 1: A() (CXXConstructExpr, class A)
727 // CHECK: 2: [B5.1] (BindTemporary)
728 // CHECK: 3: [B5.2] (ImplicitCastExpr, NoOp, const class A)
729 // CHECK: 4: [B5.3]
730 // CHECK: 5: [B5.4] (CXXConstructExpr, class A)
731 // CHECK: 6: [B5.5] (BindTemporary)
732 // CHECK: Preds (1): B7
733 // CHECK: Succs (1): B4
734 // CHECK: [B6]
735 // CHECK: 1: B() (CXXConstructExpr, class B)
736 // CHECK: 2: [B6.1] (BindTemporary)
737 // CHECK: 3: [B6.2].operator A
738 // CHECK: 4: [B6.2]
739 // CHECK: 5: [B6.4] (ImplicitCastExpr, UserDefinedConversion, class A)
740 // CHECK: 6: [B6.5] (BindTemporary)
741 // CHECK: 7: [B6.6] (ImplicitCastExpr, NoOp, const class A)
742 // CHECK: 8: [B6.7]
743 // CHECK: 9: [B6.8] (CXXConstructExpr, class A)
744 // CHECK: 10: [B6.9] (BindTemporary)
745 // CHECK: 11: A([B6.10]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
746 // CHECK: 12: [B6.11] (ImplicitCastExpr, NoOp, const class A)
747 // CHECK: 13: [B6.12]
748 // CHECK: 14: [B6.13] (CXXConstructExpr, class A)
749 // CHECK: 15: [B6.14] (BindTemporary)
750 // CHECK: Preds (1): B7
751 // CHECK: Succs (1): B4
752 // CHECK: [B7]
753 // CHECK: 1: ~B() (Temporary object destructor)
754 // CHECK: 2: foo
755 // CHECK: 3: [B7.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
756 // CHECK: 4: B() (CXXConstructExpr, class B)
757 // CHECK: 5: [B7.4] (BindTemporary)
758 // CHECK: 6: [B7.5].operator bool
759 // CHECK: 7: [B7.5]
760 // CHECK: 8: [B7.7] (ImplicitCastExpr, UserDefinedConversion, _Bool)
761 // CHECK: T: [B7.8] ? ... : ...
762 // CHECK: Preds (2): B8 B9
763 // CHECK: Succs (2): B5 B6
764 // CHECK: [B8]
765 // CHECK: 1: ~A() (Temporary object destructor)
766 // CHECK: Preds (1): B10
767 // CHECK: Succs (1): B7
768 // CHECK: [B9]
769 // CHECK: 1: ~A() (Temporary object destructor)
770 // CHECK: 2: ~A() (Temporary object destructor)
771 // CHECK: 3: ~B() (Temporary object destructor)
772 // CHECK: Preds (1): B10
773 // CHECK: Succs (1): B7
774 // CHECK: [B10]
775 // CHECK: 1: [B13.5] ? [B11.6] : [B12.15]
776 // CHECK: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
777 // CHECK: 3: [B10.2]
778 // CHECK: 4: const A &a = B() ? A() : A(B());
779 // CHECK: T: (Temp Dtor) [B12.2]
780 // CHECK: Preds (2): B11 B12
781 // CHECK: Succs (2): B9 B8
782 // CHECK: [B11]
783 // CHECK: 1: A() (CXXConstructExpr, class A)
784 // CHECK: 2: [B11.1] (BindTemporary)
785 // CHECK: 3: [B11.2] (ImplicitCastExpr, NoOp, const class A)
786 // CHECK: 4: [B11.3]
787 // CHECK: 5: [B11.4] (CXXConstructExpr, class A)
788 // CHECK: 6: [B11.5] (BindTemporary)
789 // CHECK: Preds (1): B13
790 // CHECK: Succs (1): B10
791 // CHECK: [B12]
792 // CHECK: 1: B() (CXXConstructExpr, class B)
793 // CHECK: 2: [B12.1] (BindTemporary)
794 // CHECK: 3: [B12.2].operator A
795 // CHECK: 4: [B12.2]
796 // CHECK: 5: [B12.4] (ImplicitCastExpr, UserDefinedConversion, class A)
797 // CHECK: 6: [B12.5] (BindTemporary)
798 // CHECK: 7: [B12.6] (ImplicitCastExpr, NoOp, const class A)
799 // CHECK: 8: [B12.7]
800 // CHECK: 9: [B12.8] (CXXConstructExpr, class A)
801 // CHECK: 10: [B12.9] (BindTemporary)
802 // CHECK: 11: A([B12.10]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
803 // CHECK: 12: [B12.11] (ImplicitCastExpr, NoOp, const class A)
804 // CHECK: 13: [B12.12]
805 // CHECK: 14: [B12.13] (CXXConstructExpr, class A)
806 // CHECK: 15: [B12.14] (BindTemporary)
807 // CHECK: Preds (1): B13
808 // CHECK: Succs (1): B10
809 // CHECK: [B13]
810 // CHECK: 1: B() (CXXConstructExpr, class B)
811 // CHECK: 2: [B13.1] (BindTemporary)
812 // CHECK: 3: [B13.2].operator bool
813 // CHECK: 4: [B13.2]
814 // CHECK: 5: [B13.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
815 // CHECK: T: [B13.5] ? ... : ...
816 // CHECK: Preds (1): B14
817 // CHECK: Succs (2): B11 B12
818 // CHECK: [B0 (EXIT)]
819 // CHECK: Preds (1): B1
820 // CHECK: [B8 (ENTRY)]
821 // CHECK: Succs (1): B7
822 // CHECK: [B1]
823 // CHECK: 1: int b;
824 // CHECK: 2: [B4.5].~A() (Implicit destructor)
825 // CHECK: Preds (2): B2 B3
826 // CHECK: Succs (1): B0
827 // CHECK: [B2]
828 // CHECK: 1: ~A() (Temporary object destructor)
829 // CHECK: Preds (1): B4
830 // CHECK: Succs (1): B1
831 // CHECK: [B3]
832 // CHECK: 1: ~A() (Temporary object destructor)
833 // CHECK: 2: ~A() (Temporary object destructor)
834 // CHECK: Preds (1): B4
835 // CHECK: Succs (1): B1
836 // CHECK: [B4]
837 // CHECK: 1: [B7.2] ?: [B6.6]
838 // CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
839 // CHECK: 3: [B4.2]
840 // CHECK: 4: [B4.3] (CXXConstructExpr, class A)
841 // CHECK: 5: A a = A() ?: A();
842 // CHECK: T: (Temp Dtor) [B6.2]
843 // CHECK: Preds (2): B5 B6
844 // CHECK: Succs (2): B3 B2
845 // CHECK: [B5]
846 // CHECK: 1: [B7.2] (ImplicitCastExpr, NoOp, const class A)
847 // CHECK: 2: [B5.1]
848 // CHECK: 3: [B5.2] (CXXConstructExpr, class A)
849 // CHECK: 4: [B5.3] (BindTemporary)
850 // CHECK: Preds (1): B7
851 // CHECK: Succs (1): B4
852 // CHECK: [B6]
853 // CHECK: 1: A() (CXXConstructExpr, class A)
854 // CHECK: 2: [B6.1] (BindTemporary)
855 // CHECK: 3: [B6.2] (ImplicitCastExpr, NoOp, const class A)
856 // CHECK: 4: [B6.3]
857 // CHECK: 5: [B6.4] (CXXConstructExpr, class A)
858 // CHECK: 6: [B6.5] (BindTemporary)
859 // CHECK: Preds (1): B7
860 // CHECK: Succs (1): B4
861 // CHECK: [B7]
862 // CHECK: 1: A() (CXXConstructExpr, class A)
863 // CHECK: 2: [B7.1] (BindTemporary)
864 // CHECK: 3: [B7.2].operator bool
865 // CHECK: 4: [B7.2]
866 // CHECK: 5: [B7.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
867 // CHECK: T: [B7.5] ? ... : ...
868 // CHECK: Preds (1): B8
869 // CHECK: Succs (2): B5 B6
870 // CHECK: [B0 (EXIT)]
871 // CHECK: Preds (1): B1
872 // CHECK: [B13 (ENTRY)]
873 // CHECK: Succs (1): B12
874 // CHECK: [B1]
875 // CHECK: 1: int b;
876 // CHECK: 2: [B9.4].~A() (Implicit destructor)
877 // CHECK: Preds (2): B2 B3
878 // CHECK: Succs (1): B0
879 // CHECK: [B2]
880 // CHECK: 1: ~A() (Temporary object destructor)
881 // CHECK: Preds (1): B4
882 // CHECK: Succs (1): B1
883 // CHECK: [B3]
884 // CHECK: 1: ~A() (Temporary object destructor)
885 // CHECK: 2: ~A() (Temporary object destructor)
886 // CHECK: Preds (1): B4
887 // CHECK: Succs (1): B1
888 // CHECK: [B4]
889 // CHECK: 1: [B7.4] ?: [B6.6]
890 // CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
891 // CHECK: 3: [B4.2]
892 // CHECK: 4: [B7.2]([B4.3])
893 // CHECK: T: (Temp Dtor) [B6.2]
894 // CHECK: Preds (2): B5 B6
895 // CHECK: Succs (2): B3 B2
896 // CHECK: [B5]
897 // CHECK: 1: [B7.4] (ImplicitCastExpr, NoOp, const class A)
898 // CHECK: 2: [B5.1]
899 // CHECK: 3: [B5.2] (CXXConstructExpr, class A)
900 // CHECK: 4: [B5.3] (BindTemporary)
901 // CHECK: Preds (1): B7
902 // CHECK: Succs (1): B4
903 // CHECK: [B6]
904 // CHECK: 1: A() (CXXConstructExpr, class A)
905 // CHECK: 2: [B6.1] (BindTemporary)
906 // CHECK: 3: [B6.2] (ImplicitCastExpr, NoOp, const class A)
907 // CHECK: 4: [B6.3]
908 // CHECK: 5: [B6.4] (CXXConstructExpr, class A)
909 // CHECK: 6: [B6.5] (BindTemporary)
910 // CHECK: Preds (1): B7
911 // CHECK: Succs (1): B4
912 // CHECK: [B7]
913 // CHECK: 1: foo
914 // CHECK: 2: [B7.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
915 // CHECK: 3: A() (CXXConstructExpr, class A)
916 // CHECK: 4: [B7.3] (BindTemporary)
917 // CHECK: 5: [B7.4].operator bool
918 // CHECK: 6: [B7.4]
919 // CHECK: 7: [B7.6] (ImplicitCastExpr, UserDefinedConversion, _Bool)
920 // CHECK: T: [B7.7] ? ... : ...
921 // CHECK: Preds (2): B8 B9
922 // CHECK: Succs (2): B5 B6
923 // CHECK: [B8]
924 // CHECK: 1: ~A() (Temporary object destructor)
925 // CHECK: Preds (1): B9
926 // CHECK: Succs (1): B7
927 // CHECK: [B9]
928 // CHECK: 1: [B12.2] ?: [B11.6]
929 // CHECK: 2: [B9.1] (ImplicitCastExpr, NoOp, const class A)
930 // CHECK: 3: [B9.2]
931 // CHECK: 4: const A &a = A() ?: A();
932 // CHECK: T: (Temp Dtor) [B11.2]
933 // CHECK: Preds (2): B10 B11
934 // CHECK: Succs (2): B8 B7
935 // CHECK: [B10]
936 // CHECK: 1: [B12.2] (ImplicitCastExpr, NoOp, const class A)
937 // CHECK: 2: [B10.1]
938 // CHECK: 3: [B10.2] (CXXConstructExpr, class A)
939 // CHECK: 4: [B10.3] (BindTemporary)
940 // CHECK: Preds (1): B12
941 // CHECK: Succs (1): B9
942 // CHECK: [B11]
943 // CHECK: 1: A() (CXXConstructExpr, class A)
944 // CHECK: 2: [B11.1] (BindTemporary)
945 // CHECK: 3: [B11.2] (ImplicitCastExpr, NoOp, const class A)
946 // CHECK: 4: [B11.3]
947 // CHECK: 5: [B11.4] (CXXConstructExpr, class A)
948 // CHECK: 6: [B11.5] (BindTemporary)
949 // CHECK: Preds (1): B12
950 // CHECK: Succs (1): B9
951 // CHECK: [B12]
952 // CHECK: 1: A() (CXXConstructExpr, class A)
953 // CHECK: 2: [B12.1] (BindTemporary)
954 // CHECK: 3: [B12.2].operator bool
955 // CHECK: 4: [B12.2]
956 // CHECK: 5: [B12.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
957 // CHECK: T: [B12.5] ? ... : ...
958 // CHECK: Preds (1): B13
959 // CHECK: Succs (2): B10 B11
960 // CHECK: [B0 (EXIT)]
961 // CHECK: Preds (1): B1
962 // CHECK: [B2 (ENTRY)]
963 // CHECK: Succs (1): B1
964 // CHECK: [B1]
965 // CHECK: 1: A() (CXXConstructExpr, class A)
966 // CHECK: 2: [B1.1] (BindTemporary)
967 // CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
968 // CHECK: 4: [B1.3]
969 // CHECK: 5: [B1.4] (CXXConstructExpr, class A)
970 // CHECK: 6: A a = A();
971 // CHECK: 7: ~A() (Temporary object destructor)
972 // CHECK: 8: int b;
973 // CHECK: 9: [B1.6].~A() (Implicit destructor)
974 // CHECK: Preds (1): B2
975 // CHECK: Succs (1): B0
976 // CHECK: [B0 (EXIT)]
977 // CHECK: Preds (1): B1
978 // CHECK: [B2 (ENTRY)]
979 // CHECK: Succs (1): B1
980 // CHECK: [B1]
981 // CHECK: 1: A() (CXXConstructExpr, class A)
982 // CHECK: 2: [B1.1] (BindTemporary)
983 // CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
984 // CHECK: 4: [B1.3]
985 // CHECK: 5: const A &a = A();
986 // CHECK: 6: foo
987 // CHECK: 7: [B1.6] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
988 // CHECK: 8: A() (CXXConstructExpr, class A)
989 // CHECK: 9: [B1.8] (BindTemporary)
990 // CHECK: 10: [B1.9] (ImplicitCastExpr, NoOp, const class A)
991 // CHECK: 11: [B1.10]
992 // CHECK: 12: [B1.7]([B1.11])
993 // CHECK: 13: ~A() (Temporary object destructor)
994 // CHECK: 14: int b;
995 // CHECK: 15: [B1.5].~A() (Implicit destructor)
996 // CHECK: Preds (1): B2
997 // CHECK: Succs (1): B0
998 // CHECK: [B0 (EXIT)]
999 // CHECK: Preds (1): B1
1000 // CHECK: [B2 (ENTRY)]
1001 // CHECK: Succs (1): B1
1002 // CHECK: [B1]
1003 // CHECK: 1: A::make
1004 // CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
1005 // CHECK: 3: [B1.2]()
1006 // CHECK: 4: [B1.3] (BindTemporary)
1007 // CHECK: 5: [B1.4] (ImplicitCastExpr, NoOp, const class A)
1008 // CHECK: 6: [B1.5]
1009 // CHECK: 7: [B1.6] (CXXConstructExpr, class A)
1010 // CHECK: 8: A a = A::make();
1011 // CHECK: 9: ~A() (Temporary object destructor)
1012 // CHECK: 10: int b;
1013 // CHECK: 11: [B1.8].~A() (Implicit destructor)
1014 // CHECK: Preds (1): B2
1015 // CHECK: Succs (1): B0
1016 // CHECK: [B0 (EXIT)]
1017 // CHECK: Preds (1): B1
1018 // CHECK: [B2 (ENTRY)]
1019 // CHECK: Succs (1): B1
1020 // CHECK: [B1]
1021 // CHECK: 1: A::make
1022 // CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
1023 // CHECK: 3: [B1.2]()
1024 // CHECK: 4: [B1.3] (BindTemporary)
1025 // CHECK: 5: [B1.4] (ImplicitCastExpr, NoOp, const class A)
1026 // CHECK: 6: [B1.5]
1027 // CHECK: 7: const A &a = A::make();
1028 // CHECK: 8: foo
1029 // CHECK: 9: [B1.8] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
1030 // CHECK: 10: A::make
1031 // CHECK: 11: [B1.10] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
1032 // CHECK: 12: [B1.11]()
1033 // CHECK: 13: [B1.12] (BindTemporary)
1034 // CHECK: 14: [B1.13] (ImplicitCastExpr, NoOp, const class A)
1035 // CHECK: 15: [B1.14]
1036 // CHECK: 16: [B1.9]([B1.15])
1037 // CHECK: 17: ~A() (Temporary object destructor)
1038 // CHECK: 18: int b;
1039 // CHECK: 19: [B1.7].~A() (Implicit destructor)
1040 // CHECK: Preds (1): B2
1041 // CHECK: Succs (1): B0
1042 // CHECK: [B0 (EXIT)]
1043 // CHECK: Preds (1): B1
1044 // CHECK: [B2 (ENTRY)]
1045 // CHECK: Succs (1): B1
1046 // CHECK: [B1]
1047 // CHECK: 1: int a;
1048 // CHECK: 2: A() (CXXConstructExpr, class A)
1049 // CHECK: 3: [B1.2] (BindTemporary)
1050 // CHECK: 4: [B1.3].operator int
1051 // CHECK: 5: [B1.3]
1052 // CHECK: 6: [B1.5] (ImplicitCastExpr, UserDefinedConversion, int)
1053 // CHECK: 7: a
1054 // CHECK: 8: [B1.7] = [B1.6]
1055 // CHECK: 9: ~A() (Temporary object destructor)
1056 // CHECK: 10: int b;
1057 // CHECK: Preds (1): B2
1058 // CHECK: Succs (1): B0
1059 // CHECK: [B0 (EXIT)]
1060 // CHECK: Preds (1): B1
1061 // CHECK: [B2 (ENTRY)]
1062 // CHECK: Succs (1): B1
1063 // CHECK: [B1]
1064 // CHECK: 1: A() (CXXConstructExpr, class A)
1065 // CHECK: 2: [B1.1] (BindTemporary)
1066 // CHECK: 3: [B1.2].operator int
1067 // CHECK: 4: [B1.2]
1068 // CHECK: 5: [B1.4] (ImplicitCastExpr, UserDefinedConversion, int)
1069 // CHECK: 6: int([B1.5]) (CXXFunctionalCastExpr, NoOp, int)
1070 // CHECK: 7: B() (CXXConstructExpr, class B)
1071 // CHECK: 8: [B1.7] (BindTemporary)
1072 // CHECK: 9: [B1.8].operator int
1073 // CHECK: 10: [B1.8]
1074 // CHECK: 11: [B1.10] (ImplicitCastExpr, UserDefinedConversion, int)
1075 // CHECK: 12: int([B1.11]) (CXXFunctionalCastExpr, NoOp, int)
1076 // CHECK: 13: [B1.6] + [B1.12]
1077 // CHECK: 14: a([B1.13]) (Member initializer)
1078 // CHECK: 15: ~B() (Temporary object destructor)
1079 // CHECK: 16: ~A() (Temporary object destructor)
1080 // CHECK: 17: /*implicit*/int()
1081 // CHECK: 18: b([B1.17]) (Member initializer)
1082 // CHECK: Preds (1): B2
1083 // CHECK: Succs (1): B0
1084 // CHECK: [B0 (EXIT)]
1085 // CHECK: Preds (1): B1
1086 // CHECK: [B3 (ENTRY)]
1087 // CHECK: Succs (1): B2
1088 // CHECK: [B1]
1089 // CHECK: 1: int b;
1090 // CHECK: Preds (1): B2(Unreachable)
1091 // CHECK: Succs (1): B0
1092 // CHECK: [B2 (NORETURN)]
1093 // CHECK: 1: int a;
1094 // CHECK: 2: NoReturn() (CXXConstructExpr, class NoReturn)
1095 // CHECK: 3: [B2.2] (BindTemporary)
1096 // CHECK: 4: [B2.3].f
1097 // CHECK: 5: [B2.4]()
1098 // CHECK: 6: ~NoReturn() (Temporary object destructor)
1099 // CHECK: Preds (1): B3
1100 // CHECK: Succs (1): B0
1101 // CHECK: [B0 (EXIT)]
1102 // CHECK: Preds (2): B1 B2
1103 // CHECK: [B3 (ENTRY)]
1104 // CHECK: Succs (1): B2
1105 // CHECK: [B1]
1106 // CHECK: 1: int b;
1107 // CHECK: Preds (1): B2(Unreachable)
1108 // CHECK: Succs (1): B0
1109 // CHECK: [B2 (NORETURN)]
1110 // CHECK: 1: int a;
1111 // CHECK: 2: NoReturn() (CXXConstructExpr, class NoReturn)
1112 // CHECK: 3: [B2.2] (BindTemporary)
1113 // CHECK: 4: 47
1114 // CHECK: 5: ... , [B2.4]
1115 // CHECK: 6: ~NoReturn() (Temporary object destructor)
1116 // CHECK: Preds (1): B3
1117 // CHECK: Succs (1): B0
1118 // CHECK: [B0 (EXIT)]
1119 // CHECK: Preds (2): B1 B2
1120 // CHECK: [B9 (ENTRY)]
1121 // CHECK: Succs (1): B8
1122 // CHECK: [B1]
1123 // CHECK: 1: 0
1124 // CHECK: 2: return [B1.1];
1125 // CHECK: Preds (2): B3 B8
1126 // CHECK: Succs (1): B0
1127 // CHECK: [B2]
1128 // CHECK: 1: 1
1129 // CHECK: 2: return [B2.1];
1130 // CHECK: Preds (1): B3
1131 // CHECK: Succs (1): B0
1132 // CHECK: [B3]
1133 // CHECK: T: if [B5.1]
1134 // CHECK: Preds (2): B4(Unreachable) B5
1135 // CHECK: Succs (2): B2 B1
1136 // CHECK: [B4 (NORETURN)]
1137 // CHECK: 1: ~NoReturn() (Temporary object destructor)
1138 // CHECK: Preds (1): B5
1139 // CHECK: Succs (1): B0
1140 // CHECK: [B5]
1141 // CHECK: 1: [B7.3] || [B6.7]
1142 // CHECK: T: (Temp Dtor) [B6.4]
1143 // CHECK: Preds (2): B6 B7
1144 // CHECK: Succs (2): B4 B3
1145 // CHECK: [B6]
1146 // CHECK: 1: check
1147 // CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const class NoReturn &))
1148 // CHECK: 3: NoReturn() (CXXConstructExpr, class NoReturn)
1149 // CHECK: 4: [B6.3] (BindTemporary)
1150 // CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const class NoReturn)
1151 // CHECK: 6: [B6.5]
1152 // CHECK: 7: [B6.2]([B6.6])
1153 // CHECK: Preds (1): B7
1154 // CHECK: Succs (1): B5
1155 // CHECK: [B7]
1156 // CHECK: 1: value
1157 // CHECK: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1158 // CHECK: 3: ![B7.2]
1159 // CHECK: T: [B7.3] || ...
1160 // CHECK: Preds (1): B8
1161 // CHECK: Succs (2): B5 B6
1162 // CHECK: [B8]
1163 // CHECK: 1: value
1164 // CHECK: 2: [B8.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1165 // CHECK: T: if [B8.2]
1166 // CHECK: Preds (1): B9
1167 // CHECK: Succs (2): B7 B1
1168 // CHECK: [B0 (EXIT)]
1169 // CHECK: Preds (3): B1 B2 B4
1170 // CHECK: [B10 (ENTRY)]
1171 // CHECK: Succs (1): B9
1172 // CHECK: [B1]
1173 // CHECK: 1: 0
1174 // CHECK: 2: return [B1.1];
1175 // CHECK: Preds (2): B3 B9
1176 // CHECK: Succs (1): B0
1177 // CHECK: [B2]
1178 // CHECK: 1: 1
1179 // CHECK: 2: return [B2.1];
1180 // CHECK: Preds (1): B3
1181 // CHECK: Succs (1): B0
1182 // CHECK: [B3]
1183 // CHECK: T: if [B5.1]
1184 // CHECK: Preds (2): B4(Unreachable) B5
1185 // CHECK: Succs (2): B2 B1
1186 // CHECK: [B4 (NORETURN)]
1187 // CHECK: 1: ~NoReturn() (Temporary object destructor)
1188 // CHECK: Preds (1): B5
1189 // CHECK: Succs (1): B0
1190 // CHECK: [B5]
1191 // CHECK: 1: [B8.3] || [B7.3] || [B6.7]
1192 // CHECK: T: (Temp Dtor) [B6.4]
1193 // CHECK: Preds (3): B6 B7 B8
1194 // CHECK: Succs (2): B4 B3
1195 // CHECK: [B6]
1196 // CHECK: 1: check
1197 // CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const class NoReturn &))
1198 // CHECK: 3: NoReturn() (CXXConstructExpr, class NoReturn)
1199 // CHECK: 4: [B6.3] (BindTemporary)
1200 // CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const class NoReturn)
1201 // CHECK: 6: [B6.5]
1202 // CHECK: 7: [B6.2]([B6.6])
1203 // CHECK: Preds (1): B7
1204 // CHECK: Succs (1): B5
1205 // CHECK: [B7]
1206 // CHECK: 1: value
1207 // CHECK: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1208 // CHECK: 3: ![B7.2]
1209 // CHECK: T: [B8.3] || [B7.3] || ...
1210 // CHECK: Preds (1): B8
1211 // CHECK: Succs (2): B5 B6
1212 // CHECK: [B8]
1213 // CHECK: 1: value
1214 // CHECK: 2: [B8.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1215 // CHECK: 3: ![B8.2]
1216 // CHECK: T: [B8.3] || ...
1217 // CHECK: Preds (1): B9
1218 // CHECK: Succs (2): B5 B7
1219 // CHECK: [B9]
1220 // CHECK: 1: value
1221 // CHECK: 2: [B9.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1222 // CHECK: T: if [B9.2]
1223 // CHECK: Preds (1): B10
1224 // CHECK: Succs (2): B8 B1
1225 // CHECK: [B0 (EXIT)]
1226 // CHECK: Preds (3): B1 B2 B4
1227 // CHECK: [B10 (ENTRY)]
1228 // CHECK: Succs (1): B9
1229 // CHECK: [B1]
1230 // CHECK: 1: 0
1231 // CHECK: 2: return [B1.1];
1232 // CHECK: Preds (2): B3 B9
1233 // CHECK: Succs (1): B0
1234 // CHECK: [B2]
1235 // CHECK: 1: 1
1236 // CHECK: 2: return [B2.1];
1237 // CHECK: Preds (1): B3
1238 // CHECK: Succs (1): B0
1239 // CHECK: [B3]
1240 // CHECK: T: if [B5.1]
1241 // CHECK: Preds (2): B4(Unreachable) B5
1242 // CHECK: Succs (2): B2 B1
1243 // CHECK: [B4 (NORETURN)]
1244 // CHECK: 1: ~NoReturn() (Temporary object destructor)
1245 // CHECK: Preds (1): B5
1246 // CHECK: Succs (1): B0
1247 // CHECK: [B5]
1248 // CHECK: 1: [B8.3] || [B7.2] || [B6.7]
1249 // CHECK: T: (Temp Dtor) [B6.4]
1250 // CHECK: Preds (3): B6 B7 B8
1251 // CHECK: Succs (2): B4 B3
1252 // CHECK: [B6]
1253 // CHECK: 1: check
1254 // CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const class NoReturn &))
1255 // CHECK: 3: NoReturn() (CXXConstructExpr, class NoReturn)
1256 // CHECK: 4: [B6.3] (BindTemporary)
1257 // CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const class NoReturn)
1258 // CHECK: 6: [B6.5]
1259 // CHECK: 7: [B6.2]([B6.6])
1260 // CHECK: Preds (1): B7
1261 // CHECK: Succs (1): B5
1262 // CHECK: [B7]
1263 // CHECK: 1: value
1264 // CHECK: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1265 // CHECK: T: [B8.3] || [B7.2] || ...
1266 // CHECK: Preds (1): B8
1267 // CHECK: Succs (2): B5 B6
1268 // CHECK: [B8]
1269 // CHECK: 1: value
1270 // CHECK: 2: [B8.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1271 // CHECK: 3: ![B8.2]
1272 // CHECK: T: [B8.3] || ...
1273 // CHECK: Preds (1): B9
1274 // CHECK: Succs (2): B5 B7
1275 // CHECK: [B9]
1276 // CHECK: 1: value
1277 // CHECK: 2: [B9.1] (ImplicitCastExpr, LValueToRValue, _Bool)
1278 // CHECK: T: if [B9.2]
1279 // CHECK: Preds (1): B10
1280 // CHECK: Succs (2): B8 B1
1281 // CHECK: [B0 (EXIT)]
1282 // CHECK: Preds (3): B1 B2 B4
1283