]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/use-after-scope-temp.cc
1 // RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
2 // RUN: not %run %t 2>&1 | FileCheck %s
4 // Lifetime for temporaries is not emitted yet.
11 const IntHolder
*saved
;
13 void save(const IntHolder
&holder
) {
17 int main(int argc
, char *argv
[]) {
19 int x
= saved
->val
; // BOOM
20 // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
21 // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]