diff options
-rw-r--r-- | gcc/go/gofrontend/lex.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc index 3404ced..aa7071d 100644 --- a/gcc/go/gofrontend/lex.cc +++ b/gcc/go/gofrontend/lex.cc @@ -1440,7 +1440,10 @@ Lex::gather_raw_string() bool issued_error; this->lineoff_ = p - this->linebuf_; p = this->advance_one_utf8_char(p, &c, &issued_error); - Lex::append_char(c, true, &value, loc); + // "Carriage return characters ('\r') inside raw string literals + // are discarded from the raw string value." + if (c != '\r') + Lex::append_char(c, true, &value, loc); } this->lineoff_ = p - this->linebuf_; if (!this->require_line()) |