C++: Add various missing auto_diagnostic_group sentinels
GCC's C++ frontend now includes numerous `auto_diagnostic_group` sentinels to improve diagnostic message grouping and clarity.
This commit adds missing auto_diagnostic_group sentinels across various parts of GCC’s C++ frontend, including call.cc, constexpr.cc, and decl.cc. These sentinels ensure that a sequence of related diagnostic messages is properly grouped together, preventing them from being interspersed with unrelated warnings or errors. By improving the logical grouping of diagnostics, developers can more easily understand and address reported issues in their C++ code.
In Details
The auto_diagnostic_group is a C++ RAII (Resource Acquisition Is Initialization) helper in GCC's diagnostic infrastructure. It's used to group related diagnostic messages, preventing interleaving with other diagnostics that might arise from different logical contexts during compilation. This commit introduces these missing sentinels in functions like build_op_delete_call_1 and complain_about_access in call.cc, maybe_warn_about_constant_value in constexpr.cc, and identify_goto in decl.cc. The lack of these sentinels could lead to a less coherent diagnostic stream, making it har…
For Context
When a compiler like GCC finds issues in your C++ code, it generates 'diagnostic messages'—warnings or errors. Sometimes, a single problem can lead to several related messages. Instead of these messages appearing scattered and mixed with other unrelated diagnostics, it's helpful if they are grouped together logically. This update to GCC's C++ front end does exactly that by adding special markers called auto_diagnostic_group sentinels. Think of these as delimiters that tell the compiler, "Start a new group of related messages here, and end it there." By doing this, the compiler's output becomes much cleaner and easier to read, allowing developers to quickly identify and fix all related aspects of a particular code issue.