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.
This commit is contained in:
Jonathan Wakely 2020-06-30 17:40:08 +01:00
parent 1617fc4479
commit 039a630d78

View file

@ -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" }
}