This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a deprecation warning for all uses of @*, %*, &* and **.
[perl5.git] / t / lib / warnings / gv
CommitLineData
599cee73
PM
1 gv.c AOK
2
3 Can't locate package %s for @%s::ISA
4 @ISA = qw(Fred); joe()
5
6 Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated
7 sub Other::AUTOLOAD { 1 } sub Other::fred {}
8 @ISA = qw(Other) ;
9 fred() ;
10
8ae1fe26 11 $# is no longer supported
9b332a20 12 $* is no longer supported
599cee73
PM
13
14 $a = ${"#"} ;
15 $a = ${"*"} ;
16
0453d815
PM
17 Mandatory Warnings ALL TODO
18 ------------------
599cee73 19
34ee6772 20 Had to create %SVf unexpectedly [gv_fetchpv]
0453d815
PM
21 Attempt to free unreferenced glob pointers [gp_free]
22
599cee73
PM
23__END__
24# gv.c
f40a7154 25use warnings 'syntax' ;
599cee73
PM
26@ISA = qw(Fred); joe()
27EXPECT
28Can't locate package Fred for @main::ISA at - line 3.
29Undefined subroutine &main::joe called at - line 3.
30########
31# gv.c
f40a7154 32no warnings 'syntax' ;
0453d815
PM
33@ISA = qw(Fred); joe()
34EXPECT
35Undefined subroutine &main::joe called at - line 3.
36########
37# gv.c
599cee73
PM
38sub Other::AUTOLOAD { 1 } sub Other::fred {}
39@ISA = qw(Other) ;
4438c4b7 40use warnings 'deprecated' ;
599cee73
PM
41fred() ;
42EXPECT
43Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 5.
44########
45# gv.c
34ee6772
BF
46use utf8;
47use open qw( :utf8 :std );
48sub Oᕞʀ::AUTOLOAD { 1 } sub Oᕞʀ::fᕃƌ {}
49@ISA = qw(Oᕞʀ) ;
50use warnings 'deprecated' ;
51fᕃƌ() ;
52EXPECT
53Use of inherited AUTOLOAD for non-method main::fᕃƌ() is deprecated at - line 7.
54########
55# gv.c
599cee73
PM
56$a = ${"#"};
57$a = ${"*"};
4438c4b7 58no warnings 'deprecated' ;
0453d815
PM
59$a = ${"#"};
60$a = ${"*"};
599cee73 61EXPECT
fafcdf9e 62$# is no longer supported at - line 2.
53213d38 63$* is no longer supported, and will become a syntax error at - line 3.
34ee6772
BF
64########
65# gv.c
340067e5
NC
66$a = ${#};
67$a = ${*};
68no warnings 'deprecated' ;
69$a = ${#};
70$a = ${*};
71EXPECT
72$# is no longer supported at - line 2.
53213d38 73$* is no longer supported, and will become a syntax error at - line 3.
340067e5
NC
74########
75# gv.c
76$a = $#;
77$a = $*;
ff683671
NC
78$# = $a;
79$* = $a;
80$a = \$#;
81$a = \$*;
340067e5
NC
82no warnings 'deprecated' ;
83$a = $#;
84$a = $*;
ff683671
NC
85$# = $a;
86$* = $a;
87$a = \$#;
88$a = \$*;
340067e5
NC
89EXPECT
90$# is no longer supported at - line 2.
53213d38 91$* is no longer supported, and will become a syntax error at - line 3.
ff683671 92$# is no longer supported at - line 4.
53213d38 93$* is no longer supported, and will become a syntax error at - line 5.
ff683671 94$# is no longer supported at - line 6.
53213d38 95$* is no longer supported, and will become a syntax error at - line 7.
340067e5
NC
96########
97# gv.c
ff683671
NC
98@a = @#;
99@a = @*;
100$a = $#;
101$a = $*;
340067e5 102EXPECT
982110e0 103@* is deprecated, and will become a syntax error at - line 3.
ff683671 104$# is no longer supported at - line 4.
53213d38 105$* is no longer supported, and will become a syntax error at - line 5.
340067e5
NC
106########
107# gv.c
ff683671
NC
108$a = $#;
109$a = $*;
110@a = @#;
111@a = @*;
340067e5
NC
112EXPECT
113$# is no longer supported at - line 2.
53213d38 114$* is no longer supported, and will become a syntax error at - line 3.
982110e0
NC
115@* is deprecated, and will become a syntax error at - line 5.
116########
117# gv.c
118$a = \@*;
119$a = \&*;
120$a = \**;
121$a = \%*;
122no warnings 'deprecated' ;
123$a = \@*;
124$a = \&*;
125$a = \**;
126$a = \%*;
127EXPECT
128@* is deprecated, and will become a syntax error at - line 2.
129&* is deprecated, and will become a syntax error at - line 3.
130** is deprecated, and will become a syntax error at - line 4.
131%* is deprecated, and will become a syntax error at - line 5.
340067e5
NC
132########
133# gv.c
34ee6772
BF
134use warnings 'syntax' ;
135use utf8;
136use open qw( :utf8 :std );
137package Y;
138@ISA = qw(Fred); joe()
139EXPECT
140Can't locate package Fred for @Y::ISA at - line 6.
141Undefined subroutine &Y::joe called at - line 6.