From: Eric Botcazou Date: Sat, 14 Sep 2024 12:48:24 +0000 (+0200) Subject: ada: Fix wrong handling of wide wide characters in Append_Decoded_With_Brackets X-Git-Tag: basepoints/gcc-16~4922 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a71c37a7241d8a73fe51712e5b4c7222afbaee8b;p=thirdparty%2Fgcc.git ada: Fix wrong handling of wide wide characters in Append_Decoded_With_Brackets This only shows up at link time when the name of a compilation unit contains a wide wide character. gcc/ada/ChangeLog: * namet.adb (Append_Decoded_With_Brackets): Fix condition for the cheap test at the beginning of the loop. --- diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb index 72f6c2088db0..2e3b9c014fc4 100644 --- a/gcc/ada/namet.adb +++ b/gcc/ada/namet.adb @@ -474,7 +474,11 @@ package body Namet is P := 1; while P < Temp.Length loop - if Temp.Chars (P + 1) in 'A' .. 'Z' then + -- Cheap test for the common case of no encoding + + if Temp.Chars (P + 1) in 'A' .. 'Z' + and then Temp.Chars (P + 1) /= 'W' + then P := P + 1; -- Uhh encoding