Bug 489753 - preprocessor error invalid character ' ' in raw string delimiter
Summary: preprocessor error invalid character ' ' in raw string delimiter
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-11 17:42 UTC by Jochen Roth
Modified: 2009-03-11 18:52 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-03-11 18:10:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
testcase (21 bytes, text/plain)
2009-03-11 17:42 UTC, Jochen Roth
no flags Details

Description Jochen Roth 2009-03-11 17:42:45 UTC
Created attachment 334840 [details]
testcase

Description of problem:
The following code

---------------
#define R "r"

R"bx"
---------------

causes gcc-4.4.0-0.23.x86_64 (cpp-4.4.0-0.23.x86_64) to print the following error message when compiling with

gcc -E test.c --std=gnu99
# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"
test.c:3:1: error: invalid character '
' in raw string delimiter

R"bx"

It works without specifying the --std=gnu99 option though. 
It also works with the upstream gcc 4.4 and with 4.3 gcc versions on different platforms.


Version-Release number of selected component (if applicable):
gcc-4.4.0-0.23.x86_64

How reproducible:
Always

Steps to Reproduce:
1.gcc -E test.c --std=gnu99
  
Actual results:
Preprocessor error message

Expected results:
No error message

Comment 2 Jochen Roth 2009-03-11 18:31:04 UTC
Jakub,
thanks for the quick response.

Comment 3 Jakub Jelinek 2009-03-11 18:52:51 UTC
BTW, if you want to avoid a raw-string literal (which would be
e.g. R"[bx]" or R"a[bx]a"), just separate R from " with some whitespace.


Note You need to log in before you can comment on or make changes to this bug.