[clang] 8956852 - Undo a bit of fcf4e360ba6b that confuses MSVC

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 4 11:35:30 PST 2022


Author: Benjamin Kramer
Date: 2022-12-04T20:33:25+01:00
New Revision: 89568521943b79fe27c6f3c19799a575318b1882

URL: https://github.com/llvm/llvm-project/commit/89568521943b79fe27c6f3c19799a575318b1882
DIFF: https://github.com/llvm/llvm-project/commit/89568521943b79fe27c6f3c19799a575318b1882.diff

LOG: Undo a bit of fcf4e360ba6b that confuses MSVC

clang\lib\Serialization\GlobalModuleIndex.cpp(818): error C2440: 'initializing': cannot convert from 'const ValueTy' to '_Ty2 &&'
        with
        [
            ValueTy=llvm::SmallVector<unsigned int,2>
        ]
        and
        [
            _Ty2=llvm::SmallVector<unsigned int,2>
        ]

Added: 
    

Modified: 
    clang/lib/Serialization/GlobalModuleIndex.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp
index 568e207e64053..b2283c2b39877 100644
--- a/clang/lib/Serialization/GlobalModuleIndex.cpp
+++ b/clang/lib/Serialization/GlobalModuleIndex.cpp
@@ -815,8 +815,10 @@ bool GlobalModuleIndexBuilder::writeIndex(llvm::BitstreamWriter &Stream) {
     IdentifierIndexWriterTrait Trait;
 
     // Populate the hash table.
-    for (auto &[Identifier, IDs] : InterestingIdentifiers) {
-      Generator.insert(Identifier, IDs, Trait);
+    for (InterestingIdentifierMap::iterator I = InterestingIdentifiers.begin(),
+                                            IEnd = InterestingIdentifiers.end();
+         I != IEnd; ++I) {
+      Generator.insert(I->first(), I->second, Trait);
     }
 
     // Create the on-disk hash table in a buffer.


        


More information about the cfe-commits mailing list