[clang-tidy] Another attempt to fix MSVC build
authorAlexander Kornienko <alexfh@google.com>
Thu, 25 Feb 2016 00:39:11 +0000 (00:39 +0000)
committerAlexander Kornienko <alexfh@google.com>
Thu, 25 Feb 2016 00:39:11 +0000 (00:39 +0000)
llvm-svn: 261811

clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp

index aa3d824..005edcb 100644 (file)
@@ -48,22 +48,26 @@ void DeprecatedHeadersCheck::registerPPCallbacks(CompilerInstance &Compiler) {
 
 IncludeModernizePPCallbacks::IncludeModernizePPCallbacks(ClangTidyCheck &Check,
                                                          LangOptions LangOpts)
-    : Check(Check), LangOpts(LangOpts),
-      CStyledHeaderToCxx{{"assert.h", "cassert"}, {"complex.h", "ccomplex"},
-                         {"ctype.h", "cctype"},   {"errno.h", "cerrno"},
-                         {"float.h", "cfloat"},   {"inttypes.h", "cinttypes"},
-                         {"iso646.h", "ciso646"}, {"limits.h", "climits"},
-                         {"locale.h", "clocale"}, {"math.h", "cmath"},
-                         {"setjmp.h", "csetjmp"}, {"signal.h", "csignal"},
-                         {"stdarg.h", "cstdarg"}, {"stddef.h", "cstddef"},
-                         {"stdint.h", "cstdint"}, {"stdio.h", "cstdio"},
-                         {"stdlib.h", "cstdlib"}, {"string.h", "cstring"},
-                         {"time.h", "ctime"},     {"wchar.h", "cwchar"},
-                         {"wctype.h", "cwctype"}} {
+    : Check(Check), LangOpts(LangOpts) {
+  for (const auto &KeyValue :
+       std::vector<std::pair<llvm::StringRef, std::string>>(
+           {{"assert.h", "cassert"}, {"complex.h", "ccomplex"},
+            {"ctype.h", "cctype"},   {"errno.h", "cerrno"},
+            {"float.h", "cfloat"},   {"inttypes.h", "cinttypes"},
+            {"iso646.h", "ciso646"}, {"limits.h", "climits"},
+            {"locale.h", "clocale"}, {"math.h", "cmath"},
+            {"setjmp.h", "csetjmp"}, {"signal.h", "csignal"},
+            {"stdarg.h", "cstdarg"}, {"stddef.h", "cstddef"},
+            {"stdint.h", "cstdint"}, {"stdio.h", "cstdio"},
+            {"stdlib.h", "cstdlib"}, {"string.h", "cstring"},
+            {"time.h", "ctime"},     {"wchar.h", "cwchar"},
+            {"wctype.h", "cwctype"}})) {
+    CStyledHeaderToCxx.insert(KeyValue);
+  }
   // Add C++ 11 headers.
   if (LangOpts.CPlusPlus11) {
     for (const auto &KeyValue :
-         std::vector<std::pair<std::string, std::string>>(
+         std::vector<std::pair<llvm::StringRef, std::string>>(
              {{"fenv.h", "cfenv"},
               {"stdalign.h", "cstdalign"},
               {"stdbool.h", "cstdbool"},