From: Jonathan Wakely Date: Thu, 15 May 2025 15:03:53 +0000 (+0100) Subject: libstdc++: Fix proc check_v3_target_namedlocale for "" locale [PR65909] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c07ba5398be194cc390934ae159f7941890bd848;p=thirdparty%2Fgcc.git libstdc++: Fix proc check_v3_target_namedlocale for "" locale [PR65909] When the last format argument to a Tcl proc is named 'args' it has special meaning and is a list that accepts any number of arguments[1]. This means when "" is passed to the proc and then we expand "$args" we get an empty list formatted as "{}". My r16-537-g3e2b83faeb6b14 change broke all uses of dg-require-namedlocale with empty locale names, "". By changing the name of the formal argument to 'locale' we avoid the special behaviour for 'args' and now it only accepts a single argument (as was always intended). When expanded as "$locale" we get "" as I expected. [1] https://www.tcl-lang.org/man/tcl9.0/TclCmd/proc.html libstdc++-v3/ChangeLog: PR libstdc++/65909 * testsuite/lib/libstdc++.exp (check_v3_target_namedlocale): Change name of formal argument to locale. Reviewed-by: Tomasz KamiƄski --- diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index da1f4245e4b..9f2dd8a1724 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -1019,8 +1019,8 @@ proc check_v3_target_time { } { }] } -proc check_v3_target_namedlocale { args } { - set key "et_namedlocale $args" +proc check_v3_target_namedlocale { locale } { + set key "et_namedlocale $locale" return [check_v3_target_prop_cached $key { global tool # Set up, compile, and execute a C++ test program that tries to use @@ -1048,7 +1048,7 @@ proc check_v3_target_namedlocale { args } { puts $f "}" puts $f "int main ()" puts $f "{" - puts $f " const char *namedloc = transform_locale(\"$args\");" + puts $f " const char *namedloc = transform_locale(\"$locale\");" puts $f " try" puts $f " {" puts $f " locale((const char*)namedloc);" @@ -1075,7 +1075,7 @@ proc check_v3_target_namedlocale { args } { set result [${tool}_load "./$exe" "" ""] set status [lindex $result 0] - verbose "check_v3_target_namedlocale <$args>: status is <$status>" 2 + verbose "check_v3_target_namedlocale <$locale>: status is <$status>" 2 if { $status == "pass" } { return 1