From: Rafael Garcia-Suarez Date: Sat, 24 Feb 2007 09:29:20 +0000 (+0000) Subject: C should not warn. Don't make scan_ident test for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e8ae98db8e0325c510ea11398d7cf2a69dfcbcf7;p=p5sagit%2Fp5-mst-13.2.git C should not warn. Don't make scan_ident test for ambiguous unary ops when the following token is a hash identifier. (like with scalars and arrays) p4raw-id: //depot/perl@30387 --- diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index e4fa82c..af27047 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -588,6 +588,11 @@ Warning: Use of "rand" without parentheses is ambiguous at - line 8. Warning: Use of "rand" without parentheses is ambiguous at - line 10. ######## # toke.c +use warnings "ambiguous"; +print for keys %+; # should not warn +EXPECT +######## +# toke.c sub fred {}; -fred ; EXPECT diff --git a/toke.c b/toke.c index 5248d46..89bb87b 100644 --- a/toke.c +++ b/toke.c @@ -4132,7 +4132,8 @@ Perl_yylex(pTHX) Mop(OP_MODULO); } PL_tokenbuf[0] = '%'; - s = scan_ident(s, PL_bufend, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, TRUE); + s = scan_ident(s, PL_bufend, PL_tokenbuf + 1, + sizeof PL_tokenbuf - 1, FALSE); if (!PL_tokenbuf[1]) { PREREF('%'); }