GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
analyzer

analyzer: Add instantiations for scalar_manager

Adds necessary template instantiations for scalar management in the GCC analyzer.

This commit adds template instantiations for the get_named_test_scalar method within the scalar_manager class in GCC’s static analyzer. Specifically, instantiations for integer, concrete_bit_offset, and concrete_byte_offset types are added. This change addresses a build issue (PR analyzer/128854) by ensuring that the required template specializations are available for the analyzer’s symbolic scalar management.

In Details

The GCC static analyzer uses scalar_manager to handle symbolic representations of program values. The get_named_test_scalar method is used internally for testing and analysis. This commit adds explicit template instantiations for scalar_manager<CVT> where CVT is integer, concrete_bit_offset, or concrete_byte_offset. These instantiations are necessary to ensure that the compiler can generate code for these specific types when the scalar_manager's methods are called, resolving a link-time or compile-time error reported in PR analyzer/128854.

For Context
analyzer
Refers to GCC's built-in static analyzer, a tool that analyzes code without executing it to detect potential defects.
scalar_manager
A component within GCC's static analyzer responsible for managing and representing scalar values (non-array, non-struct types) in a symbolic or concrete form.
template instantiation
In C++, the process where a template (a blueprint for code) is converted into an actual piece of code by providing specific types or values for its parameters. Explicit instantiation ensures that code for a particular template specialization is generated.
integer
A fundamental data type representing whole numbers. In the context of the analyzer, it refers to symbolic or concrete integer values.
concrete_bit_offset
A type used in the static analyzer to represent a specific offset within a value, measured in bits. It's a concrete representation rather than symbolic.
concrete_byte_offset
Similar to concrete_bit_offset, but measures the offset in bytes.
Filed Under: analyzertemplatebuild