c++: Fix pretty printing of TYPENAME_TYPEs
authorPatrick Palka <ppalka@redhat.com>
Fri, 6 Mar 2020 18:19:13 +0000 (13:19 -0500)
committerPatrick Palka <ppalka@redhat.com>
Sun, 8 Mar 2020 14:45:14 +0000 (10:45 -0400)
commitff0a62841e27b838f17a9d6253d131206072df6f
tree6617667089e1f6fa2ddefd4ee5050a51fc2a5be1
parent6733ecaf3fe77871d86bfb36bcda5497ae2aaba7
c++: Fix pretty printing of TYPENAME_TYPEs

I noticed that in some concepts diagnostic messages, we were printing typename
types incorrectly, e.g. printing remove_reference_t<T> as

  typename remove_reference<T>::remove_reference_t

instead of

  typename remove_reference<T>::type.

Fix this by printing the TYPENAME_TYPE_FULLNAME instead of the TYPE_NAME in
cxx_pretty_printer::simple_type_specifier, which is consistent with how
dump_typename in error.c does it.

gcc/cp/ChangeLog:

* cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
[TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
TYPE_NAME.

gcc/testsuite/ChangeLog:

* g++.dg/concepts/diagnostic4.C: New test.
gcc/cp/ChangeLog
gcc/cp/cxx-pretty-print.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/diagnostic4.C [new file with mode: 0644]