gcc/libiberty/testsuite
Jason Merrill 58fb912c15 c++: Fix demangling of <unresolved-name>
The ABI for unresolved scoped names on the RHS of . and -> used to be

  sr <type> <unqualified-id>

That changed years ago to something more complex, but G++ was never updated.
This change was particularly incompatible for simple qualified-ids like
A::x, which were previously mangled as sr1A1x, and now sr1AE1x.

This obviously makes life hard for demanglers, which can't know whether to
consume that E or not.  To work around this, we now try demangling with the
newer ABI, and if that fails and we saw an "sr", try again with the older
ABI.

libiberty/ChangeLog:

	PR c++/67343
	* cp-demangle.h (struct d_info): Add unresolved_name_state.
	* cp-demangle.c (d_prefix): Add subst parm.
	(d_nested_name): Pass it.
	(d_unresolved_name): Split out from...
	(d_expression_1): ...here.
	(d_demangle_callback): Maybe retry with old sr mangling.
	* testsuite/demangle-expected: Add test.
2020-12-21 21:13:41 -05:00
..
d-demangle-expected ubsan: d-demangle.c:214 signed integer overflow 2020-09-08 10:45:15 +09:30
demangle-expected c++: Fix demangling of <unresolved-name> 2020-12-21 21:13:41 -05:00
demangler-fuzzer.c Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.in Update copyright years. 2020-01-01 12:51:42 +01:00
rust-demangle-expected libiberty: Support the new ("v0") mangling scheme in rust-demangle 2020-11-13 18:59:09 +00:00
test-demangle.c Update copyright years. 2020-01-01 12:51:42 +01:00
test-expandargv.c Update copyright years. 2020-01-01 12:51:42 +01:00
test-pexecute.c Update copyright years. 2020-01-01 12:51:42 +01:00
test-strtol.c Update copyright years. 2020-01-01 12:51:42 +01:00