diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-02-06 20:07:07 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-02-06 20:07:07 +0000 |
commit | 3c8465d07749a7f4ce6337d65f609bcef43ef890 (patch) | |
tree | ca0d7b456d6c4b2a3e8131b2d14a5e7913a2c6d2 /gcc/cppexp.c | |
parent | f2f7ac4038d7f26430149d35a6dae7932c0ff87f (diff) | |
download | gcc-3c8465d07749a7f4ce6337d65f609bcef43ef890.zip gcc-3c8465d07749a7f4ce6337d65f609bcef43ef890.tar.gz gcc-3c8465d07749a7f4ce6337d65f609bcef43ef890.tar.bz2 |
cppexp.c (parse_defined): Improve diagnostics for invalid syntax.
* cppexp.c (parse_defined): Improve diagnostics for invalid
syntax.
From-SVN: r39500
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r-- | gcc/cppexp.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; |