Opened 6 years ago

#12602 new Bugs

C++11 raw string literals with embedded escapes are mislexed

Reported by: edaskel@… Owned by: Hartmut Kaiser
Milestone: To Be Determined Component: wave
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

Raw string literals are partly intended to make it easier to write strings that would otherwise require extensive escaping - e.g., regular expressions. Unfortunately Wave seems to get confused when backslashes appear in C++11 raw string literals. For example:

R"(A\+)"

is parsed by compilers as a string of three characters: A, backslash, and +. Wave lexes this as an unterminated raw string literal followed by six individual character tokens. By contrast:

R"(A+)"

is correctly parsed as a two-character raw string literal.

Attachments (1)

rawstrlit_with_escapechars.cpp (1.5 KB ) - added by edaskel@… 6 years ago.
A minimal example of the problem

Download all attachments as: .zip

Change History (1)

by edaskel@…, 6 years ago

A minimal example of the problem

Note: See TracTickets for help on using tickets.