1 // RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \
2 // RUN: not %run %t 2>&1 | FileCheck %s
6 const IntHolder& Self() const {
12 const IntHolder *saved;
14 int main(int argc, char *argv[]) {
15 saved = &IntHolder().Self();
16 int x = saved->val; // BOOM
17 // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
18 // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp2.cc:[[@LINE-2]]