Index: base/debug/stack_trace_unittest.cc |
diff --git a/base/debug/stack_trace_unittest.cc b/base/debug/stack_trace_unittest.cc |
index 15c90939a2e7e6c6a0dd81b929e7d587c7d042fa..804587e34055e94b41c7c7c06e9b49c528907973 100644 |
--- a/base/debug/stack_trace_unittest.cc |
+++ b/base/debug/stack_trace_unittest.cc |
@@ -135,8 +135,14 @@ TEST_F(StackTraceTest, DebugPrintBacktrace) { |
#if defined(OS_POSIX) && !defined(OS_ANDROID) |
#if !defined(OS_IOS) |
+static char* newArray() { |
+ // Clang warns about the mismatched new[]/delete if they occur in the same |
+ // function. |
+ return new char[10]; |
+} |
+ |
MULTIPROCESS_TEST_MAIN(MismatchedMallocChildProcess) { |
- char* pointer = new char[10]; |
+ char* pointer = newArray(); |
delete pointer; |
return 2; |
} |