From a166b903d0ee8fca30c494ff4fb8687c310a0628 Mon Sep 17 00:00:00 2001 From: Michael Liao Date: Thu, 27 Jun 2019 17:19:28 +0000 Subject: [PATCH] Fix lld build on Windows with MSVC due to C2461 - It seems the same name of class and one of its fields confuses MSVC, https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2461?view=vs-2019 - Patch from Andryeyev, German llvm-svn: 364567 --- lld/COFF/SymbolTable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lld/COFF/SymbolTable.cpp b/lld/COFF/SymbolTable.cpp index 529562d807df..cbdce10b68c5 100644 --- a/lld/COFF/SymbolTable.cpp +++ b/lld/COFF/SymbolTable.cpp @@ -128,7 +128,7 @@ std::vector getSymbolLocations(ObjFile *File, uint32_t SymIndex) { struct UndefinedDiag { Symbol *Sym; struct File { - ObjFile *File; + ObjFile *OFile; uint64_t SymIndex; }; std::vector Files; @@ -143,7 +143,7 @@ static void reportUndefinedSymbol(const UndefinedDiag &UndefDiag) { size_t I = 0, NumRefs = 0; for (const UndefinedDiag::File &Ref : UndefDiag.Files) { std::vector SymbolLocations = - getSymbolLocations(Ref.File, Ref.SymIndex); + getSymbolLocations(Ref.OFile, Ref.SymIndex); NumRefs += SymbolLocations.size(); for (const std::string &S : SymbolLocations) { if (I >= MaxUndefReferences)