summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-21 13:02:47 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-21 13:02:47 -0800
commitefcf35c4ce9be7ae046664523cf99dac85257e4a (patch)
tree18f909afe9e245232f87255669fc76a8314c9af7 /sv.c
parentf965e9d4a373e14022c83f58715a948ea40a9b4a (diff)
downloadperl-efcf35c4ce9be7ae046664523cf99dac85257e4a.tar.gz
Make constant sub redef warnings obey scope
In perldiag, this is listed as (S), which means that outside of any use/no warnings scope it always warns, regardless of $^W. But this warning was ignoring use/no warnings, too. There were actually tests for this oddity, but I think those were added by mistake, or this was just not thought through. I cannot see how this is not a bug.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 0095e072e7..d4f0373b21 100644
--- a/sv.c
+++ b/sv.c
@@ -3833,6 +3833,7 @@ S_glob_assign_ref(pTHX_ SV *const dstr, SV *const sstr)
)
)
|| (CvCONST(cv)
+ && ckWARN_d(WARN_REDEFINE)
&& (!CvCONST((const CV *)sref)
|| sv_cmp(cv_const_sv(cv),
cv_const_sv((const CV *)