This is to address p0403r0 proposal.
Details
Diff Detail
Event Timeline
Please add tests to cxx1y-user-defined-literals.cpp (and probably rename it).
Other than that this LGTM, but I don't feel comfortable approving clang patches.
@mclow.lists is working on this in D26667.
The review comments from that apply here too.
Does Sema::CheckLiteralOperatorDeclaration need to check StringLiteralParser::isValidUDSuffix?
include/clang/Basic/DiagnosticLexKinds.td | ||
---|---|---|
189–190 ↗ | (On Diff #78602) | I don't see a need for a custom diagnostic for this. Using our normal "reserved ud-suffix" diagnostic seems fine, and it doesn't make sense to treat this suffix as a hard error but accept all the rest with a warning. |
lib/Lex/LiteralSupport.cpp | ||
1716–1717 | 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. |
lib/Lex/LiteralSupport.cpp | ||
---|---|---|
1716–1717 | This makes sense for the call sites we currently have.
Don't really understand this part. It seems inconsistent if one calls, say, StringLiteralParser::isValidUDSuffix(LangOpts(), "if") and gets true |
LGTM, thanks!
lib/Lex/Lexer.cpp | ||
---|---|---|
1717 | I don't think the LangOpts variable is worthwhile; remove and replace the use of it below with getLangOpts(). |
I don't think the LangOpts variable is worthwhile; remove and replace the use of it below with getLangOpts().