if (OP(and_with) == ANYOF_SYNTHETIC) {
anded_cp_list = and_with->invlist;
anded_flags = ANYOF_FLAGS(and_with);
+
+ /* XXX This is a kludge around what appears to be deficiencies in the
+ * optimizer. If we make S_ssc_anything() add in the WARN_SUPER flag,
+ * there are paths through the optimizer where it doesn't get weeded
+ * out when it should. And if we don't make some extra provision for
+ * it like the code just below, it doesn't get added when it should.
+ * This solution is to add it only when AND'ing, which is here, and
+ * only when what is being AND'ed is the pristine, original node
+ * matching anything. Thus it is like adding it to ssc_anything() but
+ * only when the result is to be AND'ed. Probably the same solution
+ * could be adopted for the same problem we have with /l matching,
+ * which is solved differently in S_ssc_init(), and that would lead to
+ * fewer false positives than that solution has. But if this solution
+ * creates bugs, the consequences are only that a warning isn't raised
+ * that should be; while the consequences for having /l bugs is
+ * incorrect matches */
+ if (ssc_is_anything(and_with)) {
+ anded_flags |= ANYOF_WARN_SUPER;
+ }
}
else {
anded_cp_list = get_ANYOF_cp_list_for_ssc(pRExC_state,
/* These are the flags that apply to both regular ANYOF nodes and synthetic
* start class nodes during construction of the SSC. During finalization of
* the SSC, other of the flags could be added to it */
-#define ANYOF_COMMON_FLAGS (ANYOF_LOCALE_FLAGS)
+#define ANYOF_COMMON_FLAGS (ANYOF_LOCALE_FLAGS | ANYOF_WARN_SUPER)
/* Character classes for node->classflags of ANYOF */
/* Should be synchronized with a table in regprop() */
Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72.
Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72.
########
-# TODO Matching Unicode property against above-Unicode code point outputs a warning even if optimizer rejects the match (in synthetic start class)
+# NAME Matching Unicode property against above-Unicode code point outputs a warning even if optimizer rejects the match (in synthetic start class)
use warnings 'non_unicode';
"\x{110000}" =~ /b?\p{Space}/;
EXPECT