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

analyzer: add template instantiation [PR128712]

Adds explicit template instantiation for a specific type in the analyzer.

This commit explicitly instantiates a template for the scalar<integer_with_unit<units::bit>>::is_unknown_p type within the GCC analyzer. This resolves a reported issue (PR128712) where this specific instantiation was missing, potentially leading to compilation or runtime errors for certain analysis paths involving integral types with bit units.

In Details

In gcc/analyzer/symbolic-scalars.cc, this commit adds an explicit template instantiation for scalar<integer_with_unit<units::bit>>::is_unknown_p for the specific type scalar<integer_with_unit<units::bit>>. This resolves PR analyzer/128712 by ensuring that this particular template instantiation, which is used for checking unknown scalar values within the analyzer, is generated when needed, preventing potential link-time errors or incomplete analysis.

For Context
GCC analyzer
A component of GCC that performs static analysis to find bugs, particularly related to memory safety and array bounds.
template instantiation
The process in C++ where a template is compiled to produce a concrete class or function for a specific set of template arguments.
explicit instantiation
A C++ mechanism to force the instantiation of a template for a particular set of arguments, often used to control which instantiations are generated or to resolve ambiguities.
scalar
In programming, a value of a primitive type (like an integer or float) as opposed to a composite type (like an array or struct).
integer_with_unit
A C++ template likely used in the analyzer to represent integer values that are associated with specific units, such as bits.
Filed Under: analyzertemplateinstantiationbug fix