This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp.c: Make warnings utf8-clean
authorBrian Fraser <fraserbn@gmail.com>
Wed, 6 Jul 2011 16:08:37 +0000 (13:08 -0300)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 6 Oct 2011 20:01:12 +0000 (13:01 -0700)
pp.c
t/lib/warnings/pp

diff --git a/pp.c b/pp.c
index a102a21..3590bd9 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -980,9 +980,11 @@ PP(pp_undef)
        break;
     case SVt_PVCV:
        if (cv_const_sv((const CV *)sv))
-           Perl_ck_warner(aTHX_ packWARN(WARN_MISC), "Constant subroutine %s undefined",
-                          CvANON((const CV *)sv) ? "(anonymous)"
-                          : GvENAME(CvGV((const CV *)sv)));
+           Perl_ck_warner(aTHX_ packWARN(WARN_MISC),
+                          "Constant subroutine %"SVf" undefined",
+                          SVfARG(CvANON((const CV *)sv)
+                             ? newSVpvs_flags("(anonymous)", SVs_TEMP)
+                             : sv_2mortal(newSVhek(GvENAME_HEK(CvGV((const CV *)sv))))));
        /* FALLTHROUGH */
     case SVt_PVFM:
        {
index e6b3802..89ebcbc 100644 (file)
@@ -96,6 +96,18 @@ EXPECT
 Constant subroutine foo undefined at - line 4.
 ########
 # pp.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings 'misc';
+sub ฝᶱ () { 1 }
+undef &ฝᶱ;
+no warnings 'misc';
+sub ƚ () { 2 }
+undef &ƚ;
+EXPECT
+Constant subroutine ฝᶱ undefined at - line 6.
+########
+# pp.c
 use warnings 'misc';
 $foo = sub () { 3 };
 undef &$foo;