Improve diagnostic messages for dependent C++ splices.
This commit improves error messages for dependent splices in C++ reflection, providing more helpful diagnostics to developers.
This patch improves the diagnostic messages emitted when encountering dependent splices in C++ reflection. The error messages are reworded to be more informative, specifically indicating that a reflection is expected. Additionally, it updates the inform_tree_category function to handle concepts and alias templates, providing more context in error messages.
In Details
The patch modifies error.cc and pt.cc to enhance diagnostics related to dependent splices within the C++ reflection implementation. Specifically, the error message generated by tsubst_splice_scope is reworded to clarify the expectation of a reflection. Additionally, inform_tree_category is extended to handle concept and alias template nodes, allowing for more precise diagnostic information when these constructs are involved in reflection errors.
For Context
C++ reflection allows compile-time introspection of code. A 'splice' is a mechanism to inject generated code into a program during compilation, often based on reflected information. 'Dependent' splices rely on types or values that are not known until later in the compilation process. This commit improves the error messages when the compiler encounters problems with these splices, making it easier for developers to understand and fix issues in their code. Better diagnostics improve the developer experience when working with C++ reflection.