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)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 1 Jul 2020 19:21:34 +0000 (20:21 +0100)
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" }
   }