[clang] 6e79f77 - [dataflow][nfc] Fix u8 string usage with c++20 (#84291)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 7 01:46:40 PST 2024
Author: Vincent Lee
Date: 2024-03-07T10:46:36+01:00
New Revision: 6e79f77adbbd338848ea770f2f2b110bc57a3990
URL: https://github.com/llvm/llvm-project/commit/6e79f77adbbd338848ea770f2f2b110bc57a3990
DIFF: https://github.com/llvm/llvm-project/commit/6e79f77adbbd338848ea770f2f2b110bc57a3990.diff
LOG: [dataflow][nfc] Fix u8 string usage with c++20 (#84291)
Clang returns an error when compiling this file with c++20
```
error: ISO C++20 does not permit initialization of char array with UTF-8 string literal
```
It seems like c++20 treats u8strings differently than strings (probably
needs char8_t).
Make this a string to fix the error.
Added:
Modified:
clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
Removed:
################################################################################
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp b/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
index ff4e18de2c70f1..d9f40d28859f5e 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
@@ -500,7 +500,7 @@ class HTMLLogger : public Logger {
for (unsigned I = 0; I < CFG.getNumBlockIDs(); ++I) {
std::string Name = blockID(I);
// Rightwards arrow, vertical line
- char ConvergenceMarker[] = u8"\\n\u2192\u007c";
+ char ConvergenceMarker[] = "\\n\u2192\u007c";
if (BlockConverged[I])
Name += ConvergenceMarker;
GraphS << " " << blockID(I) << " [id=" << blockID(I) << " label=\""
More information about the cfe-commits
mailing list