summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-20 23:46:48 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-21 00:32:32 -0800
commit799fd3b94fb5c431b24ee141e32a0b09d56f303c (patch)
tree5904101734c7d8b82fa4850ab89e14140768db5f /t
parent53e2b4984825f4be9303a134996decfc9fb895ed (diff)
downloadperl-799fd3b94fb5c431b24ee141e32a0b09d56f303c.tar.gz
Restore autouse’s exemption from redef warnings
This also restores the subroutine redefinition warning for newly-cre- ated XSUBs outside the autouse package. See below. This commit added the exemption to fix a known bug, that loading a module and importing from it would cause a redefinition warning if there were an autouse stub: perl-5.004_03-1092-g2f34f9d commit 2f34f9d4825ac9262ece854fc4c50479f4838ff8 Author: Ilya Zakharevich <ilya@math.berkeley.edu> Date: Mon Mar 2 16:36:02 1998 -0500 Make autouse -w-safe p4raw-id: //depot/perl@781 The subroutine redefinition warning occurs in three places. This commit removed the autouse exemption from two of them. I can’t see how it wasn’t a mistake, as <5104D4DBC598D211B5FE0000F8FE7EB202D49EE9@mbtlipnt02.btlabs.bt.co.uk> (the apparent source of the patch, makes no mention of it: perl-5.005_02-2920-ge476b1b commit e476b1b5c29f354cf8dad61a9fc6d855bdfb5b7d Author: Gurusamy Sarathy <gsar@cpan.org> Date: Sun Feb 20 22:58:09 2000 +0000 lexical warnings update, ability to inspect bitmask in calling scope, among other things (from Paul Marquess) p4raw-id: //depot/perl@5170 This commit refactored things to remove some compiler warnings, but in doing so reversed the logic of the condition, causing redefini- tion warnings for newly-created XSUBs to apply only to subs from the autouse package: perl-5.8.0-5131-g66a1b24 commit 66a1b24beb76ea873ad4caa57ee3ab9df945afbf Author: Andy Lester <andy@petdance.com> Date: Mon Jun 6 05:11:07 2005 -0500 Random cleanups #47 Message-ID: <20050606151107.GC7022@petdance.com> p4raw-id: //depot/perl@24735 I’ve basically reinstated the changes in 2f34f9d4, but with tests this time. It may not make sense for autouse to be exempt for newATTRSUB and newXS, but keeping the logic surrounding the warning as close as possible to being the same could allow future refactorings to merge them.
Diffstat (limited to 't')
-rw-r--r--t/op/stash.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/op/stash.t b/t/op/stash.t
index 9e223eb9ac..3c315255c6 100644
--- a/t/op/stash.t
+++ b/t/op/stash.t
@@ -28,9 +28,9 @@ fresh_perl_is(
# Used to segfault, too
SKIP: {
skip_if_miniperl('requires XS');
- fresh_perl_is(
+ fresh_perl_like(
'sub foo::bar{}; $mro::{get_mro}=*foo::bar; undef %foo::; require mro',
- '',
+ qr/^Subroutine mro::get_mro redefined at /,
{ switches => [ '-w' ] },
q(Defining an XSUB over an existing sub with no stash under warnings),
);