Add libstdc++ -fanalyzer Test Coverage
Added minimal test coverage for `-fanalyzer`'s handling of basic libstdc++ usage, providing end-to-end testing of the interaction between the static analyzer a…
This commit adds new tests to verify that the -fanalyzer flag works correctly with basic libstdc++ usage. These tests cover scenarios like std::string construction and std::unique_ptr to improve end-to-end testing of the analyzer’s interaction with the C++ standard library. More tests will be added to cover other usages as issues are debugged.
In Details
This commit introduces basic test coverage for -fanalyzer when used with libstdc++ within the GCC testsuite (g++.dg/analyzer/torture). The tests cover basic functionalities like std::string constructors and std::unique_ptr. This provides regression testing for the interaction between the static analyzer and the C++ standard library, and will be extended as more complex issues are resolved (PR 125236).
For Context
The -fanalyzer flag in GCC enables static analysis, a process where the compiler tries to find potential bugs in the code without running it. This commit adds tests that check how well -fanalyzer works with the C++ standard library (libstdc++). These tests cover common usages of libstdc++ to ensure that the analyzer can effectively identify issues in code that uses these standard components.