diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-12-30 04:51:10 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-12-30 04:51:10 +0000 |
commit | 904c87881414c4e06bf4254cacebd372b3f4c952 (patch) | |
tree | 8680ac5df46c77b0058430f665914c933d64bcb4 /lib/Lex/LiteralSupport.cpp | |
parent | fd7e95640dcd0fa6009b176bc47a96b70a231a23 (diff) | |
download | clang-904c87881414c4e06bf4254cacebd372b3f4c952.tar.gz |
Allow lexer to handle string_view literals. Patch from Anton Bikineev.
This implements the compiler side of p0403r0. This patch was reviewed as
https://reviews.llvm.org/D26829.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | lib/Lex/LiteralSupport.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index 582ed3ff47..fbfd3fe5cc 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -1708,3 +1708,12 @@ unsigned StringLiteralParser::getOffsetOfStringByte(const Token &Tok, return SpellingPtr-SpellingStart; } + +/// Determine whether a suffix is a valid ud-suffix. We avoid treating reserved +/// suffixes as ud-suffixes, because the diagnostic experience is better if we +/// treat it as an invalid suffix. +bool StringLiteralParser::isValidUDSuffix(const LangOptions &LangOpts, + StringRef Suffix) { + return NumericLiteralParser::isValidUDSuffix(LangOpts, Suffix) || + Suffix == "sv"; +} |