llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>

https://github.com/llvm/llvm-project/pull/203084 adds diagnostics about unused 
variables to the libc++ containers. This patch is the fallout from the projects 
I tried to build with it.

---

Patch is 23.18 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/204994.diff


29 Files Affected:

- (modified) clang-tools-extra/clangd/IncludeFixer.cpp (-7) 
- (modified) clang-tools-extra/modularize/PreprocessorTracker.cpp (-3) 
- (modified) clang/lib/Driver/ToolChains/Hexagon.cpp (-1) 
- (modified) clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp 
(-4) 
- (modified) clang/unittests/AST/ASTImporterFixtures.cpp (-2) 
- (modified) clang/unittests/Interpreter/CodeCompletionTest.cpp (-1) 
- (modified) clang/unittests/Tooling/HeaderIncludesTest.cpp (-1) 
- (modified) lldb/source/Commands/CommandObjectCommands.cpp (-3) 
- (modified) lldb/source/Commands/CommandObjectHelp.cpp (-1) 
- (modified) lldb/source/Interpreter/CommandInterpreter.cpp (-3) 
- (modified) 
lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp (-2) 
- (modified) lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
(-2) 
- (modified) 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp 
(+1-4) 
- (modified) lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp (-2) 
- (modified) lldb/source/Target/StackFrameList.cpp (-1) 
- (modified) lldb/tools/yaml2macho-core/yaml2macho.cpp (-2) 
- (modified) 
llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h 
(-1) 
- (modified) llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h (+2-2) 
- (modified) llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp (+1-1) 
- (modified) llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp (-4) 
- (modified) llvm/tools/llvm-rc/ResourceScriptParser.cpp (+1-2) 
- (modified) llvm/tools/llvm-rc/ResourceScriptParser.h (-1) 
- (modified) llvm/tools/sancov/sancov.cpp (-1) 
- (modified) llvm/unittests/ADT/STLExtrasTest.cpp (+2-2) 
- (modified) llvm/unittests/CodeGen/PassManagerTest.cpp (-1) 
- (modified) llvm/unittests/TextAPI/TextStubV3Tests.cpp (+1-9) 
- (modified) llvm/unittests/TextAPI/TextStubV4Tests.cpp (-4) 
- (modified) 
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp (-1) 
- (modified) mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp (-1) 


``````````diff
diff --git a/clang-tools-extra/clangd/IncludeFixer.cpp 
b/clang-tools-extra/clangd/IncludeFixer.cpp
index 3f3d7fbefd58e..5ecf853524a3f 100644
--- a/clang-tools-extra/clangd/IncludeFixer.cpp
+++ b/clang-tools-extra/clangd/IncludeFixer.cpp
@@ -613,13 +613,6 @@ IncludeFixer::lookupCached(const SymbolID &ID) const {
   Index.lookup(Req, [&](const Symbol &Sym) { Matches.insert(Sym); });
   auto Syms = std::move(Matches).build();
 
-  std::vector<Fix> Fixes;
-  if (!Syms.empty()) {
-    auto &Matched = *Syms.begin();
-    if (!Matched.IncludeHeaders.empty() && Matched.Definition &&
-        Matched.CanonicalDeclaration.FileURI == Matched.Definition.FileURI)
-      Fixes = fixesForSymbols(Syms);
-  }
   auto E = LookupCache.try_emplace(ID, std::move(Syms));
   return &E.first->second;
 }
diff --git a/clang-tools-extra/modularize/PreprocessorTracker.cpp 
b/clang-tools-extra/modularize/PreprocessorTracker.cpp
index 04abb2733f5a7..6205b97a17176 100644
--- a/clang-tools-extra/modularize/PreprocessorTracker.cpp
+++ b/clang-tools-extra/modularize/PreprocessorTracker.cpp
@@ -1078,9 +1078,6 @@ class PreprocessorTrackerImpl : public 
PreprocessorTracker {
     auto I = ConditionalExpansions.find(InstanceKey);
     // If existing instance of condition not found, add one.
     if (I == ConditionalExpansions.end()) {
-      std::string InstanceSourceLine =
-          getSourceLocationString(PP, InstanceLoc) + ":\n" +
-          getSourceLine(PP, InstanceLoc) + "\n";
       ConditionalExpansions[InstanceKey] =
           ConditionalTracker(DirectiveKind, ConditionValue,
                              ConditionUnexpandedHandle, InclusionPathHandle);
diff --git a/clang/lib/Driver/ToolChains/Hexagon.cpp 
b/clang/lib/Driver/ToolChains/Hexagon.cpp
index ab207317667c6..b890431ef7f6c 100644
--- a/clang/lib/Driver/ToolChains/Hexagon.cpp
+++ b/clang/lib/Driver/ToolChains/Hexagon.cpp
@@ -534,7 +534,6 @@ void hexagon::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
 std::string HexagonToolChain::getHexagonTargetDir(
       const std::string &InstalledDir,
       const SmallVectorImpl<std::string> &PrefixDirs) const {
-  std::string InstallRelDir;
   const Driver &D = getDriver();
 
   // Locate the rest of the toolchain ...
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index 50b34cb181ca5..4fe3e1f7623f6 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -2149,8 +2149,6 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
                   ErrnoIrrelevant)
             .ArgConstraint(NotNull(ArgNo(0))));
   } else {
-    const auto ReturnsZeroOrMinusOne =
-        ConstraintSet{ReturnValueCondition(WithinRange, Range(-1, 0))};
     const auto ReturnsZero =
         ConstraintSet{ReturnValueCondition(WithinRange, SingleValue(0))};
     const auto ReturnsMinusOne =
@@ -2161,8 +2159,6 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
         ConstraintSet{ReturnValueCondition(WithinRange, Range(0, IntMax))};
     const auto ReturnsNonZero =
         ConstraintSet{ReturnValueCondition(OutOfRange, SingleValue(0))};
-    const auto ReturnsFileDescriptor =
-        ConstraintSet{ReturnValueCondition(WithinRange, Range(-1, IntMax))};
     const auto &ReturnsValidFileDescriptor = ReturnsNonnegative;
 
     auto ValidFileDescriptorOrAtFdcwd = [&](ArgNo ArgN) {
diff --git a/clang/unittests/AST/ASTImporterFixtures.cpp 
b/clang/unittests/AST/ASTImporterFixtures.cpp
index e4e5a078262c3..48421fe90a431 100644
--- a/clang/unittests/AST/ASTImporterFixtures.cpp
+++ b/clang/unittests/AST/ASTImporterFixtures.cpp
@@ -142,7 +142,6 @@ std::tuple<Decl *, Decl *> 
ASTImporterTestBase::getImportedDecl(
     StringRef FromSrcCode, TestLanguage FromLang, StringRef ToSrcCode,
     TestLanguage ToLang, StringRef Identifier) {
   std::vector<std::string> FromArgs = getCommandLineArgsForLanguage(FromLang);
-  std::vector<std::string> ToArgs = getCommandLineArgsForLanguage(ToLang);
 
   FromTUs.emplace_back(FromSrcCode, InputFileName, FromArgs, Creator,
                        ODRHandling);
@@ -185,7 +184,6 @@ TranslationUnitDecl 
*ASTImporterTestBase::getTuDecl(StringRef SrcCode,
 
 TranslationUnitDecl *ASTImporterTestBase::getToTuDecl(StringRef ToSrcCode,
                                                       TestLanguage ToLang) {
-  std::vector<std::string> ToArgs = getCommandLineArgsForLanguage(ToLang);
   assert(!ToAST);
   lazyInitToAST(ToLang, ToSrcCode, OutputFileName);
   return ToAST->getASTContext().getTranslationUnitDecl();
diff --git a/clang/unittests/Interpreter/CodeCompletionTest.cpp 
b/clang/unittests/Interpreter/CodeCompletionTest.cpp
index ceb683497ac74..5c6047f294721 100644
--- a/clang/unittests/Interpreter/CodeCompletionTest.cpp
+++ b/clang/unittests/Interpreter/CodeCompletionTest.cpp
@@ -98,7 +98,6 @@ TEST_F(CodeCompletionTest, TwoDecls) {
 
 TEST_F(CodeCompletionTest, CompFunDeclsNoError) {
   auto Err = llvm::Error::success();
-  auto comps = runComp("void app(", Err);
   EXPECT_EQ((bool)Err, false);
 }
 
diff --git a/clang/unittests/Tooling/HeaderIncludesTest.cpp 
b/clang/unittests/Tooling/HeaderIncludesTest.cpp
index 8259394cb30bc..95fb05885a0b9 100644
--- a/clang/unittests/Tooling/HeaderIncludesTest.cpp
+++ b/clang/unittests/Tooling/HeaderIncludesTest.cpp
@@ -678,7 +678,6 @@ int main() {
     std::vector<int> ints {};
 })cpp";
 
-  auto InsertedCode = insert(Code, "<vector>");
   EXPECT_EQ(Expected, insert(Code, "<vector>"));
 }
 
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp 
b/lldb/source/Commands/CommandObjectCommands.cpp
index 84e661ec01f53..8f006768ecc9a 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -627,7 +627,6 @@ class CommandObjectCommandsUnalias : public 
CommandObjectParsed {
 
 protected:
   void DoExecute(Args &args, CommandReturnObject &result) override {
-    CommandObject::CommandMap::iterator pos;
     CommandObject *cmd_obj;
 
     if (args.empty()) {
@@ -702,8 +701,6 @@ class CommandObjectCommandsDelete : public 
CommandObjectParsed {
 
 protected:
   void DoExecute(Args &args, CommandReturnObject &result) override {
-    CommandObject::CommandMap::iterator pos;
-
     if (args.empty()) {
       result.AppendErrorWithFormat("must call '%s' with one or more valid user 
"
                                    "defined regular expression command names",
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp 
b/lldb/source/Commands/CommandObjectHelp.cpp
index a29ded846b100..c96c5158c06f6 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -64,7 +64,6 @@ CommandObjectHelp::CommandOptions::GetDefinitions() {
 }
 
 void CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
-  CommandObject::CommandMap::iterator pos;
   CommandObject *cmd_obj;
   const size_t argc = command.GetArgumentCount();
 
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index 0c5456c2c3b57..a35baa7fd6d27 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2962,7 +2962,6 @@ void CommandInterpreter::HandleCommandsFromFile(
   auto input_file_up =
       FileSystem::Instance().Open(cmd_file, File::eOpenOptionReadOnly);
   if (!input_file_up) {
-    std::string error = llvm::toString(input_file_up.takeError());
     result.AppendErrorWithFormatv(
         "error: an error occurred read file '{0}': {1}\n", cmd_file_path,
         llvm::fmt_consume(input_file_up.takeError()));
@@ -3263,8 +3262,6 @@ void 
CommandInterpreter::FindCommandsForApropos(llvm::StringRef search_word,
                                                 bool search_user_commands,
                                                 bool search_alias_commands,
                                                 bool search_user_mw_commands) {
-  CommandObject::CommandMap::const_iterator pos;
-
   if (search_builtin_commands)
     FindCommandsForApropos(search_word, commands_found, commands_help,
                            m_command_dict);
diff --git 
a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
index 62c0fb0ff4eb8..7b5bcc2567dda 100644
--- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
@@ -148,7 +148,6 @@ bool HexagonDYLDRendezvous::UpdateSOEntries() {
 
 bool HexagonDYLDRendezvous::UpdateSOEntriesForAddition() {
   SOEntry entry;
-  iterator pos;
 
   assert(m_previous.state == eAdd);
 
@@ -176,7 +175,6 @@ bool HexagonDYLDRendezvous::UpdateSOEntriesForAddition() {
 
 bool HexagonDYLDRendezvous::UpdateSOEntriesForDeletion() {
   SOEntryList entry_list;
-  iterator pos;
 
   assert(m_previous.state == eDelete);
 
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index c2084e0322c1f..2d0eef666f688 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -497,7 +497,6 @@ bool DYLDRendezvous::RemoveSOEntriesFromRemote(
 
 bool DYLDRendezvous::AddSOEntries() {
   SOEntry entry;
-  iterator pos;
 
   assert(m_previous.state == eAdd);
 
@@ -525,7 +524,6 @@ bool DYLDRendezvous::AddSOEntries() {
 
 bool DYLDRendezvous::RemoveSOEntries() {
   SOEntryList entry_list;
-  iterator pos;
 
   assert(m_previous.state == eDelete);
 
diff --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
index 5876c3a9434a1..eaed4e6742824 100644
--- 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -156,15 +156,12 @@ 
GDBRemoteCommunicationServerPlatform::Handle_qLaunchGDBServer(
             __FUNCTION__);
 
   ConnectionFileDescriptor file_conn;
-  std::string hostname;
   packet.SetFilePos(::strlen("qLaunchGDBServer;"));
   llvm::StringRef name;
   llvm::StringRef value;
   std::optional<uint16_t> port;
   while (packet.GetNameColonValue(name, value)) {
-    if (name == "host")
-      hostname = std::string(value);
-    else if (name == "port") {
+    if (name == "port") {
       // Make the Optional valid so we can use its value
       port = 0;
       value.getAsInteger(0, *port);
diff --git a/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp 
b/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
index c92f80bc166b7..96d6910ce5ce5 100644
--- a/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
+++ b/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp
@@ -98,8 +98,6 @@ llvm::Error 
ProtocolServerMCP::Start(ProtocolServer::Connection connection) {
   auto listening_uris = m_listener->GetListeningConnectionURI();
   if (listening_uris.empty())
     return createStringError("failed to get listening connections");
-  std::string address =
-      llvm::join(m_listener->GetListeningConnectionURI(), ", ");
 
   ServerInfo info{listening_uris[0]};
   llvm::Expected<ServerInfoHandle> server_info_handle = 
ServerInfo::Write(info);
diff --git a/lldb/source/Target/StackFrameList.cpp 
b/lldb/source/Target/StackFrameList.cpp
index f23261d50ed4b..01ce5870a6edb 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -1021,7 +1021,6 @@ size_t StackFrameList::GetStatus(Stream &strm, uint32_t 
first_frame,
 
   StackFrameSP selected_frame_sp =
       m_thread.GetSelectedFrame(DoNoSelectMostRelevantFrame);
-  std::string buffer;
   std::string marker;
   for (frame_idx = first_frame; frame_idx < last_frame; ++frame_idx) {
     frame_sp = GetFrameAtIndex(frame_idx);
diff --git a/lldb/tools/yaml2macho-core/yaml2macho.cpp 
b/lldb/tools/yaml2macho-core/yaml2macho.cpp
index c29ae282d8571..cd51d228ff062 100644
--- a/lldb/tools/yaml2macho-core/yaml2macho.cpp
+++ b/lldb/tools/yaml2macho-core/yaml2macho.cpp
@@ -176,7 +176,6 @@ int main(int argc, char **argv) {
   if (spec.binaries.size() > 0)
     for (const Binary &binary : spec.binaries) {
       std::vector<uint8_t> segment_command_bytes;
-      std::vector<uint8_t> payload_bytes;
       create_lc_note_binary_load_cmd(spec, segment_command_bytes, binary,
                                      lc_note_payload_bytes, payload_fileoff);
       payload_fileoff =
@@ -185,7 +184,6 @@ int main(int argc, char **argv) {
     }
   if (spec.addressable_bits) {
     std::vector<uint8_t> segment_command_bytes;
-    std::vector<uint8_t> payload_bytes;
     create_lc_note_addressable_bits(spec, segment_command_bytes,
                                     *spec.addressable_bits,
                                     lc_note_payload_bytes, payload_fileoff);
diff --git 
a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h 
b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
index e5d28345bb84e..0aa040bc00138 100644
--- 
a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
+++ 
b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
@@ -188,7 +188,6 @@ class LLVM_ABI SimpleRemoteEPCServer : public 
SimpleRemoteEPCTransportClient {
 
   uint64_t NextSeqNo = 0;
   PendingJITDispatchResultsMap PendingJITDispatchResults;
-  std::vector<sys::DynamicLibrary> Dylibs;
 };
 
 } // end namespace orc
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h 
b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
index b73da194cd187..9836b7d26a871 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
@@ -59,9 +59,9 @@ class GenericNamedTask : public RTTIExtends<GenericNamedTask, 
Task> {
 /// Generic task implementation.
 template <typename FnT> class GenericNamedTaskImpl : public GenericNamedTask {
 public:
-  GenericNamedTaskImpl(FnT &&Fn, std::string DescBuffer)
+  GenericNamedTaskImpl(FnT &&Fn, std::string InDescBuffer)
       : Fn(std::forward<FnT>(Fn)), Desc(DescBuffer.c_str()),
-        DescBuffer(std::move(DescBuffer)) {}
+        DescBuffer(std::move(InDescBuffer)) {}
   GenericNamedTaskImpl(FnT &&Fn, const char *Desc)
       : Fn(std::forward<FnT>(Fn)), Desc(Desc) {
     assert(Desc && "Description cannot be null");
diff --git a/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp 
b/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp
index 2c0eeac0089ae..606f5a520fd7d 100644
--- a/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp
+++ b/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp
@@ -36,7 +36,7 @@ void DWARFCFIState::update(const MCCFIInstruction &Directive) 
{
   // updated row and following the previous rows. These middle rows are stored
   // in `PrecedingRows`. For now, there is no need to store these rows in the
   // state, so they are ignored in the end.
-  dwarf::UnwindTable::RowContainer PrecedingRows;
+  // dwarf::UnwindTable::RowContainer PrecedingRows;
 
   // TODO: `.cfi_remember_state` and `.cfi_restore_state` directives are not
   // supported yet. The reason is that `parseRows` expects the stack of states
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp 
b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
index 4165274a6f8bd..d1c0022f71dcc 100644
--- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@ -88,7 +88,6 @@ static std::string DependencyInfoPath;
 static bool VersionOption;
 static bool NoWarningForNoSymbols;
 static bool WarningsAsErrors;
-static std::string IgnoredSyslibRoot;
 
 static const std::array<std::string, 3> StandardSearchDirs{
     "/lib",
@@ -659,9 +658,6 @@ static void parseRawArgs(int Argc, char **Argv) {
   if (const opt::Arg *A = Args.getLastArg(OPT_dependencyInfoPath))
     DependencyInfoPath = A->getValue();
 
-  if (const opt::Arg *A = Args.getLastArg(OPT_ignoredSyslibRoot))
-    IgnoredSyslibRoot = A->getValue();
-
   LibraryOperation =
       Args.hasArg(OPT_static) ? Operation::Static : Operation::None;
   DeterministicOption = Args.hasArg(OPT_deterministicOption);
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp 
b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
index e4efc83c933b4..f28efb6de611e 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
@@ -33,8 +33,7 @@ namespace llvm {
 namespace rc {
 
 RCParser::ParserError::ParserError(const Twine &Expected, const LocIter CurLoc,
-                                   const LocIter End)
-    : ErrorLoc(CurLoc), FileEnd(End) {
+                                   const LocIter End) {
   CurMessage = "Error parsing file: expected " + Expected.str() + ", got " +
                (CurLoc == End ? "<EOF>" : CurLoc->value()).str();
 }
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.h 
b/llvm/tools/llvm-rc/ResourceScriptParser.h
index 1e7618c84142e..ed7a09b16834e 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.h
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.h
@@ -48,7 +48,6 @@ class RCParser {
 
   private:
     std::string CurMessage;
-    LocIter ErrorLoc, FileEnd;
   };
 
   explicit RCParser(std::vector<RCToken> TokenList);
diff --git a/llvm/tools/sancov/sancov.cpp b/llvm/tools/sancov/sancov.cpp
index 483e6d7d58d68..d6fdac2583d5d 100644
--- a/llvm/tools/sancov/sancov.cpp
+++ b/llvm/tools/sancov/sancov.cpp
@@ -987,7 +987,6 @@ computeNotCoveredFunctions(const SymbolizedCoverage 
&Coverage) {
 
 static std::set<FileFn>
 computeCoveredFunctions(const SymbolizedCoverage &Coverage) {
-  auto AllFns = computeFunctions(Coverage.Points);
   std::set<FileFn> Result;
 
   for (const auto &Point : Coverage.Points) {
diff --git a/llvm/unittests/ADT/STLExtrasTest.cpp 
b/llvm/unittests/ADT/STLExtrasTest.cpp
index 2f1e01d16e3c5..00c062ae1ca29 100644
--- a/llvm/unittests/ADT/STLExtrasTest.cpp
+++ b/llvm/unittests/ADT/STLExtrasTest.cpp
@@ -1170,7 +1170,7 @@ TEST(STLExtrasTest, getSingleElement) {
 }
 
 TEST(STLExtrasTest, hasNItems) {
-  const std::list<int> V0 = {}, V1 = {1}, V2 = {1, 2};
+  const std::list<int> V0 = {}, V1 = {1};
   const std::list<int> V3 = {1, 3, 5};
 
   EXPECT_TRUE(hasNItems(V0, 0));
@@ -1191,7 +1191,7 @@ TEST(STLExtrasTest, hasNItems) {
 }
 
 TEST(STLExtras, hasNItemsOrMore) {
-  const std::list<int> V0 = {}, V1 = {1}, V2 = {1, 2};
+  const std::list<int> V1 = {1}, V2 = {1, 2};
   const std::list<int> V3 = {1, 3, 5};
 
   EXPECT_TRUE(hasNItemsOrMore(V1, 1));
diff --git a/llvm/unittests/CodeGen/PassManagerTest.cpp 
b/llvm/unittests/CodeGen/PassManagerTest.cpp
index dc83effd3c1e1..dc42b7a0854d3 100644
--- a/llvm/unittests/CodeGen/PassManagerTest.cpp
+++ b/llvm/unittests/CodeGen/PassManagerTest.cpp
@@ -218,7 +218,6 @@ TEST_F(PassManagerTest, Basic) {
 
   testing::internal::CaptureStderr();
   MPM.run(*M, MAM);
-  std::string Output = testing::internal::GetCapturedStderr();
 
   EXPECT_EQ((std::vector<int>{10, 16, 18, 20, 30, 36, 38, 40}), Counts);
   EXPECT_EQ(40, Count);
diff --git a/llvm/unittests/TextAPI/TextStubV3Tests.cpp 
b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
index 3c822b2188a41..19624c9dc2abb 100644
--- a/llvm/unittests/TextAPI/TextStubV3Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
@@ -81,10 +81,6 @@ TEST(TBDv3, ReadFile) {
   for (auto &&arch : Archs)
     Targets.emplace_back(Target(arch, Platform));
   EXPECT_EQ(Archs, File->getArchitectures());
-  TargetToAttr Uuids = {{Target(AK_armv7, PLATFORM_UNKNOWN),
-                         "00000000-0000-0000-0000-000000000000"},
-                        {Target(AK_arm64, PLATFORM_UNKNOWN),
-                         "11111111-1111-1111-1111-111111111111"}};
   EXPECT_EQ(File->getPlatforms().size(), 1U);
   EXPECT_EQ(Platform, *File->getPlatforms().begin());
   EXPECT_EQ(std::string("Test.dylib"), File->getInstallName());
@@ -165,10 +161,6 @@ TEST(TBDv3, ReadMultipleDocuments) {
   for (auto &&arch : Archs)
     Targets.emplace_back(Target(arch, Platform));
   EXPECT_EQ(Archs, File->getArchitectures());
-  TargetToAttr Uuids = {{Target(AK_armv7, PLATFORM_UNKNOWN),
-                         "0000...
[truncated]

``````````

</details>


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

Reply via email to