diff options
author | Father Chrysostomos <sprout@cpan.org> | 2015-01-21 21:37:01 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2015-01-21 21:38:14 -0800 |
commit | 64016071d009e8d6ad2dc5a71b86e0e2741a7037 (patch) | |
tree | c6381b327af120aaf6e762c20adde5a2fef2c9a2 /ext/attributes/attributes.xs | |
parent | aa9621e6ae7442f957cee30769521f3030bd582f (diff) | |
download | perl-64016071d009e8d6ad2dc5a71b86e0e2741a7037.tar.gz |
attributes.xs: Don’t emit const warning for anons
The intent was to emit the warning for any cases other than custom
attributes on anonymous subs. I did that by checking to see whether
we had a closure prototype, warning otherwise. But anonymous subs
that are not closures are not closure prototypes. So we need to
check CvANON instead.
Diffstat (limited to 'ext/attributes/attributes.xs')
-rw-r--r-- | ext/attributes/attributes.xs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/attributes/attributes.xs b/ext/attributes/attributes.xs index b1dd60f3f4..9c9ec11f94 100644 --- a/ext/attributes/attributes.xs +++ b/ext/attributes/attributes.xs @@ -48,7 +48,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) if (negated) CvANONCONST_off(sv); else { - const bool warn = (!CvCLONE(sv) || CvCLONED(sv)) + const bool warn = (!CvANON(sv) || CvCLONED(sv)) && !CvANONCONST(sv); CvANONCONST_on(sv); if (warn) |