#define FOLD cBOOL(RExC_flags & RXf_PMf_FOLD)
+/* For programs that want to be strictly Unicode compatible by dying if any
+ * attempt is made to match a non-Unicode code point against a Unicode
+ * property. */
+#define ALWAYS_WARN_SUPER ckDEAD(packWARN(WARN_NON_UNICODE))
+
#define OOB_NAMEDCLASS -1
/* There is no code point that is out-of-bounds, so this is problematic. But
&& ! invert
&& ! depends_list
&& ! (ANYOF_FLAGS(ret) & ANYOF_POSIXL)
- && ! HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION)
+ && ! HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION
+
+ /* We don't optimize if we are supposed to make sure all non-Unicode
+ * code points raise a warning, as only ANYOF nodes have this check.
+ * */
+ && ! ((ANYOF_FLAGS(ret) | ANYOF_WARN_SUPER) && ALWAYS_WARN_SUPER))
{
UV start, end;
U8 op = END; /* The optimzation node-type */
EXPECT
Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2.
########
-# TODO optimized regnode should still give warnings
+# NAME optimizable regnode should still give non_unicode warnings when fatalized
use warnings 'utf8';
+use warnings FATAL => 'non_unicode';
chr(0x110000) =~ /\p{lb=cr}/;
+EXPECT
+Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 3.
+########
+# NAME optimizable regnode should not give non_unicode warnings when warnings are off
no warnings 'non_unicode';
chr(0x110000) =~ /\p{lb=cr}/;
EXPECT
-Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2.
########
require "../test.pl";
use warnings 'utf8';