This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/34692] [4.2/4.3 regression] Internal error with pragma in macro
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2008 09:02:14 -0000
- Subject: [Bug preprocessor/34692] [4.2/4.3 regression] Internal error with pragma in macro
- References: <bug-34692-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jakub at gcc dot gnu dot org 2008-01-25 09:02 -------
Subject: Bug 34692
Author: jakub
Date: Fri Jan 25 09:01:27 2008
New Revision: 131819
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131819
Log:
PR preprocessor/34692
* macro.c (collect_args): Add pragma_buff argument. Push
CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
than into arguments. Reset prevent_expansion and parsing_args
state at CPP_PRAGMA_EOL/CPP_EOF.
(funlike_invocation_p): Add pragma_buff argument, pass it through
to collect_args.
(enter_macro_context): Add result argument. Adjust
funlike_invocation_p caller. Emit all deferred pragma tokens
gathered during collect_args before the expansion, add a padding
token. Return 2 instead of 1 if any pragma tokens were prepended.
(cpp_get_token): If enter_macro_context returns 2, don't return
a padding token, instead cycle to grab CPP_PRAGMA token.
* directives.c (_cpp_handle_directive): If was_parsing_args
in deferred pragma, leave parsing_args and prevent_expansion as is.
* gcc.dg/cpp/pr34692.c: New test.
* gcc.dg/gomp/pr34692.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/cpp/pr34692.c
trunk/gcc/testsuite/gcc.dg/gomp/pr34692.c
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libcpp/ChangeLog
trunk/libcpp/directives.c
trunk/libcpp/macro.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34692