On 30/06/20 17:43 +0100, Jonathan Wakely wrote:
gcc/testsuite/ChangeLog:

        * g++.dg/analyzer/pr94028.C: Make operator new non-throwing so
        that the compiler doesn't implicitly mark it as returning
        non-null.

Fixes these:

FAIL: g++.dg/analyzer/pr94028.C  -std=c++98 (test for excess errors)
FAIL: g++.dg/analyzer/pr94028.C  -std=c++14 (test for excess errors)
FAIL: g++.dg/analyzer/pr94028.C  -std=c++17 (test for excess errors)
FAIL: g++.dg/analyzer/pr94028.C  -std=c++2a (test for excess errors)

Updated to add PR 96014 to the commit log.

OK for master?

commit 8fedcc43382868ffc345a9410584f668ff9c04c0
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Jun 30 17:40:08 2020 +0100

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

Reply via email to