E = E->IgnoreParens();
// If we're doing a variable assignment from e.g. malloc(N), there will
- // probably be a cast of some kind. In exotic cases, we might also see a
- // top-level ExprWithCleanups. Ignore them either way.
- if (const auto *EC = dyn_cast<ExprWithCleanups>(E))
- E = EC->getSubExpr()->IgnoreParens();
-
+ // probably be a cast of some kind. Ignore it.
if (const auto *Cast = dyn_cast<CastExpr>(E))
E = Cast->getSubExpr()->IgnoreParens();
__builtin_object_size(dependent_calloc2<int, 9>(), 0);
}
} // namespace templated_alloc_size
-
-struct D {
- ~D();
- void *my_malloc(int N) __attribute__((alloc_size(2)));
-};
-
-// CHECK-LABEL: define i32 @_Z20callExprWithCleanupsv
-int callExprWithCleanups() {
- int *const p = (int *)D().my_malloc(3);
- // CHECK: ret i32 3
- return __builtin_object_size(p, 0);
-}