Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3008)

Unified Diff: base/debug/stack_trace_unittest.cc

Issue 1131513006: Work around Clang's new -Wmismatched-new-delete warning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/tools_sanity_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | base/tools_sanity_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698