PR preprocessor/83063 - __VA_OPT__ and ##
commitb78b81a8b090fa62f6bf68cf871099e32707030d
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Feb 2018 17:43:01 +0000 (15 17:43 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Feb 2018 17:43:01 +0000 (15 17:43 +0000)
treeb86ae939216c83047771ceb8b0eb24c2ce550791
parent7422ddf0036a7410dd7192722719010764c1730c
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257696 138bc75d-0d04-0410-961f-82ee72b054a4
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