Kaydet (Commit) 5a279f0b authored tarafından Colomban Wendling's avatar Colomban Wendling

c++: Fix parsing of prefixed C++11 raw string literals

See http://en.cppreference.com/w/cpp/language/string_literal
üst cdabbecd
......@@ -802,8 +802,12 @@ process:
*
* which is perfectly valid (yet probably very unlikely). */
int prev = fileGetNthPrevC (1, 0);
int prev2 = fileGetNthPrevC (2, 0);
int prev3 = fileGetNthPrevC (3, 0);
if (! isident (prev))
if (! isident (prev) ||
(! isident (prev2) && (prev == 'L' || prev == 'u' || prev == 'U')) ||
(! isident (prev3) && (prev2 == 'u' && prev == '8')))
{
int next = fileGetc ();
if (next != DOUBLE_QUOTE)
......
......@@ -19,3 +19,16 @@ struct typ2 { int memb2; };
static const char* str3 = FOUR"f(iv)e";
struct typ3 { int memb3; };
/* check for prefixes */
static const char* str4 = LR"blah(";int bug4;)blah";
struct typ4 { int memb4; };
static const char* str5 = u8R"blah(";int bug5;)blah";
struct typ5 { int memb5; };
static const char* str6 = uR"blah(";int bug6;)blah";
struct typ6 { int memb6; };
static const char* str7 = UR"blah(";int bug7;)blah";
struct typ7 { int memb7; };
......@@ -3,9 +3,21 @@ FOUR
memb164typ10int
memb264typ20int
memb364typ30int
memb464typ40int
memb564typ50int
memb664typ60int
memb764typ70int
str1163840char
str2163840char
str3163840char
str4163840char
str5163840char
str6163840char
str7163840char
typ120480
typ220480
typ320480
typ420480
typ520480
typ620480
typ720480
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment