Skip to content
Snippets Groups Projects
Commit 1bc474f6 authored by Marek Polacek's avatar Marek Polacek
Browse files

c++: handle decltype in nested-name-spec printing [PR118139]


Compiling this test, we emit:

  error: 'static void CW<T>::operator=(int) requires requires(typename'decltype_type' not supported by pp_cxx_unqualified_id::type x) {x;}' must be a non-static member function

where the DECLTYPE_TYPE isn't printed properly.  This patch fixes that
to print:

error: 'static void CW<T>::operator=(int) requires requires(typename decltype(T())::type x) {x;}' must be a non-static member function

	PR c++/118139

gcc/cp/ChangeLog:

	* cxx-pretty-print.cc (pp_cxx_nested_name_specifier): Handle
	a computed-type-specifier.

gcc/testsuite/ChangeLog:

	* g++.dg/diagnostic/decltype1.C: New test.

Reviewed-by: default avatarJason Merrill <jason@redhat.com>
parent 9cc31b4e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment