[Bug analyzer/94355] New: support for C++ new expression

vanyacpp at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Mar 27 11:36:56 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94355

            Bug ID: 94355
           Summary: support for C++ new expression
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: vanyacpp at gmail dot com
  Target Milestone: ---

At the moment static analyzer warns about leaked malloc. It would be great if
C++ new expression were also supported.

Example:

void f()
{
    char* p = new char;
}

Expected diagnostic:

warning: leak of 'p' [CWE-401] [-Wanalyzer-malloc-leak]

    3 |     char* p = new char;


More information about the Gcc-bugs mailing list