aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-09-04 09:51:58 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2000-09-04 09:51:58 +0200
commit29844fa7c724106adef78cb758ae1a57461758ae (patch)
treec8f56f6b0d1c0f0dd9bb8b652744f962731af294 /gcc/cpplex.c
parente4e37381cab92b10ae601218bf461b2c904b4d6d (diff)
downloadgcc-29844fa7c724106adef78cb758ae1a57461758ae.zip
gcc-29844fa7c724106adef78cb758ae1a57461758ae.tar.gz
gcc-29844fa7c724106adef78cb758ae1a57461758ae.tar.bz2
cpplex.c (ON_REST_ARG): Check VAR_ARGS flag of current context, use posn - 1 to index into tokens array.
* cpplex.c (ON_REST_ARG): Check VAR_ARGS flag of current context, use posn - 1 to index into tokens array. (maybe_paste_with_next): Adjust caller. * gcc.dg/cpp/paste8.c: New test. From-SVN: r36128
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 37d1de8..ab5a987 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -202,8 +202,8 @@ TOKEN_LEN (token)
#define CURRENT_CONTEXT(pfile) ((pfile)->contexts + (pfile)->cur_context)
#define ON_REST_ARG(c) \
(((c)->flags & VAR_ARGS) \
- && (c)->u.list->tokens[(c)->posn].val.aux \
- == (unsigned int) ((c)->u.list->paramc - 1))
+ && ((c)-1)->u.list->tokens[((c)-1)->posn - 1].val.aux \
+ == (unsigned int) (((c)-1)->u.list->paramc - 1))
#define ASSIGN_FLAGS_AND_POS(d, s) \
do {(d)->flags = (s)->flags & (PREV_WHITE | BOL | PASTE_LEFT); \
@@ -2773,7 +2773,7 @@ maybe_paste_with_next (pfile, token)
the special extended semantics (see above). */
if (token->type == CPP_COMMA
&& IS_ARG_CONTEXT (CURRENT_CONTEXT (pfile))
- && ON_REST_ARG (CURRENT_CONTEXT (pfile) - 1))
+ && ON_REST_ARG (CURRENT_CONTEXT (pfile)))
/* no warning */;
else
cpp_warning (pfile,