r203554 - clang::HeaderSearch: Use default constructor even for POD.

NAKAMURA Takumi geek4civic at gmail.com
Tue Mar 11 02:37:28 PDT 2014


Author: chapuni
Date: Tue Mar 11 04:37:27 2014
New Revision: 203554

URL: http://llvm.org/viewvc/llvm-project?rev=203554&view=rev
Log:
clang::HeaderSearch: Use default constructor even for POD.

Unfortunately, msvc 2012 didn't accept non-static member initializer.

Modified:
    cfe/trunk/include/clang/Lex/HeaderSearch.h

Modified: cfe/trunk/include/clang/Lex/HeaderSearch.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearch.h?rev=203554&r1=203553&r2=203554&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/HeaderSearch.h (original)
+++ cfe/trunk/include/clang/Lex/HeaderSearch.h Tue Mar 11 04:37:27 2014
@@ -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;
 





More information about the cfe-commits mailing list