PR preprocessor/83063 - __VA_OPT__ and ##
authorJason Merrill <jason@redhat.com>
Thu, 15 Feb 2018 17:43:01 +0000 (12:43 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 15 Feb 2018 17:43:01 +0000 (12:43 -0500)
commit60887f8c2df851fd14988578dfe23126e2e8b9b5
treeb86ae939216c83047771ceb8b0eb24c2ce550791
parent5cedffbc3249a3f14ea57567a5f089d502cad8d3
PR preprocessor/83063 - __VA_OPT__ and ##

PR preprocessor/83708
* macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
(vaopt_state::vaopt_state): Adjust.
(vaopt_state::update_flags): Add BEGIN and END.
(vaopt_state::update): Return them.
(copy_paste_flag): Factor out of replace_args.
(last_token_is): New.
(replace_args): Handle BEGIN and END.  Avoid padding there.
(tokens_buff_last_token_ptr): Return NULL if no tokens.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r257696
gcc/testsuite/c-c++-common/cpp/va-opt-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/va-opt-3.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/macro.c