================
@@ -550,6 +555,27 @@ static void DiagnoseInvalidUnicodeCharacterName(
namespace u = llvm::sys::unicode;
+ bool HasIllegalCharacter = false;
+ for (const char *P = Name.begin(), *E = Name.end(); P != E;) {
+ if (allowedInCharacterName(*P)) {
+ ++P;
+ continue;
+ }
+ const auto *Src = reinterpret_cast<const llvm::UTF8 *>(P);
+ const auto *SrcEnd = reinterpret_cast<const llvm::UTF8 *>(E);
+ llvm::UTF32 CodePoint = 0;
+ if (llvm::convertUTF8Sequence(&Src, SrcEnd, &CodePoint,
+ llvm::strictConversion) !=
llvm::conversionOK)
+ break;
----------------
cor3ntin wrote:
You have tests for an invalid code points?
https://github.com/llvm/llvm-project/pull/206326
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits