c++: "'decltype_type' not supported" in diagnostic [PR85278]
authorPatrick Palka <ppalka@redhat.com>
Tue, 14 Apr 2020 18:22:31 +0000 (14:22 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 14 Apr 2020 18:22:31 +0000 (14:22 -0400)
commit58a29af8ef14bfa2d595deed5144891bff821eff
tree9c328539d5e9ef52e34dc7aebecda7faad0d4c9c
parent9707b593f88041e74e5cf5640ec64fea13a0387c
c++: "'decltype_type' not supported" in diagnostic [PR85278]

This fixes a garbled concepts diagnostic by moving the handling of DECLTYPE_TYPE
from pp_cxx_type_specifier_seq to cxx_pretty_printer::simple_type_specifier, a
move which also seems to be more consistent with the language grammar.

This patch also fixes pretty printing of rvalue reference types via
cxx_pretty_printer::type_id, which eventually calls pp_c_pointer which currently
doesn't distinguish between lvalue and rvalue references.

gcc/c-family/ChangeLog:

PR c++/85278
* c-pretty-print.c (pp_c_pointer) <case REFERENCE_TYPE>: Print a double
ampersand if it's an rvalue reference type.

gcc/cp/ChangeLog:

PR c++/85278
* cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
<case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
(pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
(cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
New no-op case.

gcc/testsuite/ChangeLog:

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