diff --git a/tagmanager/ctags/get.c b/tagmanager/ctags/get.c index 5fc1179f..64e37048 100644 --- a/tagmanager/ctags/get.c +++ b/tagmanager/ctags/get.c @@ -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) diff --git a/tests/ctags/cxx11-raw-strings.cpp b/tests/ctags/cxx11-raw-strings.cpp index c937e04a..0ca7c353 100644 --- a/tests/ctags/cxx11-raw-strings.cpp +++ b/tests/ctags/cxx11-raw-strings.cpp @@ -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; }; diff --git a/tests/ctags/cxx11-raw-strings.cpp.tags b/tests/ctags/cxx11-raw-strings.cpp.tags index 271fae8d..b6364140 100644 --- a/tests/ctags/cxx11-raw-strings.cpp.tags +++ b/tests/ctags/cxx11-raw-strings.cpp.tags @@ -3,9 +3,21 @@ FOUR memb1Ì64Îtyp1Ö0Ïint memb2Ì64Îtyp2Ö0Ïint memb3Ì64Îtyp3Ö0Ïint +memb4Ì64Îtyp4Ö0Ïint +memb5Ì64Îtyp5Ö0Ïint +memb6Ì64Îtyp6Ö0Ïint +memb7Ì64Îtyp7Ö0Ïint str1Ì16384Ö0Ïchar str2Ì16384Ö0Ïchar str3Ì16384Ö0Ïchar +str4Ì16384Ö0Ïchar +str5Ì16384Ö0Ïchar +str6Ì16384Ö0Ïchar +str7Ì16384Ö0Ïchar typ1Ì2048Ö0 typ2Ì2048Ö0 typ3Ì2048Ö0 +typ4Ì2048Ö0 +typ5Ì2048Ö0 +typ6Ì2048Ö0 +typ7Ì2048Ö0