Revert "libcpp: Fix up ##__VA_OPT__ handling [PR89971]"
This reverts commit 86b98701bf
.
This commit is contained in:
parent
f0d57d62b1
commit
859eddcc06
|
@ -1,20 +0,0 @@
|
|||
/* PR preprocessor/89971 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-std=gnu99" { target c } } */
|
||||
/* { dg-options "-std=c++2a" { target c++ } } */
|
||||
|
||||
int a, c;
|
||||
#define m1(...) a /##__VA_OPT__(b) c
|
||||
#define m2(...) a /##__VA_OPT__() c
|
||||
#define m3(...) a##__VA_OPT__()##b = 1
|
||||
#define m4(...) a##__VA_OPT__(b c d)##e = 2
|
||||
|
||||
int
|
||||
foo (void)
|
||||
{
|
||||
int d = m1();
|
||||
int e = m2(1);
|
||||
int m3(1 2 3);
|
||||
int m4();
|
||||
return d + e + ab + ae;
|
||||
}
|
|
@ -1889,11 +1889,6 @@ replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro,
|
|||
paste_flag = tokens_buff_last_token_ptr (buff);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
/* With a non-empty __VA_OPT__ on the LHS of ##, the last
|
||||
|
|
Loading…
Reference in New Issue