From: neil Date: Tue, 6 Feb 2001 20:07:07 +0000 (+0000) Subject: * cppexp.c (parse_defined): Improve diagnostics for invalid X-Git-Tag: upstream/4.9.2~96081 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e74fd59a8fd56073501dffa82dc26f956e7de8b;p=platform%2Fupstream%2Flinaro-gcc.git * cppexp.c (parse_defined): Improve diagnostics for invalid syntax. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39500 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b53f80a..6273b2a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2001-02-06 Neil Booth + * cppexp.c (parse_defined): Improve diagnostics for invalid + syntax. + +2001-02-06 Neil Booth + * cppmacro.c (cpp_get_token): Avoid pasting after a builtin. 2001-02-06 Mark Mitchell diff --git a/gcc/cppexp.c b/gcc/cppexp.c index 3031997..bea20a2 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -344,7 +344,20 @@ parse_defined (pfile) } } else - cpp_error (pfile, "\"defined\" without an identifier"); + { + cpp_error (pfile, "operator \"defined\" requires an identifier"); + if (token.flags & NAMED_OP) + { + cpp_token op; + + op.flags = 0; + op.type = token.type; + cpp_error (pfile, + "(\"%s\" is an alternative token for \"%s\" in C++)", + cpp_token_as_text (pfile, &token), + cpp_token_as_text (pfile, &op)); + } + } if (!node) op.op = CPP_ERROR;