aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-07-20 17:57:38 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-07-20 17:57:38 +0000
commit6fee6033e7379f33c0fc6385f13424262d0bcae8 (patch)
tree411ca2344aad9c248c5506109b46dc34a0f64bbf /gcc/cpplib.h
parent1e18a243c26b73e0b22969891ec3584bd62e316c (diff)
downloadgcc-6fee6033e7379f33c0fc6385f13424262d0bcae8.zip
gcc-6fee6033e7379f33c0fc6385f13424262d0bcae8.tar.gz
gcc-6fee6033e7379f33c0fc6385f13424262d0bcae8.tar.bz2
cppmacro.c (CAN_PASTE_AFTER): New macro.
* cppmacro.c (CAN_PASTE_AFTER): New macro. (count_params): Don't set GNU_REST_ARGS on anything. (save_expansion): Set PASTE_LEFT only on tokens for which CAN_PASTE_AFTER is true, or which are named operators. * cpplex.c (parse_args): Distinguish between a rest argument given one empty argument, and a rest argument given zero arguments. (maybe_paste_with_next): Look for VOID_REST tag, and trigger deletion of previous token based on that. (get_raw_token): Flatten some control structure. * cpplib.h (CPP_LAST_EQ): Correct. (VOID_REST): New token flag. (GNU_REST_ARGS): Delete. * gcc.dg/cpp/20000625-2.c, gcc.dg/cpp/macsyntx.c: Update error regexps. * gcc.dg/cpp/paste6.c: New test. From-SVN: r35146
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 4cec348..62755a9 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -46,7 +46,7 @@ typedef struct cpp_hashnode cpp_hashnode;
the same order as their counterparts without the '=', like ">>". */
/* Positions in the table. */
-#define CPP_LAST_EQ CPP_LSHIFT
+#define CPP_LAST_EQ CPP_MAX
#define CPP_FIRST_DIGRAPH CPP_HASH
#define TTYPE_TABLE \
@@ -154,7 +154,8 @@ struct cpp_string
#define STRINGIFY_ARG (1 << 3) /* If macro argument to be stringified. */
#define PASTE_LEFT (1 << 4) /* If on LHS of a ## operator. */
#define PASTED (1 << 5) /* The result of a ## operator. */
-#define NAMED_OP (1 << 6) /* C++ named operators, also defined */
+#define NAMED_OP (1 << 6) /* C++ named operators, also "defined". */
+#define VOID_REST (1 << 7) /* When a rest arg gets zero actual args. */
/* A preprocessing token. This has been carefully packed and should
occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */
@@ -178,8 +179,7 @@ struct cpp_token
/* cpp_toklist flags. */
#define LIST_OFFSET (1 << 0)
#define VAR_ARGS (1 << 1)
-#define GNU_REST_ARGS (1 << 2) /* Set in addition to VAR_ARGS. */
-#define BEG_OF_FILE (1 << 3)
+#define BEG_OF_FILE (1 << 2)
struct directive; /* These are deliberately incomplete. */
struct answer;