This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
suppress bogus warning on C<sub x {} x()>
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 17 Sep 1998 01:45:14 +0000 (01:45 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 17 Sep 1998 01:45:14 +0000 (01:45 +0000)
p4raw-id: //depot/perl@1787

toke.c

diff --git a/toke.c b/toke.c
index d22a709..62d54c6 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2979,7 +2979,8 @@ yylex(void)
                tmp = -tmp;
                gv = Nullgv;
                gvp = 0;
-               if (ckWARN(WARN_AMBIGUOUS) && hgv)
+               if (ckWARN(WARN_AMBIGUOUS) && hgv
+                   && tmp != KEY_x && tmp != KEY_CORE) /* never ambiguous */
                    warner(WARN_AMBIGUOUS,
                        "Ambiguous call resolved as CORE::%s(), %s",
                         GvENAME(hgv), "qualify as such or use &");