Patchwork libcpp PATCH for c++/45399 (undesired NUL warning in raw strings)

login
register
mail settings
Submitter Jason Merrill
Date June 16, 2011, 10 p.m.
Message ID <4DFA7D04.7080707@redhat.com>
Download mbox | patch
Permalink /patch/100732/
State New
Headers show

Comments

Jason Merrill - June 16, 2011, 10 p.m.
People want to use raw strings for embedding binary data in source 
files, so we don't want to complain about \0 in the middle.

Tested x86_64-pc-linux-gnu, applying to trunk.

Patch

commit 35ebd948dd567743ed6b31deb063b5ef948304a9
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jun 15 14:16:43 2011 -0400

    	PR c++/45399
    	* lex.c (lex_raw_string): Don't check for embedded NUL.

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
index 0000000..5bdf3b9
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/raw-string-12.c
@@ -0,0 +1,5 @@ 
+// PR c++/45399
+// { dg-options "-std=gnu99" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+
+char const *S = R"raw(