diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cpplex.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a9cf24d..2172a8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2000-10-29 Neil Booth <neilb@earthling.net> + + * cpplex.c (save_comment): Don't store new lines in C++ comments. + 2000-10-29 Michael Hayes <mhayes@redhat.com> * integrate.c (copy_insn_list): Copy the unchanging flag for calls. diff --git a/gcc/cpplex.c b/gcc/cpplex.c index fa737a9..ac8c3c4 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -724,6 +724,10 @@ save_comment (pfile, token, from) unsigned int len; len = pfile->buffer->cur - from + 1; /* + 1 for the initial '/'. */ + /* C++ comments probably (not definitely) have moved past a new + line, which we don't want to save in the comment. */ + if (pfile->buffer->read_ahead != EOF) + len--; buffer = _cpp_pool_alloc (pfile->string_pool, len); token->type = CPP_COMMENT; |