c++: avoid redundant scope in diagnostics
commitf78eaffd1538efb46953a8bf90e9b95661fcfb33
authorJason Merrill <jason@redhat.com>
Fri, 18 Jun 2021 20:04:28 +0000 (18 16:04 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 3 Dec 2021 22:21:12 +0000 (3 17:21 -0500)
treea595c47d41da9f60490e44bfd4fba9ecdfc938f2
parent7bfe82e5a850621f86867072022536c3f717d54c
c++: avoid redundant scope in diagnostics

We can make some function signatures shorter to print by omitting redundant
nested-name-specifiers in the rest of the declarator.

gcc/cp/ChangeLog:

* error.c (current_dump_scope): New variable.
(dump_scope): Check it.
(dump_function_decl): Set it.

gcc/testsuite/ChangeLog:

* g++.dg/diagnostic/scope1.C: New test.
gcc/cp/error.c
gcc/testsuite/g++.dg/diagnostic/scope1.C [new file with mode: 0644]