diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-03-06 13:19:13 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-03-08 10:45:14 -0400 |
commit | ff0a62841e27b838f17a9d6253d131206072df6f (patch) | |
tree | 6617667089e1f6fa2ddefd4ee5050a51fc2a5be1 /gcc/cp | |
parent | 6733ecaf3fe77871d86bfb36bcda5497ae2aaba7 (diff) | |
download | gcc-ff0a62841e27b838f17a9d6253d131206072df6f.zip gcc-ff0a62841e27b838f17a9d6253d131206072df6f.tar.gz gcc-ff0a62841e27b838f17a9d6253d131206072df6f.tar.bz2 |
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.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cxx-pretty-print.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 98640a6..48ef75c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2020-03-08 Patrick Palka <ppalka@redhat.com> + + * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier) + [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the + TYPE_NAME. + 2020-03-06 Nathan Sidwell <nathan@acm.org> PR c++/94027 diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 397bdbf..100154e 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -1360,7 +1360,7 @@ cxx_pretty_printer::simple_type_specifier (tree t) case TYPENAME_TYPE: pp_cxx_ws_string (this, "typename"); pp_cxx_nested_name_specifier (this, TYPE_CONTEXT (t)); - pp_cxx_unqualified_id (this, TYPE_NAME (t)); + pp_cxx_unqualified_id (this, TYPENAME_TYPE_FULLNAME (t)); break; default: |