[clang-tools-extra] r261811 - [clang-tidy] Another attempt to fix MSVC build

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 24 16:39:11 PST 2016


Author: alexfh
Date: Wed Feb 24 18:39:11 2016
New Revision: 261811

URL: http://llvm.org/viewvc/llvm-project?rev=261811&view=rev
Log:
[clang-tidy] Another attempt to fix MSVC build

Modified:
    clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp?rev=261811&r1=261810&r2=261811&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp Wed Feb 24 18:39:11 2016
@@ -48,22 +48,26 @@ void DeprecatedHeadersCheck::registerPPC
 
 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"},




More information about the cfe-commits mailing list