From e3d27bea9a451fcb7f16dee611ad21126353a942 Mon Sep 17 00:00:00 2001 From: Elvin Aslanov Date: Tue, 9 Jul 2024 23:53:14 +0200 Subject: [PATCH] Mark `__CLASS__` as experimental Fixes https://github.com/Perl/perl5/issues/22288 --- pod/perldiag.pod | 6 ++++++ toke.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 2b26514f8bca..c2cec95349dc 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -44,6 +44,12 @@ letter. =over 4 +=item __CLASS__ is experimental + +(S experimental::class) This warning is emitted if you use the C<__CLASS__> +keyword of C. This keyword is currently +experimental and its behaviour may change in future releases of Perl. + =item accept() on closed socket %s (W closed) You tried to do an accept on a closed socket. Did you forget diff --git a/toke.c b/toke.c index 6f292d617628..7e5907082ed2 100644 --- a/toke.c +++ b/toke.c @@ -8003,6 +8003,8 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct : newSVOP(OP_RUNCV, 0, &PL_sv_undef)); case KEY___CLASS__: + Perl_ck_warner_d(aTHX_ + packWARN(WARN_EXPERIMENTAL__CLASS), "__CLASS__ is experimental"); FUN0(OP_CLASSNAME); case KEY_AUTOLOAD: