The code that checks constant keys and turns them into HEKs swallowed
the OP_CONST before the strictness checker could get to it, thus
allowing barewords when they should not be.
continue;
svp = cSVOPx_svp(key_op);
+ /* make sure it's not a bareword under strict subs */
+ if (key_op->op_private & OPpCONST_BARE &&
+ key_op->op_private & OPpCONST_STRICT)
+ {
+ no_bareword_allowed((OP*)key_op);
+ }
+
/* Make the CONST have a shared SV */
if ( !SvIsCOW_shared_hash(sv = *svp)
&& SvTYPE(sv) < SVt_PVMG
EXPECT
Bareword "FOO" not allowed while "strict subs" in use at - line 3.
Execution of - aborted due to compilation errors.
+########
+# [perl #126981] Strict subs vs. multideref
+sub CONST () { 'some_key' }
+my $h;
+my $v1 = $h->{+CONST_TYPO};
+use strict 'subs';
+my $v2 = $h->{+CONST_TYPO};
+EXPECT
+Bareword "CONST_TYPO" not allowed while "strict subs" in use at - line 6.
+Execution of - aborted due to compilation errors.