public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-10200] Revert "libcpp: Fix up ##__VA_OPT__ handling [PR89971]" Date: Fri, 27 May 2022 07:18:10 +0000 (GMT) [thread overview] Message-ID: <20220527071810.E793F3856DEF@sourceware.org> (raw) https://gcc.gnu.org/g:859eddcc06e859078502271ae331d4848fb98219 commit r9-10200-g859eddcc06e859078502271ae331d4848fb98219 Author: Richard Biener <rguenther@suse.de> Date: Fri May 27 08:49:26 2022 +0200 Revert "libcpp: Fix up ##__VA_OPT__ handling [PR89971]" This reverts commit 86b98701bf927ea438354723932e623557c04e42. Diff: --- gcc/testsuite/c-c++-common/cpp/va-opt-9.c | 20 -------------------- libcpp/macro.c | 5 ----- 2 files changed, 25 deletions(-) diff --git a/gcc/testsuite/c-c++-common/cpp/va-opt-9.c b/gcc/testsuite/c-c++-common/cpp/va-opt-9.c deleted file mode 100644 index 3f1d42b352f..00000000000 --- a/gcc/testsuite/c-c++-common/cpp/va-opt-9.c +++ /dev/null @@ -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; -} diff --git a/libcpp/macro.c b/libcpp/macro.c index 5f50438cf4f..97f3ca09181 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -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
reply other threads:[~2022-05-27 7:18 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220527071810.E793F3856DEF@sourceware.org \ --to=rguenth@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).