[PATCH] D26829: [clang] Allow lexer to handle string_view literals

Anton Bikineev via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 17 19:01:57 PST 2016


AntonBikineev created this revision.
AntonBikineev added reviewers: mclow.lists, rsmith, cfe-commits.

https://reviews.llvm.org/D26829

Files:
  lib/Lex/Lexer.cpp


Index: lib/Lex/Lexer.cpp
===================================================================
--- lib/Lex/Lexer.cpp
+++ lib/Lex/Lexer.cpp
@@ -1713,6 +1713,11 @@
                                          getLangOpts());
         if (!isIdentifierBody(Next)) {
           // End of suffix. Check whether this is on the whitelist.
+          if (getLangOpts().CPlusPlus1z && Chars == 2 && 
+              Buffer[0] == 's' && Buffer[1] == 'v') {
+            IsUDSuffix = true;
+            break;
+          }
           IsUDSuffix = (Chars == 1 && Buffer[0] == 's') ||
                        NumericLiteralParser::isValidUDSuffix(
                            getLangOpts(), StringRef(Buffer, Chars));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26829.78455.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161118/92b959c6/attachment.bin>


More information about the cfe-commits mailing list