[clang] [Format] Do not crash on non-null terminated strings (PR #131299)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 21 17:28:41 PDT 2025
================
@@ -29096,6 +29096,17 @@ TEST_F(FormatTest, BreakBeforeClassName) {
" ArenaSafeUniquePtr {};");
}
+TEST_F(FormatTest, DoesNotCrashOnNonNullTerminatedStringRefs) {
+ llvm::StringRef TwoLines = "namespace foo {}\n"
----------------
owenca wrote:
```suggestion
StringRef TwoLines = "namespace foo {}\n"
```
https://github.com/llvm/llvm-project/pull/131299
More information about the cfe-commits
mailing list