summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/use-after-scope-temp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/use-after-scope-temp.cc')
-rw-r--r--test/asan/TestCases/use-after-scope-temp.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/asan/TestCases/use-after-scope-temp.cc b/test/asan/TestCases/use-after-scope-temp.cc
index 3736f914d0722..4dcef59a2ff12 100644
--- a/test/asan/TestCases/use-after-scope-temp.cc
+++ b/test/asan/TestCases/use-after-scope-temp.cc
@@ -1,8 +1,6 @@
-// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
+// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
-//
-// Lifetime for temporaries is not emitted yet.
-// XFAIL: *
+
struct IntHolder {
int val;
@@ -15,9 +13,9 @@ void save(const IntHolder &holder) {
}
int main(int argc, char *argv[]) {
- save({10});
+ save({argc});
int x = saved->val; // BOOM
-// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
-// CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
+ // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
return x;
}