1 // RUN: %clang_analyze_cc1 \
2 // RUN: -analyzer-checker=core,cplusplus.NewDeleteLeaks \
5 // expected-no-diagnostics: Whenever we cannot evaluate an operation we escape
6 // the operands. After the evaluation it would be an
7 // Unknown value and the tracking would be lost.
9 typedef unsigned __INTPTR_TYPE__
uintptr_t;
13 C
*simple_escape_in_bitwise_op(C
*Foo
) {
15 Bar
= reinterpret_cast<C
*>(reinterpret_cast<uintptr_t>(Bar
) & 0x1);
17 // no-warning: "Potential leak of memory pointed to by 'Bar'" was here.
22 C
**indirect_escape_in_bitwise_op() {
25 Baz
= reinterpret_cast<C
**>(reinterpret_cast<uintptr_t>(Baz
) | 0x1);
26 Baz
= reinterpret_cast<C
**>(reinterpret_cast<uintptr_t>(Baz
) &
27 ~static_cast<uintptr_t>(0x1));
28 // no-warning: "Potential leak of memory pointed to by 'Qux'" was here.