From patchwork Thu Jun 16 22:00:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 100732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B206DB6F88 for ; Fri, 17 Jun 2011 08:00:58 +1000 (EST) Received: (qmail 6918 invoked by alias); 16 Jun 2011 22:00:57 -0000 Received: (qmail 6908 invoked by uid 22791); 16 Jun 2011 22:00:56 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 22:00:38 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5GM0bUt015820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Jun 2011 18:00:37 -0400 Received: from [127.0.0.1] (ovpn-113-143.phx2.redhat.com [10.3.113.143]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5GM0akn006542 for ; Thu, 16 Jun 2011 18:00:37 -0400 Message-ID: <4DFA7D04.7080707@redhat.com> Date: Thu, 16 Jun 2011 18:00:36 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches List Subject: libcpp PATCH for c++/45399 (undesired NUL warning in raw strings) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. commit 35ebd948dd567743ed6b31deb063b5ef948304a9 Author: Jason Merrill 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(