================
@@ -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:

I think I'll merge and clean it up afterwards - that's the issue with doing 
multiple changes in the same PR

https://github.com/llvm/llvm-project/pull/206326
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to