PR preprocessor/65238
commit640a580680b2b92f9cffdb15b2cf3f8724bdc910
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Mar 2015 08:02:39 +0000 (23 08:02 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Mar 2015 08:02:39 +0000 (23 08:02 +0000)
treeca62635a383044139bfcff92d867148331a09a0f
parent9e578cf5f5e9b5d6433b1320a1934e8967f5a3fe
PR preprocessor/65238
* internal.h (_cpp_scan_out_logical_line): Add third argument.
* directives.c (prepare_directive_trad): Pass false to it.
* traditional.c (_cpp_read_logical_line_trad,
_cpp_create_trad_definition): Likewise.
(struct fun_macro): Add paramc field.
(fun_like_macro): New function.
(maybe_start_funlike): Handle NODE_BUILTIN macros.  Initialize
macro->paramc field.
(save_argument): Use macro->paramc instead of
macro->node->value.macro->paramc.
(push_replacement_text): Formatting fix.
(recursive_macro): Use fun_like_macro helper.
(_cpp_scan_out_logical_line): Likewise.  Add BUILTIN_MACRO_ARG
argument.  Initialize fmacro.paramc field.  Handle builtin
function-like macros.

* c-c++-common/cpp/pr65238-1.c: New test.
* gcc.dg/cpp/pr65238-2.c: New test.
* gcc.dg/cpp/trad/pr65238-3.c: New test.
* gcc.dg/cpp/trad/pr65238-4.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221587 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cpp/pr65238-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/pr65238-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/trad/pr65238-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/directives.c
libcpp/internal.h
libcpp/traditional.c