[PATCH] D26829: [clang] Allow lexer to handle string_view literals
Anton Bikineev via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 19 02:36:25 PST 2016
AntonBikineev added inline comments.
================
Comment at: lib/Lex/LiteralSupport.cpp:1716-1717
+StringLiteralParser::UDSuffixResult
+StringLiteralParser::isValidUDSuffix(const LangOptions &LangOpts,
+ StringRef Suffix) {
+ if (!LangOpts.CPlusPlus11 || Suffix.empty())
----------------
rsmith wrote:
> Just make this call `NumericLiteralParser::isValidUDSuffix` and then check for the `sv` case. All the numeric suffixes are also valid string literal suffixes for the form `operator""suffix`.
This makes sense for the call sites we currently have.
> All the numeric suffixes are also valid string literal suffixes for the form operator""suffix.
Don't really understand this part. It seems inconsistent if one calls, say,
``` StringLiteralParser::isValidUDSuffix(LangOpts(), "if") ```
and gets
```true```
https://reviews.llvm.org/D26829
More information about the cfe-commits
mailing list