From: Jonathan Wakely Date: Tue, 30 Jun 2020 16:40:08 +0000 (+0100) Subject: analyzer: Fix -Wanalyzer-possible-null-argument warning (PR 96014) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=039a630d787dc18c76b81f08a322ba1e0d91082d;p=gcc.git analyzer: Fix -Wanalyzer-possible-null-argument warning (PR 96014) gcc/testsuite/ChangeLog: PR testsuite/96014 * g++.dg/analyzer/pr94028.C: Make operator new non-throwing so that the compiler doesn't implicitly mark it as returning non-null. --- diff --git a/gcc/testsuite/g++.dg/analyzer/pr94028.C b/gcc/testsuite/g++.dg/analyzer/pr94028.C index 0a222d1b991..c0c35d65829 100644 --- a/gcc/testsuite/g++.dg/analyzer/pr94028.C +++ b/gcc/testsuite/g++.dg/analyzer/pr94028.C @@ -12,7 +12,7 @@ enum e {} i; struct j { - void *operator new (__SIZE_TYPE__ b) + void *operator new (__SIZE_TYPE__ b) throw() { return calloc (b, sizeof (int)); // { dg-warning "leak" } }