]> granicus.if.org Git - clang/commitdiff
clang::HeaderSearch: Use default constructor even for POD.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 11 Mar 2014 09:37:27 +0000 (09:37 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 11 Mar 2014 09:37:27 +0000 (09:37 +0000)
Unfortunately, msvc 2012 didn't accept non-static member initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203554 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/HeaderSearch.h

index d1cb8118c0c3d67a82bfd1202831ad3c1cb65a6b..d3b3193572afe0f171ed7669d016098b432f6bb5 100644 (file)
@@ -191,12 +191,15 @@ class HeaderSearch {
     /// Starting index in SearchDirs that the cached search was performed from.
     /// If there is a hit and this value doesn't match the current query, the
     /// cache has to be ignored.
-    unsigned StartIdx = 0;
+    unsigned StartIdx;
     /// The entry in SearchDirs that satisfied the query.
-    unsigned HitIdx = 0;
+    unsigned HitIdx;
     /// This is non-null if the original filename was mapped to a framework
     /// include via a headermap.
-    const char *MappedName = nullptr;
+    const char *MappedName;
+
+    /// Default constructor -- Initialize all members with zero.
+    LookupFileCacheInfo(): StartIdx(0), HitIdx(0), MappedName(nullptr) {}
   };
   llvm::StringMap<LookupFileCacheInfo, llvm::BumpPtrAllocator> LookupFileCache;