summaryrefslogtreecommitdiff
path: root/libcpp/directives.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2008-01-25 10:01:27 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-01-25 10:01:27 +0100
commit765d600ac5d94a978c00cd791c95ea75d1673e66 (patch)
treebd03a307239e9c5c965e1cf60415fca9659096aa /libcpp/directives.c
parent1525f2c3a5627b3fd3754c36cbcc7d855f7107cf (diff)
downloadgcc-765d600ac5d94a978c00cd791c95ea75d1673e66.tar.gz
re PR preprocessor/34692 (Internal error with pragma in macro)
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. From-SVN: r131819
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r--libcpp/directives.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 6e2e55c5389..c77e84bfec1 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -475,7 +475,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented)
_cpp_backup_tokens (pfile, 1);
end_directive (pfile, skip);
- if (was_parsing_args)
+ if (was_parsing_args && !pfile->state.in_deferred_pragma)
{
/* Restore state when within macro args. */
pfile->state.parsing_args = 2;