GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
analyzer

Analyzer: Avoid naked "new"

Modernizes the analyzer by replacing raw `new` with `std::make_unique` for memory management.

This commit modernizes the GCC analyzer by replacing direct uses of new with std::make_unique for allocating unique pointers. This change enhances memory safety and simplifies resource management, aligning with modern C++ practices and reducing the risk of memory leaks.

In Details

This commit replaces raw new calls with std::make_unique in the analyzer, specifically in access-diagram.cc, checker-path.h, diagnostic-manager.cc, and feasible-graph.cc. The goal is to improve memory management without functional changes.

For Context

This commit modernizes the memory management practices within GCC's static analyzer. It replaces direct uses of the new keyword with std::make_unique, which is a safer and more modern way to allocate memory in C++. This change makes the code less prone to memory leaks and easier to maintain, contributing to the overall stability of the analyzer.

Filed Under: analyzermemory managementmodernization