[PATCH] D26667: Teach clang that 'sv' is a fine literal suffix

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 07:30:15 PST 2016


aaron.ballman added inline comments.


================
Comment at: lib/Lex/LiteralSupport.cpp:768
       .Cases("il", "i", "if", true)
+      .Case("sv", true)
       .Default(false);
----------------
mclow.lists wrote:
> malcolm.parsons wrote:
> > This is in `NumericLiteralParser::isValidUDSuffix()`.
> > 
> > If a change is needed for `"sv"`, wouldn't it be in `StringLiteralParser`?
> Would it be?  I don't know.  `"s"` appears here, which is used for both 'string' and 'seconds'.
This function is used by the numeric literal parser, and so `sv` does not make sense there. It's also used by SemaDeclCXX.cpp in `CheckLiteralOperatorDeclaration()`, where this change would make sense.

I was asking about test cases; I was wondering what problem this was trying to solve. I suspect you want to modify `CheckLiteralOperatorDeclaration()` rather than `NumericLiteralParser`.


https://reviews.llvm.org/D26667





More information about the cfe-commits mailing list