aboutsummaryrefslogtreecommitdiff
path: root/libcpp/macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/macro.c')
-rw-r--r--libcpp/macro.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 6269c15..369383f 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -2094,8 +2094,14 @@ replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro,
tokens_buff_add_token (buff, virt_locs,
t, t->src_loc, t->src_loc,
NULL, 0);
+ continue;
}
- else if (src->flags & PASTE_LEFT)
+ if (start && paste_flag == start && (*start)->flags & PASTE_LEFT)
+ /* If __VA_OPT__ expands to nothing (either because __VA_ARGS__
+ is empty or because it is __VA_OPT__() ), drop PASTE_LEFT
+ flag from previous token. */
+ copy_paste_flag (pfile, start, &pfile->avoid_paste);
+ if (src->flags & PASTE_LEFT)
{
/* Don't avoid paste after all. */
while (paste_flag && paste_flag != start