https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128428
Bug ID: 128428
Summary: strip_typedefs logic not great for installed system
headers
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: aoliva at gcc dot gnu.org
Target Milestone: ---
The following tests:
g++.dg/reflect/reflect_constant_array11.C
g++.dg/reflect/reflect_constant_array2.C
g++.dg/reflect/reflect_constant_string2.C
expose a problem in the strip_typedefs logic used in cp/error.cc:type_to_string
to print the aka simplified type name.
When running the testsuite within the build tree, we get the desired results:
strip_typedefs recurses from range_value_t to iter_value_t, and then
user_facing_original_type_p does not find the latter to be in a system header,
so we simplify it further.
However, when performing install-tree testing (or when using -isystem instead
of -I flags in the command line used to build these tests during in-tree
testing), the libstdc++ headers are considered system headers, and then the
simplification stops at e.g. t = iter_value_t, because
!user_facing_original_type_p (t).