summaryrefslogtreecommitdiff
path: root/libcpp/internal.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-09-05 11:23:48 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-09-05 11:23:48 +0000
commit056f95ec951178a110b57e58a2ee434907de2e38 (patch)
treea8e6ad6be4a477e263294cb8c34feef8df71253e /libcpp/internal.h
parente7414688f16c4c9db2dacbc31da683887b4ba1bd (diff)
[preprocessor/91639] #includes at EOF
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00280.html libcpp/ PR preprocessor/91639 * directives.c (do_include_common): Tell lexer we're a #include. * files.c (_cpp_stack_file): Lexer will have always incremented. * internal.h (struct cpp_context): Extend in_directive's semantics. * lex.c (_cpp_lex_direct): Increment line for final \n when lexing for an ISO #include. * line-map.c (linemap_line_start): Remember if we overflowed. gcc/testsuite/ PR preprocessor/91639 * c-c++-common/cpp/pr91639.c: New. * c-c++-common/cpp/pr91639-one.h: New. * c-c++-common/cpp/pr91639-two.h: New. From-SVN: r275402
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r--libcpp/internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h
index d4768aee713..f9bcd37c571 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -234,7 +234,8 @@ struct cpp_context
struct lexer_state
{
- /* Nonzero if first token on line is CPP_HASH. */
+ /* 1 if we're handling a directive. 2 if it's an include-like
+ directive. */
unsigned char in_directive;
/* Nonzero if in a directive that will handle padding tokens itself.