]> git.ipfire.org Git - thirdparty/gcc.git/commit - libcpp/ChangeLog
re PR preprocessor/20078 (Gcc doesn't complain about non-benign macro definitions)
authorJoseph Myers <joseph@codesourcery.com>
Sun, 19 Apr 2009 17:10:56 +0000 (18:10 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sun, 19 Apr 2009 17:10:56 +0000 (18:10 +0100)
commitaa50850225d70521ace3948a8e5858425a918f6a
tree311d607f4a7b5f177b00f2193802a219b80ccc5e
parentb6fa5b01018ac42682f8d69fff9e48f50b87c910
re PR preprocessor/20078 (Gcc doesn't complain about non-benign macro definitions)

libcpp:
PR preprocessor/20078
* include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
field.
* include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
(struct cpp_token): Change flags to unsigned short.
* lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
(_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
(cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
tokens.
* macro.c (macro_real_token_count): New.
(enter_macro_context, replace_args): Use macro_real_token_count.
(create_iso_definition): Record whitespace surrounding and digraph
spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
Set extra_tokens and save CPP_PASTE tokens with arg_no set for
multiple consecutive ## tokens.
(_cpp_create_definition): Initialize extra_tokens.
(cpp_macro_definition): Use macro_real_token_count.

gcc/testsuite:
* gcc.dg/cpp/paste16.c, gcc.dg/cpp/redef4.c: New tests.

From-SVN: r146352
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/paste16.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/redef4.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/include/cpp-id-data.h
libcpp/include/cpplib.h
libcpp/lex.c
libcpp/macro.c