summaryrefslogtreecommitdiff
path: root/t/lib/warnings
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2017-01-15 13:23:34 +0100
committerAbigail <abigail@abigail.be>2017-01-16 19:18:17 +0100
commita678626e6d2dd11740073117f5269f7efee639de (patch)
tree22e197898471fee8d608a3dd6d613e333abb475c /t/lib/warnings
parent753c381f465ebe5b971baaf5f00099811c27b2fd (diff)
downloadperl-a678626e6d2dd11740073117f5269f7efee639de.tar.gz
Revert "Remove deprecation warnings related to $* and $#."
This reverts commit e9b5346b919b4f4cc0096af4644cb0d48d64e14c. We've decided that instead of leaving $* and $# as usuable, magic-free variables, we instead make it fatal to use them. Therefore, we restore the warnings their use gives, and in a subsequent commit, we fix the warning to indicate the version where their use becomes fatal.
Diffstat (limited to 't/lib/warnings')
-rw-r--r--t/lib/warnings/2use20
-rw-r--r--t/lib/warnings/gv60
2 files changed, 69 insertions, 11 deletions
diff --git a/t/lib/warnings/2use b/t/lib/warnings/2use
index ab5586a0a6..4e10d4b73d 100644
--- a/t/lib/warnings/2use
+++ b/t/lib/warnings/2use
@@ -361,21 +361,19 @@ Use of uninitialized value $c in scalar chop at - line 9.
########
# Check that deprecation warnings are not implicitly disabled by use
-our $foo :unique;
-use warnings "void";
-our $bar :unique;
$*;
+use warnings "void";
+$#;
EXPECT
-Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 3.
-Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 5.
-Useless use of a variable in void context at - line 6.
+$* is no longer supported at - line 3.
+$# is no longer supported at - line 5.
+Useless use of a variable in void context at - line 5.
########
# Check that deprecation warnings are not implicitly disabled by no
-our $foo :unique;
-no warnings "void";
-our $bar :unique;
$*;
+no warnings "void";
+$#;
EXPECT
-Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 3.
-Attribute "unique" is deprecated, and will disappear in Perl 5.28 at - line 5.
+$* is no longer supported at - line 3.
+$# is no longer supported at - line 5.
diff --git a/t/lib/warnings/gv b/t/lib/warnings/gv
index 08a8474d4b..20c8ac55a1 100644
--- a/t/lib/warnings/gv
+++ b/t/lib/warnings/gv
@@ -59,6 +59,66 @@ EXPECT
Use of inherited AUTOLOAD for non-method main::fᕃƌ() is deprecated. This will be fatal in Perl 5.28 at - line 7.
########
# gv.c
+$a = ${"#"};
+$a = ${"*"};
+no warnings 'deprecated' ;
+$a = ${"#"};
+$a = ${"*"};
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+########
+# gv.c
+$a = ${#};
+$a = ${*};
+no warnings 'deprecated' ;
+$a = ${#};
+$a = ${*};
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+########
+# gv.c
+$a = $#;
+$a = $*;
+$# = $a;
+$* = $a;
+$a = \$#;
+$a = \$*;
+no warnings 'deprecated' ;
+$a = $#;
+$a = $*;
+$# = $a;
+$* = $a;
+$a = \$#;
+$a = \$*;
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+$# is no longer supported at - line 4.
+$* is no longer supported at - line 5.
+$# is no longer supported at - line 6.
+$* is no longer supported at - line 7.
+########
+# gv.c
+@a = @#;
+@a = @*;
+$a = $#;
+$a = $*;
+EXPECT
+$# is no longer supported at - line 4.
+$* is no longer supported at - line 5.
+########
+# gv.c
+$a = $#;
+$a = $*;
+@a = @#;
+@a = @*;
+EXPECT
+$# is no longer supported at - line 2.
+$* is no longer supported at - line 3.
+########
+# gv.c
$a = ${^ENCODING};
$a = ${^E_NCODING};
${^ENCODING} = 1;