cor3ntin added inline comments.

================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9322
 def warn_user_literal_reserved : Warning<
-  "user-defined literal suffixes %select{<ERROR>|not starting with 
'_'|containing '__'}0 are reserved"
-  "%select{; no literal will invoke this operator|}1">,
+  "user-defined literal suffixes %select{<ERROR>|not starting with 
'_'|containing '__'}0 are reserved">,
   InGroup<UserDefinedLiterals>;
----------------
Can you remove `<Error>` and adapt the calling code to adjust the index?


================
Comment at: clang/lib/Lex/Lexer.cpp:1994-2009
   if (!isAsciiIdentifierStart(C)) {
     if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result))
       Consumed = true;
     else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr))
       Consumed = true;
     else
       return CurPtr;
----------------
I missed that in the previous review, is the FIX-IT here still relevant?


================
Comment at: clang/lib/Lex/Lexer.cpp:2024
+      // the 'operator""if' defining a numeric literal operator).
+      const unsigned MaxStandardSuffixLength = 3;
+      char Buffer[MaxStandardSuffixLength] = {C};
----------------
This sounds brittle. I think we are better off looking ahead to the next 
non-identifier character rather than assuming a size here


================
Comment at: clang/lib/Lex/Lexer.cpp:2031
+        char Next = getCharAndSizeNoWarn(CurPtr + Consumed, NextSize, 
LangOpts);
+        if (!isAsciiIdentifierContinue(Next)) {
+          // End of suffix. Check whether this is on the allowed list.
----------------
This is also sort of brittle, it assumes standard UDL don't have unicode... but 
that sounds more reasonable today.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158372/new/

https://reviews.llvm.org/D158372

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to