re PR c++/45399 ([C++0x] Warning for \0 in raw strings)
authorJason Merrill <jason@redhat.com>
Thu, 16 Jun 2011 22:09:12 +0000 (18:09 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 16 Jun 2011 22:09:12 +0000 (18:09 -0400)
PR c++/45399
* lex.c (lex_raw_string): Don't check for embedded NUL.

From-SVN: r175121

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/raw-string-12.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/lex.c

index 677ac710fda3b652ca702ca62b3df8433936a679..0da84e5642dfb46a9812069ba63f6438e70c4d7f 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-16  Jason Merrill  <jason@redhat.com>
 
+       PR c++/45399
+       * c-c++-common/raw-string-12.c: New.
+
        PR c++/49229
        * g++.dg/cpp0x/sfinae26.C: New.
 
diff --git a/gcc/testsuite/c-c++-common/raw-string-12.c b/gcc/testsuite/c-c++-common/raw-string-12.c
new file mode 100644 (file)
index 0000000..5bdf3b9
Binary files /dev/null and b/gcc/testsuite/c-c++-common/raw-string-12.c differ
index e1c01c136607fcd5702a2877d9f8739dcb3b2cdc..e36edfa981d12477122534b75680bcad78bcffab 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/45399
+       * lex.c (lex_raw_string): Don't check for embedded NUL.
+
 2011-06-06  Dodji Seketeli  <dodji@redhat.com>
 
        PR preprocessor/48532
index 6c3be7115047a2d8eac420f302ac137dc7a4387e..d29f36d436d7ce52a8e818b0d599917cb88d56cf 100644 (file)
@@ -1270,7 +1270,6 @@ static void
 lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base,
                const uchar *cur)
 {
-  source_location saw_NUL = 0;
   const uchar *raw_prefix;
   unsigned int raw_prefix_len = 0;
   enum cpp_ttype type;
@@ -1476,16 +1475,9 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base,
          cur = base = pfile->buffer->cur;
          note = &pfile->buffer->notes[pfile->buffer->cur_note];
        }
-      else if (c == '\0' && !saw_NUL)
-       LINEMAP_POSITION_FOR_COLUMN (saw_NUL, pfile->line_table,
-                                    CPP_BUF_COLUMN (pfile->buffer, cur));
     }
  break_outer_loop:
 
-  if (saw_NUL && !pfile->state.skipping)
-    cpp_error_with_line (pfile, CPP_DL_WARNING, saw_NUL, 0,
-              "null character(s) preserved in literal");
-
   pfile->buffer->cur = cur;
   if (first_buff == NULL)
     create_literal (pfile, token, base, cur - base, type);