]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
analyzer: Fix -Wanalyzer-possible-null-argument warning (PR 96014)
authorJonathan Wakely <jwakely@redhat.com>
Tue, 30 Jun 2020 16:40:08 +0000 (17:40 +0100)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:15:46 +0000 (13:15 -0300)
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.

gcc/testsuite/g++.dg/analyzer/pr94028.C

index 0a222d1b9915c43ea9ca747d9d24a6a41b965a9b..c0c35d65829fd8099899ec8dae2e8bd34c247764 100644 (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" }
   }