########
# [perl #97110]
sub myrand(;$) { }
+sub whatever($) { }
my $a = myrand + 4 ;
+my $b = whatever + 4 ;
EXPECT
-Warning: Use of "myrand" without parentheses is ambiguous at - line 3.
+Warning: Use of "myrand" without parentheses is ambiguous at - line 4.
########
# toke.c
use warnings "ambiguous";
}
#define UNI(f) UNI2(f,XTERM)
#define UNIDOR(f) UNI2(f,XTERMORDORDOR)
-#define UNIPROTO(f) { \
- PL_last_uni = PL_oldbufptr; \
+#define UNIPROTO(f,optional) { \
+ if (optional) PL_last_uni = PL_oldbufptr; \
OPERATOR(f); \
}
{
STRLEN protolen = CvPROTOLEN(cv);
const char *proto = CvPROTO(cv);
+ bool optional;
if (!protolen)
TERM(FUNC0SUB);
- while (*proto == ';')
+ if ((optional = *proto == ';'))
+ do
proto++;
+ while (*proto == ';');
if (
(
(
*proto == '\\' && proto[1] && proto[2] == '\0'
)
)
- UNIPROTO(UNIOPSUB);
+ UNIPROTO(UNIOPSUB,optional);
if (*proto == '\\' && proto[1] == '[') {
const char *p = proto + 2;
while(*p && *p != ']')
++p;
- if(*p == ']' && !p[1]) UNIPROTO(UNIOPSUB);
+ if(*p == ']' && !p[1])
+ UNIPROTO(UNIOPSUB,optional);
}
if (*proto == '&' && *s == '{') {
if (PL_curstash)