[clang] Issue143668 (PR #149396)
David Spickett via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 18 01:55:56 PDT 2025
================
@@ -158,12 +158,12 @@ TEST_F(InterpreterTest, UndoCommand) {
// Fail to undo.
auto Err1 = Interp->Undo();
- EXPECT_EQ("Operation failed. Too many undos",
+ EXPECT_EQ("Operation failed. No input left to undo",
llvm::toString(std::move(Err1)));
auto Err2 = Interp->Parse("int foo = 42;");
EXPECT_TRUE(!!Err2);
auto Err3 = Interp->Undo(2);
- EXPECT_EQ("Operation failed. Too many undos",
+ EXPECT_EQ("Operation failed. No input left to undo",
----------------
DavidSpickett wrote:
https://github.com/llvm/llvm-project/blob/d883d5fecf8aa7db6daa0b163599d42ca00c5808/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp#L338 is an example of formatting an error message.
If you've seen Python's format strings, it works like those, automatically figuring out what the type of the parameters are so that you don't have to `%<something>` each time. There's a bit more explanation in https://llvm.org/doxygen/FormatVariadic_8h_source.html but searching for other uses of it will be more informative than the formal grammar of it.
https://github.com/llvm/llvm-project/pull/149396
More information about the cfe-commits
mailing list