Skip to content
Snippets Groups Projects
  • Nathan Sidwell's avatar
    5abe05b4
    preprocessor: Fix non-fn fn-like macro at EOF [PR97471] · 5abe05b4
    Nathan Sidwell authored
    We inject EOF tokens between macro argument lists, but had
    confused/stale logic in the non-fn invocation.  Renamed the magic
    'eof' token, as it's now only used for macro argument termination.
    Always rewind the non-OPEN_PAREN token.
    
    	libcpp/
    	* internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
    	* init.c (cpp_create_reader): Adjust.
    	* macro.c (collect_args): Use endarg for separator.  Always rewind
    	in the not-fn case.
    	gcc/testsuite/
    	* c-c++-common/cpp/pr97471.c: New.
    5abe05b4
    History
    preprocessor: Fix non-fn fn-like macro at EOF [PR97471]
    Nathan Sidwell authored
    We inject EOF tokens between macro argument lists, but had
    confused/stale logic in the non-fn invocation.  Renamed the magic
    'eof' token, as it's now only used for macro argument termination.
    Always rewind the non-OPEN_PAREN token.
    
    	libcpp/
    	* internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
    	* init.c (cpp_create_reader): Adjust.
    	* macro.c (collect_args): Use endarg for separator.  Always rewind
    	in the not-fn case.
    	gcc/testsuite/
    	* c-c++-common/cpp/pr97471.c: New.