summaryrefslogtreecommitdiff
path: root/ext/attributes/attributes.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/attributes/attributes.xs')
-rw-r--r--ext/attributes/attributes.xs14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/attributes/attributes.xs b/ext/attributes/attributes.xs
index 6b36812b13..7ba4f12613 100644
--- a/ext/attributes/attributes.xs
+++ b/ext/attributes/attributes.xs
@@ -44,6 +44,20 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs)
switch (SvTYPE(sv)) {
case SVt_PVCV:
switch ((int)len) {
+ case 5:
+ if (memEQ(name, "const", 5)) {
+ if (negated)
+ CvANONCONST_off(sv);
+ else {
+ const bool warn = (!CvCLONE(sv) || CvCLONED(sv))
+ && !CvANONCONST(sv);
+ CvANONCONST_on(sv);
+ if (warn)
+ break;
+ }
+ continue;
+ }
+ break;
case 6:
switch (name[3]) {
case 'l':