浏览代码

Merge topic 'use-using'

1d3f5ebb0d clang-tidy: Enable check modernize-use-using
a1ddf2d0ba clang-tidy: Replace typedef with using

Acked-by: Kitware Robot <[email protected]>
Merge-request: !3782
Brad King 6 年之前
父节点
当前提交
ca8c3d64c8
共有 88 个文件被更改,包括 197 次插入187 次删除
  1. 0 1
      .clang-tidy
  2. 6 6
      Source/CPack/IFW/cmCPackIFWGenerator.h
  3. 2 2
      Source/CPack/IFW/cmCPackIFWInstaller.h
  4. 1 1
      Source/CPack/IFW/cmCPackIFWRepository.h
  5. 3 3
      Source/CPack/WiX/cmCPackWIXGenerator.h
  6. 3 3
      Source/CPack/WiX/cmWIXPatchParser.h
  7. 1 1
      Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx
  8. 3 3
      Source/CPack/WiX/cmWIXShortcut.h
  9. 1 1
      Source/CPack/cmCPackArchiveGenerator.h
  10. 1 1
      Source/CPack/cmCPackGenerator.h
  11. 3 3
      Source/CPack/cmCPackGeneratorFactory.h
  12. 1 1
      Source/CPack/cpack.cxx
  13. 1 1
      Source/CTest/cmCTestBuildAndTestHandler.h
  14. 1 1
      Source/CTest/cmCTestBuildHandler.cxx
  15. 4 4
      Source/CTest/cmCTestBuildHandler.h
  16. 1 1
      Source/CTest/cmCTestConfigureHandler.h
  17. 1 1
      Source/CTest/cmCTestCoverageCommand.h
  18. 5 5
      Source/CTest/cmCTestCoverageHandler.h
  19. 1 1
      Source/CTest/cmCTestGenericHandler.h
  20. 1 1
      Source/CTest/cmCTestMemCheckHandler.h
  21. 1 1
      Source/CTest/cmCTestScriptHandler.h
  22. 1 1
      Source/CTest/cmCTestSubmitCommand.h
  23. 2 2
      Source/CTest/cmCTestSubmitHandler.h
  24. 1 1
      Source/CTest/cmCTestTestHandler.cxx
  25. 5 6
      Source/CTest/cmCTestTestHandler.h
  26. 1 1
      Source/CTest/cmCTestUpdateHandler.h
  27. 1 1
      Source/CTest/cmCTestUploadCommand.h
  28. 1 1
      Source/CTest/cmCTestUploadHandler.h
  29. 1 1
      Source/QtDialog/QCMake.h
  30. 1 1
      Source/cmAffinity.cxx
  31. 1 1
      Source/cmCLocaleEnvironmentScope.h
  32. 11 0
      Source/cmCPluginAPI.h
  33. 1 1
      Source/cmCacheManager.h
  34. 1 1
      Source/cmCommonTargetGenerator.h
  35. 1 1
      Source/cmCustomCommand.h
  36. 1 1
      Source/cmDepends.h
  37. 1 1
      Source/cmDependsC.h
  38. 2 2
      Source/cmDependsFortran.cxx
  39. 1 1
      Source/cmDuration.h
  40. 7 8
      Source/cmELF.cxx
  41. 1 1
      Source/cmELF.h
  42. 1 1
      Source/cmExportFileGenerator.h
  43. 1 1
      Source/cmExportSetMap.h
  44. 1 1
      Source/cmExtraCodeBlocksGenerator.cxx
  45. 1 1
      Source/cmExtraSublimeTextGenerator.h
  46. 1 1
      Source/cmFileLockResult.h
  47. 2 3
      Source/cmGeneratorExpression.cxx
  48. 1 1
      Source/cmGeneratorExpressionNode.cxx
  49. 2 2
      Source/cmGeneratorTarget.cxx
  50. 14 14
      Source/cmGeneratorTarget.h
  51. 1 1
      Source/cmGlobVerificationManager.h
  52. 6 6
      Source/cmGlobalGenerator.h
  53. 2 3
      Source/cmGlobalGhsMultiGenerator.h
  54. 1 1
      Source/cmGlobalNinjaGenerator.h
  55. 2 3
      Source/cmGlobalUnixMakefileGenerator3.h
  56. 5 6
      Source/cmGlobalVisualStudioGenerator.h
  57. 5 5
      Source/cmGlobalXCodeGenerator.cxx
  58. 1 1
      Source/cmIDEOptions.h
  59. 1 1
      Source/cmInstalledFile.h
  60. 9 4
      Source/cmListFileLexer.h
  61. 2 2
      Source/cmLocalGenerator.h
  62. 2 2
      Source/cmLocalNinjaGenerator.h
  63. 1 1
      Source/cmLocalVisualStudio7Generator.cxx
  64. 2 2
      Source/cmLocalVisualStudio7Generator.h
  65. 3 2
      Source/cmMakefile.cxx
  66. 1 1
      Source/cmMakefileTargetGenerator.h
  67. 1 1
      Source/cmNinjaTypes.h
  68. 2 2
      Source/cmOrderDirectories.cxx
  69. 1 1
      Source/cmOrderDirectories.h
  70. 4 4
      Source/cmOutputRequiredFilesCommand.cxx
  71. 1 1
      Source/cmPropertyMap.cxx
  72. 1 1
      Source/cmQtAutoMocUic.cxx
  73. 3 3
      Source/cmQtAutoMocUic.h
  74. 1 1
      Source/cmSourceGroupCommand.h
  75. 1 1
      Source/cmString.hxx
  76. 1 1
      Source/cmTarget.h
  77. 1 1
      Source/cmVariableWatch.h
  78. 7 7
      Source/cmVisualStudio10TargetGenerator.cxx
  79. 9 9
      Source/cmVisualStudio10TargetGenerator.h
  80. 1 1
      Source/cmVisualStudioGeneratorOptions.h
  81. 2 2
      Source/cmVisualStudioSlnData.h
  82. 1 1
      Source/cmVisualStudioSlnParser.cxx
  83. 1 1
      Source/cmVisualStudioSlnParser.h
  84. 1 1
      Source/cmXCodeScheme.h
  85. 2 2
      Source/cm_string_view.hxx
  86. 3 3
      Source/cm_sys_stat.h
  87. 1 1
      Source/cmake.cxx
  88. 1 1
      Source/cmake.h

+ 0 - 1
.clang-tidy

@@ -20,7 +20,6 @@ modernize-*,\
 -modernize-use-nodiscard,\
 -modernize-use-noexcept,\
 -modernize-use-transparent-functors,\
--modernize-use-using,\
 performance-*,\
 readability-*,\
 -readability-function-size,\

+ 6 - 6
Source/CPack/IFW/cmCPackIFWGenerator.h

@@ -29,12 +29,12 @@ class cmCPackIFWGenerator
 public:
   cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);
 
-  typedef std::map<std::string, cmCPackIFWPackage> PackagesMap;
-  typedef std::map<std::string, cmCPackIFWRepository> RepositoriesMap;
-  typedef std::map<std::string, cmCPackComponent> ComponentsMap;
-  typedef std::map<std::string, cmCPackComponentGroup> ComponentGoupsMap;
-  typedef std::map<std::string, cmCPackIFWPackage::DependenceStruct>
-    DependenceMap;
+  using PackagesMap = std::map<std::string, cmCPackIFWPackage>;
+  using RepositoriesMap = std::map<std::string, cmCPackIFWRepository>;
+  using ComponentsMap = std::map<std::string, cmCPackComponent>;
+  using ComponentGoupsMap = std::map<std::string, cmCPackComponentGroup>;
+  using DependenceMap =
+    std::map<std::string, cmCPackIFWPackage::DependenceStruct>;
 
   using cmCPackIFWCommon::GetOption;
   using cmCPackIFWCommon::IsOn;

+ 2 - 2
Source/CPack/IFW/cmCPackIFWInstaller.h

@@ -22,8 +22,8 @@ class cmCPackIFWInstaller : public cmCPackIFWCommon
 public:
   // Types
 
-  typedef std::map<std::string, cmCPackIFWPackage*> PackagesMap;
-  typedef std::vector<cmCPackIFWRepository*> RepositoriesVector;
+  using PackagesMap = std::map<std::string, cmCPackIFWPackage*>;
+  using RepositoriesVector = std::vector<cmCPackIFWRepository*>;
 
 public:
   // Constructor

+ 1 - 1
Source/CPack/IFW/cmCPackIFWRepository.h

@@ -28,7 +28,7 @@ public:
     Replace
   };
 
-  typedef std::vector<cmCPackIFWRepository*> RepositoriesVector;
+  using RepositoriesVector = std::vector<cmCPackIFWRepository*>;
 
 public:
   // Constructor

+ 3 - 3
Source/CPack/WiX/cmCPackWIXGenerator.h

@@ -44,9 +44,9 @@ protected:
   bool SupportsComponentInstallation() const override { return true; }
 
 private:
-  typedef std::map<std::string, std::string> id_map_t;
-  typedef std::map<std::string, size_t> ambiguity_map_t;
-  typedef std::set<std::string> extension_set_t;
+  using id_map_t = std::map<std::string, std::string>;
+  using ambiguity_map_t = std::map<std::string, size_t>;
+  using extension_set_t = std::set<std::string>;
 
   enum class DefinitionType
   {

+ 3 - 3
Source/CPack/WiX/cmWIXPatchParser.h

@@ -36,8 +36,8 @@ struct cmWIXPatchElement : cmWIXPatchNode
 
   ~cmWIXPatchElement();
 
-  typedef std::vector<cmWIXPatchNode*> child_list_t;
-  typedef std::map<std::string, std::string> attributes_t;
+  using child_list_t = std::vector<cmWIXPatchNode*>;
+  using attributes_t = std::map<std::string, std::string>;
 
   std::string name;
   child_list_t children;
@@ -50,7 +50,7 @@ struct cmWIXPatchElement : cmWIXPatchNode
 class cmWIXPatchParser : public cmXMLParser
 {
 public:
-  typedef std::map<std::string, cmWIXPatchElement> fragment_map_t;
+  using fragment_map_t = std::map<std::string, cmWIXPatchElement>;
 
   cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
 

+ 1 - 1
Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx

@@ -25,7 +25,7 @@ cmWIXRichTextFormatWriter::~cmWIXRichTextFormatWriter()
 
 void cmWIXRichTextFormatWriter::AddText(std::string const& text)
 {
-  typedef unsigned char rtf_byte_t;
+  using rtf_byte_t = unsigned char;
 
   for (size_t i = 0; i < text.size(); ++i) {
     rtf_byte_t c = rtf_byte_t(text[i]);

+ 3 - 3
Source/CPack/WiX/cmWIXShortcut.h

@@ -28,8 +28,8 @@ public:
     STARTUP
   };
 
-  typedef std::vector<cmWIXShortcut> shortcut_list_t;
-  typedef std::map<std::string, shortcut_list_t> shortcut_id_map_t;
+  using shortcut_list_t = std::vector<cmWIXShortcut>;
+  using shortcut_id_map_t = std::map<std::string, shortcut_list_t>;
 
   void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut);
 
@@ -46,7 +46,7 @@ public:
                             cmInstalledFile const& installedFile);
 
 private:
-  typedef std::map<Type, shortcut_id_map_t> shortcut_type_map_t;
+  using shortcut_type_map_t = std::map<Type, shortcut_id_map_t>;
 
   void CreateFromProperty(std::string const& propertyName, Type type,
                           std::string const& id,

+ 1 - 1
Source/CPack/cmCPackArchiveGenerator.h

@@ -22,7 +22,7 @@ class cmCPackComponent;
 class cmCPackArchiveGenerator : public cmCPackGenerator
 {
 public:
-  typedef cmCPackGenerator Superclass;
+  using Superclass = cmCPackGenerator;
 
   static cmCPackGenerator* Create7ZGenerator();
   static cmCPackGenerator* CreateTBZ2Generator();

+ 1 - 1
Source/CPack/cmCPackGenerator.h

@@ -326,7 +326,7 @@ protected:
 };
 
 #define cmCPackTypeMacro(klass, superclass)                                   \
-  typedef superclass Superclass;                                              \
+  using Superclass = superclass;                                              \
   const char* GetNameOfClass() override { return #klass; }                    \
   static cmCPackGenerator* CreateGenerator() { return new klass; }            \
   class cmCPackTypeMacro_UseTrailingSemicolon

+ 3 - 3
Source/CPack/cmCPackGeneratorFactory.h

@@ -29,7 +29,7 @@ public:
   cmCPackGenerator* NewGenerator(const std::string& name);
   void DeleteGenerator(cmCPackGenerator* gen);
 
-  typedef cmCPackGenerator* CreateGeneratorCall();
+  using CreateGeneratorCall = cmCPackGenerator*();
 
   void RegisterGenerator(const std::string& name,
                          const char* generatorDescription,
@@ -37,7 +37,7 @@ public:
 
   void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
 
-  typedef std::map<std::string, std::string> DescriptionsMap;
+  using DescriptionsMap = std::map<std::string, std::string>;
   const DescriptionsMap& GetGeneratorsList() const
   {
     return this->GeneratorDescriptions;
@@ -47,7 +47,7 @@ private:
   cmCPackGenerator* NewGeneratorInternal(const std::string& name);
   std::vector<cmCPackGenerator*> Generators;
 
-  typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
+  using t_GeneratorCreatorsMap = std::map<std::string, CreateGeneratorCall*>;
   t_GeneratorCreatorsMap GeneratorCreators;
   DescriptionsMap GeneratorDescriptions;
   cmCPackLog* Logger;

+ 1 - 1
Source/CPack/cpack.cxx

@@ -66,7 +66,7 @@ int cpackUnknownArgument(const char* /*unused*/, void* /*unused*/)
 
 struct cpackDefinitions
 {
-  typedef std::map<std::string, std::string> MapType;
+  using MapType = std::map<std::string, std::string>;
   MapType Map;
   cmCPackLog* Log;
 };

+ 1 - 1
Source/CTest/cmCTestBuildAndTestHandler.h

@@ -22,7 +22,7 @@ class cmake;
 class cmCTestBuildAndTestHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   /*
    * The main entry point for this class

+ 1 - 1
Source/CTest/cmCTestBuildHandler.cxx

@@ -529,7 +529,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
   // Sort XML fragments in chronological order.
   cmFileTimeCache ftc;
   FragmentCompare fragmentCompare(&ftc);
-  typedef std::set<std::string, FragmentCompare> Fragments;
+  using Fragments = std::set<std::string, FragmentCompare>;
   Fragments fragments(fragmentCompare);
 
   // only report the first 50 warnings and first 50 errors

+ 4 - 4
Source/CTest/cmCTestBuildHandler.h

@@ -28,8 +28,8 @@ class cmXMLWriter;
 class cmCTestBuildHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
-  typedef cmProcessOutput::Encoding Encoding;
+  using Superclass = cmCTestGenericHandler;
+  using Encoding = cmProcessOutput::Encoding;
 
   /*
    * The main entry point for this class
@@ -111,7 +111,7 @@ private:
   std::vector<cmsys::RegularExpression> WarningMatchRegex;
   std::vector<cmsys::RegularExpression> WarningExceptionRegex;
 
-  typedef std::deque<char> t_BuildProcessingQueueType;
+  using t_BuildProcessingQueueType = std::deque<char>;
 
   void ProcessBuffer(const char* data, size_t length, size_t& tick,
                      size_t tick_len, std::ostream& ofs,
@@ -126,7 +126,7 @@ private:
   std::string SimplifySourceDir;
   std::string SimplifyBuildDir;
   size_t OutputLineCounter;
-  typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector;
+  using t_ErrorsAndWarningsVector = std::vector<cmCTestBuildErrorWarning>;
   t_ErrorsAndWarningsVector ErrorsAndWarnings;
   t_ErrorsAndWarningsVector::iterator LastErrorOrWarning;
   size_t PostContextCount;

+ 1 - 1
Source/CTest/cmCTestConfigureHandler.h

@@ -14,7 +14,7 @@
 class cmCTestConfigureHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   /*
    * The main entry point for this class

+ 1 - 1
Source/CTest/cmCTestCoverageCommand.h

@@ -42,7 +42,7 @@ public:
    */
   std::string GetName() const override { return "ctest_coverage"; }
 
-  typedef cmCTestHandlerCommand Superclass;
+  using Superclass = cmCTestHandlerCommand;
 
 protected:
   cmCTestGenericHandler* InitializeHandler() override;

+ 5 - 5
Source/CTest/cmCTestCoverageHandler.h

@@ -24,8 +24,8 @@ public:
   int Error;
   std::string SourceDir;
   std::string BinaryDir;
-  typedef std::vector<int> SingleFileCoverageVector;
-  typedef std::map<std::string, SingleFileCoverageVector> TotalCoverageMap;
+  using SingleFileCoverageVector = std::vector<int>;
+  using TotalCoverageMap = std::map<std::string, SingleFileCoverageVector>;
   TotalCoverageMap TotalCoverage;
   std::ostream* OFS;
   bool Quiet;
@@ -37,7 +37,7 @@ public:
 class cmCTestCoverageHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   /*
    * The main entry point for this class
@@ -128,12 +128,12 @@ private:
   class LabelSet : public std::set<int>
   {
   };
-  typedef std::map<std::string, LabelSet> LabelMapType;
+  using LabelMapType = std::map<std::string, LabelSet>;
   LabelMapType SourceLabels;
   LabelMapType TargetDirs;
 
   // Map from label name to label id.
-  typedef std::map<std::string, int> LabelIdMapType;
+  using LabelIdMapType = std::map<std::string, int>;
   LabelIdMapType LabelIdMap;
   std::vector<std::string> Labels;
   int GetLabelId(std::string const& label);

+ 1 - 1
Source/CTest/cmCTestGenericHandler.h

@@ -71,7 +71,7 @@ public:
   cmCTestGenericHandler();
   virtual ~cmCTestGenericHandler();
 
-  typedef std::map<std::string, std::string> t_StringToString;
+  using t_StringToString = std::map<std::string, std::string>;
 
   void SetPersistentOption(const std::string& op, const char* value);
   void SetOption(const std::string& op, const char* value);

+ 1 - 1
Source/CTest/cmCTestMemCheckHandler.h

@@ -22,7 +22,7 @@ class cmCTestMemCheckHandler : public cmCTestTestHandler
   friend class cmCTestRunTest;
 
 public:
-  typedef cmCTestTestHandler Superclass;
+  using Superclass = cmCTestTestHandler;
 
   void PopulateCustomVectors(cmMakefile* mf) override;
 

+ 1 - 1
Source/CTest/cmCTestScriptHandler.h

@@ -58,7 +58,7 @@ class cmake;
 class cmCTestScriptHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   /**
    * Add a script to run, and if is should run in the current process

+ 1 - 1
Source/CTest/cmCTestSubmitCommand.h

@@ -37,7 +37,7 @@ public:
    */
   std::string GetName() const override { return "ctest_submit"; }
 
-  typedef cmCTestHandlerCommand Superclass;
+  using Superclass = cmCTestHandlerCommand;
 
 protected:
   cmCTestGenericHandler* InitializeHandler() override;

+ 2 - 2
Source/CTest/cmCTestSubmitHandler.h

@@ -22,7 +22,7 @@
 class cmCTestSubmitHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   cmCTestSubmitHandler();
   ~cmCTestSubmitHandler() override { this->LogFile = nullptr; }
@@ -59,7 +59,7 @@ private:
                        const std::string& remoteprefix,
                        const std::string& url);
 
-  typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
+  using cmCTestSubmitHandlerVectorOfChar = std::vector<char>;
 
   void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
 

+ 1 - 1
Source/CTest/cmCTestTestHandler.cxx

@@ -940,7 +940,7 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const
   // Prepare some maps to help us find setup and cleanup tests for
   // any given fixture
   using TestIterator = ListOfTests::const_iterator;
-  typedef std::multimap<std::string, TestIterator> FixtureDependencies;
+  using FixtureDependencies = std::multimap<std::string, TestIterator>;
   using FixtureDepsIterator = FixtureDependencies::const_iterator;
   FixtureDependencies fixtureSetups;
   FixtureDependencies fixtureCleanups;

+ 5 - 6
Source/CTest/cmCTestTestHandler.h

@@ -34,7 +34,7 @@ class cmCTestTestHandler : public cmCTestGenericHandler
   friend class cmCTestMultiProcessHandler;
 
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   /**
    * The main entry point for this class
@@ -188,12 +188,11 @@ public:
                                     std::vector<std::string>& extraPaths,
                                     std::vector<std::string>& failed);
 
-  typedef std::vector<cmCTestTestProperties> ListOfTests;
+  using ListOfTests = std::vector<cmCTestTestProperties>;
 
 protected:
-  typedef std::set<cmCTestTestHandler::cmCTestTestResult,
-                   cmCTestTestResultLess>
-    SetOfTests;
+  using SetOfTests =
+    std::set<cmCTestTestHandler::cmCTestTestResult, cmCTestTestResultLess>;
 
   // compute a final test list
   virtual int PreProcessHandler();
@@ -222,7 +221,7 @@ protected:
 
   cmDuration ElapsedTestingTime;
 
-  typedef std::vector<cmCTestTestResult> TestResultsVector;
+  using TestResultsVector = std::vector<cmCTestTestResult>;
   TestResultsVector TestResults;
 
   std::vector<std::string> CustomTestsIgnore;

+ 1 - 1
Source/CTest/cmCTestUpdateHandler.h

@@ -18,7 +18,7 @@
 class cmCTestUpdateHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   /*
    * The main entry point for this class

+ 1 - 1
Source/CTest/cmCTestUploadCommand.h

@@ -41,7 +41,7 @@ public:
    */
   std::string GetName() const override { return "ctest_upload"; }
 
-  typedef cmCTestHandlerCommand Superclass;
+  using Superclass = cmCTestHandlerCommand;
 
 protected:
   cmCTestGenericHandler* InitializeHandler() override;

+ 1 - 1
Source/CTest/cmCTestUploadHandler.h

@@ -19,7 +19,7 @@
 class cmCTestUploadHandler : public cmCTestGenericHandler
 {
 public:
-  typedef cmCTestGenericHandler Superclass;
+  using Superclass = cmCTestGenericHandler;
 
   cmCTestUploadHandler();
 

+ 1 - 1
Source/QtDialog/QCMake.h

@@ -50,7 +50,7 @@ struct QCMakeProperty
 };
 
 // list of properties
-typedef QList<QCMakeProperty> QCMakePropertyList;
+using QCMakePropertyList = QList<QCMakeProperty>;
 
 // allow QVariant to be a property or list of properties
 Q_DECLARE_METATYPE(QCMakeProperty)

+ 1 - 1
Source/cmAffinity.cxx

@@ -22,7 +22,7 @@
 #    if defined(__linux__)
 using cm_cpuset_t = cpu_set_t;
 #    else
-typedef cpuset_t cm_cpuset_t;
+using cm_cpuset_t = cpuset_t;
 #    endif
 #  endif
 #endif

+ 1 - 1
Source/cmCLocaleEnvironmentScope.h

@@ -22,7 +22,7 @@ private:
   std::string GetEnv(std::string const& key);
   void SetEnv(std::string const& key, std::string const& value);
 
-  typedef std::map<std::string, std::string> backup_map_t;
+  using backup_map_t = std::map<std::string, std::string>;
   backup_map_t EnvironmentBackup;
 };
 

+ 11 - 0
Source/cmCPluginAPI.h

@@ -28,6 +28,7 @@ this is the structure of function entry points that a plugin may call. This
 structure must be kept in sync with the static decaled at the bottom of
 cmCPLuginAPI.cxx
 =========================================================================*/
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef struct
 {
   /*=========================================================================
@@ -194,12 +195,21 @@ define the different types of custom commands for a target
 /*=========================================================================
 Finally we define the key data structures and function prototypes
 =========================================================================*/
+
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef const char*(CCONV* CM_DOC_FUNCTION)();
+
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc,
                                              char* []);
+
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf);
+
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef void(CCONV* CM_DESTRUCTOR_FUNCTION)(void* info);
 
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef struct
 {
   unsigned long reserved1; /* Reserved for future use.  DO NOT USE.  */
@@ -216,6 +226,7 @@ typedef struct
   void* ClientData;
 } cmLoadedCommandInfo;
 
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef void(CCONV* CM_INIT_FUNCTION)(cmLoadedCommandInfo*);
 
 #ifdef __cplusplus

+ 1 - 1
Source/cmCacheManager.h

@@ -212,7 +212,7 @@ protected:
   unsigned int CacheMinorVersion;
 
 private:
-  typedef std::map<std::string, CacheEntry> CacheEntryMap;
+  using CacheEntryMap = std::map<std::string, CacheEntry>;
   static void OutputHelpString(std::ostream& fout,
                                const std::string& helpString);
   static void OutputWarningComment(std::ostream& fout,

+ 1 - 1
Source/cmCommonTargetGenerator.h

@@ -50,7 +50,7 @@ protected:
   void AppendOSXVerFlag(std::string& flags, const std::string& lang,
                         const char* name, bool so);
 
-  typedef std::map<std::string, std::string> ByLanguageMap;
+  using ByLanguageMap = std::map<std::string, std::string>;
   std::string GetFlags(const std::string& l);
   ByLanguageMap FlagsByLanguage;
   std::string GetDefines(const std::string& l);

+ 1 - 1
Source/cmCustomCommand.h

@@ -68,7 +68,7 @@ public:
   /** Backtrace of the command that created this custom command.  */
   cmListFileBacktrace const& GetBacktrace() const;
 
-  typedef std::pair<std::string, std::string> ImplicitDependsPair;
+  using ImplicitDependsPair = std::pair<std::string, std::string>;
   class ImplicitDependsList : public std::vector<ImplicitDependsPair>
   {
   };

+ 1 - 1
Source/cmDepends.h

@@ -24,7 +24,7 @@ class cmLocalGenerator;
 class cmDepends
 {
 public:
-  typedef std::map<std::string, std::vector<std::string>> DependencyMap;
+  using DependencyMap = std::map<std::string, std::vector<std::string>>;
 
 public:
   /** Instances need to know the build directory name and the relative

+ 1 - 1
Source/cmDependsC.h

@@ -59,7 +59,7 @@ protected:
   // Regex to transform #include lines.
   std::string IncludeRegexTransformString;
   cmsys::RegularExpression IncludeRegexTransform;
-  typedef std::map<std::string, std::string> TransformRulesType;
+  using TransformRulesType = std::map<std::string, std::string>;
   TransformRulesType TransformRules;
   void SetupTransforms();
   void ParseTransform(std::string const& xform);

+ 2 - 2
Source/cmDependsFortran.cxx

@@ -46,11 +46,11 @@ public:
   std::set<std::string> TargetProvides;
 
   // Map modules required by this target to locations.
-  typedef std::map<std::string, std::string> TargetRequiresMap;
+  using TargetRequiresMap = std::map<std::string, std::string>;
   TargetRequiresMap TargetRequires;
 
   // Information about each object file.
-  typedef std::map<std::string, cmFortranSourceInfo> ObjectInfoMap;
+  using ObjectInfoMap = std::map<std::string, cmFortranSourceInfo>;
   ObjectInfoMap ObjectInfo;
 
   cmFortranSourceInfo& CreateObjectInfo(const std::string& obj,

+ 1 - 1
Source/cmDuration.h

@@ -5,7 +5,7 @@
 #include <chrono>
 #include <ratio>
 
-typedef std::chrono::duration<double, std::ratio<1>> cmDuration;
+using cmDuration = std::chrono::duration<double, std::ratio<1>>;
 
 /*
  * This function will return number of seconds in the requested type T.

+ 7 - 8
Source/cmELF.cxx

@@ -20,11 +20,11 @@
 #elif defined(__HAIKU__)
 #  include <elf32.h>
 #  include <elf64.h>
-typedef struct Elf32_Ehdr Elf32_Ehdr;
-typedef struct Elf32_Shdr Elf32_Shdr;
-typedef struct Elf32_Sym Elf32_Sym;
-typedef struct Elf32_Rel Elf32_Rel;
-typedef struct Elf32_Rela Elf32_Rela;
+using Elf32_Ehdr = struct Elf32_Ehdr;
+using Elf32_Shdr = struct Elf32_Shdr;
+using Elf32_Sym = struct Elf32_Sym;
+using Elf32_Rel = struct Elf32_Rel;
+using Elf32_Rela = struct Elf32_Rela;
 #  define ELFMAG0 0x7F
 #  define ELFMAG1 'E'
 #  define ELFMAG2 'L'
@@ -289,9 +289,8 @@ public:
   }
 
 private:
-  // ByteSwap(ELF_Dyn) assumes d_val and d_ptr are the same size
-  typedef char dyn_size_assert
-    [sizeof(ELF_Dyn().d_un.d_val) == sizeof(ELF_Dyn().d_un.d_ptr) ? 1 : -1];
+  static_assert(sizeof(ELF_Dyn().d_un.d_val) == sizeof(ELF_Dyn().d_un.d_ptr),
+                "ByteSwap(ELF_Dyn) assumes d_val and d_ptr are the same size");
 
   void ByteSwap(ELF_Ehdr& elf_header)
   {

+ 1 - 1
Source/cmELF.h

@@ -68,7 +68,7 @@ public:
   };
 
   /** Represent entire dynamic section header */
-  typedef std::vector<std::pair<long, unsigned long>> DynamicEntryList;
+  using DynamicEntryList = std::vector<std::pair<long, unsigned long>>;
 
   /** Get the type of the file opened.  */
   FileType GetFileType() const;

+ 1 - 1
Source/cmExportFileGenerator.h

@@ -62,7 +62,7 @@ public:
   bool GenerateImportFile();
 
 protected:
-  typedef std::map<std::string, std::string> ImportPropertyMap;
+  using ImportPropertyMap = std::map<std::string, std::string>;
 
   // Generate per-configuration target information to the given output
   // stream.

+ 1 - 1
Source/cmExportSetMap.h

@@ -13,7 +13,7 @@ class cmExportSet;
 /// A name -> cmExportSet map with overloaded operator[].
 class cmExportSetMap : public std::map<std::string, cmExportSet*>
 {
-  typedef std::map<std::string, cmExportSet*> derived;
+  using derived = std::map<std::string, cmExportSet*>;
 
 public:
   /** \brief Overloaded operator[].

+ 1 - 1
Source/cmExtraCodeBlocksGenerator.cxx

@@ -333,7 +333,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
   // Collect all used source files in the project.
   // Keep a list of C/C++ source files which might have an accompanying header
   // that should be looked for.
-  typedef std::map<std::string, CbpUnit> all_files_map_t;
+  using all_files_map_t = std::map<std::string, CbpUnit>;
   all_files_map_t allFiles;
   std::vector<std::string> cFiles;
 

+ 1 - 1
Source/cmExtraSublimeTextGenerator.h

@@ -24,7 +24,7 @@ class cmExtraSublimeTextGenerator : public cmExternalMakefileProjectGenerator
 {
 public:
   static cmExternalMakefileProjectGeneratorFactory* GetFactory();
-  typedef std::map<std::string, std::vector<std::string>> MapSourceFileFlags;
+  using MapSourceFileFlags = std::map<std::string, std::vector<std::string>>;
   cmExtraSublimeTextGenerator();
 
   void Generate() override;

+ 1 - 1
Source/cmFileLockResult.h

@@ -19,7 +19,7 @@ class cmFileLockResult
 {
 public:
 #if defined(_WIN32)
-  typedef DWORD Error;
+  using Error = DWORD;
 #else
   using Error = int;
 #endif

+ 2 - 3
Source/cmGeneratorExpression.cxx

@@ -370,9 +370,8 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string& input)
 void cmCompiledGeneratorExpression::GetMaxLanguageStandard(
   const cmGeneratorTarget* tgt, std::map<std::string, std::string>& mapping)
 {
-  typedef std::map<cmGeneratorTarget const*,
-                   std::map<std::string, std::string>>
-    MapType;
+  using MapType =
+    std::map<cmGeneratorTarget const*, std::map<std::string, std::string>>;
   MapType::const_iterator it = this->MaxLanguageStandard.find(tgt);
   if (it != this->MaxLanguageStandard.end()) {
     mapping = it->second;

+ 1 - 1
Source/cmGeneratorExpressionNode.cxx

@@ -1473,7 +1473,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
     }
     context->HadHeadSensitiveCondition = true;
 
-    typedef std::map<std::string, std::vector<std::string>> LangMap;
+    using LangMap = std::map<std::string, std::vector<std::string>>;
     static LangMap availableFeatures;
 
     LangMap testedFeatures;

+ 2 - 2
Source/cmGeneratorTarget.cxx

@@ -1107,7 +1107,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
     config_upper = cmSystemTools::UpperCase(config);
   }
 
-  typedef std::map<std::string, std::vector<std::string>> IncludeCacheType;
+  using IncludeCacheType = std::map<std::string, std::vector<std::string>>;
   IncludeCacheType::const_iterator iter =
     this->SystemIncludesCache.find(config_upper);
 
@@ -2606,7 +2606,7 @@ private:
   SourceEntry* CurrentEntry;
   std::queue<cmSourceFile*> SourceQueue;
   std::set<cmSourceFile*> SourcesQueued;
-  typedef std::map<std::string, cmSourceFile*> NameMapType;
+  using NameMapType = std::map<std::string, cmSourceFile*>;
   NameMapType NameMap;
   std::vector<std::string> NewSources;
 

+ 14 - 14
Source/cmGeneratorTarget.h

@@ -531,7 +531,7 @@ public:
 
   CompileInfo const* GetCompileInfo(const std::string& config) const;
 
-  typedef std::map<std::string, CompileInfo> CompileInfoMapType;
+  using CompileInfoMapType = std::map<std::string, CompileInfo>;
   mutable CompileInfoMapType CompileInfoMap;
 
   bool IsNullImpliedByLinkLibraries(const std::string& p) const;
@@ -745,7 +745,7 @@ private:
   {
     std::vector<cmSourceFile*> Depends;
   };
-  typedef std::map<cmSourceFile const*, SourceEntry> SourceEntriesType;
+  using SourceEntriesType = std::map<cmSourceFile const*, SourceEntry>;
   SourceEntriesType SourceDepends;
   mutable std::map<cmSourceFile const*, std::string> Objects;
   std::set<cmSourceFile const*> ExplicitObjectName;
@@ -775,7 +775,7 @@ private:
                            std::string& outPrefix, std::string& outBase,
                            std::string& outSuffix) const;
 
-  typedef std::map<std::string, LinkClosure> LinkClosureMapType;
+  using LinkClosureMapType = std::map<std::string, LinkClosure>;
   mutable LinkClosureMapType LinkClosureMap;
 
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
@@ -802,8 +802,8 @@ private:
   };
   mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
 
-  typedef std::map<std::string, cmComputeLinkInformation*>
-    cmTargetLinkInformationMap;
+  using cmTargetLinkInformationMap =
+    std::map<std::string, cmComputeLinkInformation*>;
   mutable cmTargetLinkInformationMap LinkInformation;
 
   void CheckPropertyCompatibility(cmComputeLinkInformation* info,
@@ -815,7 +815,7 @@ private:
   };
   mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
 
-  typedef std::map<std::string, cmHeadToLinkInterfaceMap> LinkInterfaceMapType;
+  using LinkInterfaceMapType = std::map<std::string, cmHeadToLinkInterfaceMap>;
   mutable LinkInterfaceMapType LinkInterfaceMap;
   mutable LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
 
@@ -843,7 +843,7 @@ private:
     std::string SharedDeps;
   };
 
-  typedef std::map<std::string, ImportInfo> ImportInfoMapType;
+  using ImportInfoMapType = std::map<std::string, ImportInfo>;
   mutable ImportInfoMapType ImportInfoMap;
   void ComputeImportInfo(std::string const& desired_config,
                          ImportInfo& info) const;
@@ -857,7 +857,7 @@ private:
     const std::string& config, const cmGeneratorTarget* head,
     bool usage_requirements_only) const;
 
-  typedef std::map<std::string, KindedSources> KindedSourcesMapType;
+  using KindedSourcesMapType = std::map<std::string, KindedSources>;
   mutable KindedSourcesMapType KindedSourcesMap;
   void ComputeKindedSources(KindedSources& files,
                             std::string const& config) const;
@@ -902,7 +902,7 @@ private:
     : public std::map<cmGeneratorTarget const*, cmOptionalLinkImplementation>
   {
   };
-  typedef std::map<std::string, HeadToLinkImplementationMap> LinkImplMapType;
+  using LinkImplMapType = std::map<std::string, HeadToLinkImplementationMap>;
   mutable LinkImplMapType LinkImplMap;
 
   cmLinkImplementationLibraries const* GetLinkImplementationLibrariesInternal(
@@ -911,17 +911,17 @@ private:
                         cmStateEnums::ArtifactType artifact,
                         std::string& out) const;
 
-  typedef std::map<std::string, OutputInfo> OutputInfoMapType;
+  using OutputInfoMapType = std::map<std::string, OutputInfo>;
   mutable OutputInfoMapType OutputInfoMap;
 
-  typedef std::map<std::string, ModuleDefinitionInfo>
-    ModuleDefinitionInfoMapType;
+  using ModuleDefinitionInfoMapType =
+    std::map<std::string, ModuleDefinitionInfo>;
   mutable ModuleDefinitionInfoMapType ModuleDefinitionInfoMap;
   void ComputeModuleDefinitionInfo(std::string const& config,
                                    ModuleDefinitionInfo& info) const;
 
-  typedef std::pair<std::string, cmStateEnums::ArtifactType> OutputNameKey;
-  typedef std::map<OutputNameKey, std::string> OutputNameMapType;
+  using OutputNameKey = std::pair<std::string, cmStateEnums::ArtifactType>;
+  using OutputNameMapType = std::map<OutputNameKey, std::string>;
   mutable OutputNameMapType OutputNameMap;
   mutable std::set<cmLinkItem> UtilityItems;
   cmPolicies::PolicyMap PolicyMap;

+ 1 - 1
Source/cmGlobVerificationManager.h

@@ -72,7 +72,7 @@ private:
     std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
   };
 
-  typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;
+  using CacheEntryMap = std::map<CacheEntryKey, CacheEntryValue>;
   CacheEntryMap Cache;
   std::string VerifyScript;
   std::string VerifyStamp;

+ 6 - 6
Source/cmGlobalGenerator.h

@@ -561,11 +561,11 @@ protected:
   const char* GetPredefinedTargetsFolder();
 
 private:
-  typedef std::unordered_map<std::string, cmTarget*> TargetMap;
-  typedef std::unordered_map<std::string, cmGeneratorTarget*>
-    GeneratorTargetMap;
-  typedef std::unordered_map<std::string, cmMakefile*> MakefileMap;
-  typedef std::unordered_map<std::string, cmLocalGenerator*> LocalGeneratorMap;
+  using TargetMap = std::unordered_map<std::string, cmTarget*>;
+  using GeneratorTargetMap =
+    std::unordered_map<std::string, cmGeneratorTarget*>;
+  using MakefileMap = std::unordered_map<std::string, cmMakefile*>;
+  using LocalGeneratorMap = std::unordered_map<std::string, cmLocalGenerator*>;
   // Map efficiently from target name to cmTarget instance.
   // Do not use this structure for looping over all targets.
   // It contains both normal and globally visible imported targets.
@@ -626,7 +626,7 @@ private:
   std::vector<std::string> FilesReplacedDuringGenerate;
 
   // Store computed inter-target dependencies.
-  typedef std::map<cmGeneratorTarget const*, TargetDependSet> TargetDependMap;
+  using TargetDependMap = std::map<cmGeneratorTarget const*, TargetDependSet>;
   TargetDependMap TargetDependencies;
 
   friend class cmake;

+ 2 - 3
Source/cmGlobalGhsMultiGenerator.h

@@ -148,9 +148,8 @@ class cmGlobalGhsMultiGenerator::OrderedTargetDependSet
   : public std::multiset<cmTargetDepend,
                          cmGlobalGhsMultiGenerator::TargetCompare>
 {
-  typedef std::multiset<cmTargetDepend,
-                        cmGlobalGhsMultiGenerator::TargetCompare>
-    derived;
+  using derived =
+    std::multiset<cmTargetDepend, cmGlobalGhsMultiGenerator::TargetCompare>;
 
 public:
   using TargetDependSet = cmGlobalGenerator::TargetDependSet;

+ 1 - 1
Source/cmGlobalNinjaGenerator.h

@@ -426,7 +426,7 @@ private:
   /// The mapping from source file to assumed dependencies.
   std::map<std::string, std::set<std::string>> AssumedSourceDependencies;
 
-  typedef std::map<std::string, cmGeneratorTarget*> TargetAliasMap;
+  using TargetAliasMap = std::map<std::string, cmGeneratorTarget*>;
   TargetAliasMap TargetAliases;
 
   std::map<cmGeneratorTarget const*, cmNinjaOuts> TargetDependsClosures;

+ 2 - 3
Source/cmGlobalUnixMakefileGenerator3.h

@@ -220,9 +220,8 @@ protected:
     std::vector<unsigned long> Marks;
     void WriteProgressVariables(unsigned long total, unsigned long& current);
   };
-  typedef std::map<cmGeneratorTarget const*, TargetProgress,
-                   cmGeneratorTarget::StrictTargetComparison>
-    ProgressMapType;
+  using ProgressMapType = std::map<cmGeneratorTarget const*, TargetProgress,
+                                   cmGeneratorTarget::StrictTargetComparison>;
   ProgressMapType ProgressMap;
 
   size_t CountProgressMarksInTarget(

+ 5 - 6
Source/cmGlobalVisualStudioGenerator.h

@@ -180,7 +180,7 @@ protected:
                                   const std::string&);
   virtual std::string WriteUtilityDepend(cmGeneratorTarget const*) = 0;
   std::string GetUtilityDepend(const cmGeneratorTarget* target);
-  typedef std::map<cmGeneratorTarget const*, std::string> UtilityDependsMap;
+  using UtilityDependsMap = std::map<cmGeneratorTarget const*, std::string>;
   UtilityDependsMap UtilityDepends;
 
 protected:
@@ -213,13 +213,12 @@ class cmGlobalVisualStudioGenerator::OrderedTargetDependSet
   : public std::multiset<cmTargetDepend,
                          cmGlobalVisualStudioGenerator::TargetCompare>
 {
-  typedef std::multiset<cmTargetDepend,
-                        cmGlobalVisualStudioGenerator::TargetCompare>
-    derived;
+  using derived = std::multiset<cmTargetDepend,
+                                cmGlobalVisualStudioGenerator::TargetCompare>;
 
 public:
-  typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
-  typedef cmGlobalVisualStudioGenerator::TargetSet TargetSet;
+  using TargetDependSet = cmGlobalGenerator::TargetDependSet;
+  using TargetSet = cmGlobalVisualStudioGenerator::TargetSet;
   OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
   OrderedTargetDependSet(TargetSet const&, std::string const& first);
 };

+ 5 - 5
Source/cmGlobalXCodeGenerator.cxx

@@ -1244,8 +1244,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
   // framework or bundle targets
   std::vector<cmXCodeObject*> contentBuildPhases;
   if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) {
-    typedef std::map<std::string, std::vector<cmSourceFile*>>
-      mapOfVectorOfSourceFiles;
+    using mapOfVectorOfSourceFiles =
+      std::map<std::string, std::vector<cmSourceFile*>>;
     mapOfVectorOfSourceFiles bundleFiles;
     for (auto sourceFile : classes) {
       cmGeneratorTarget::SourceFileFlags tsFlags =
@@ -1292,8 +1292,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
   // create vector of "resource content file" build phases - only for
   // framework or bundle targets
   if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) {
-    typedef std::map<std::string, std::vector<cmSourceFile*>>
-      mapOfVectorOfSourceFiles;
+    using mapOfVectorOfSourceFiles =
+      std::map<std::string, std::vector<cmSourceFile*>>;
     mapOfVectorOfSourceFiles bundleFiles;
     for (auto sourceFile : classes) {
       cmGeneratorTarget::SourceFileFlags tsFlags =
@@ -3049,7 +3049,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
     this->CreateObject(cmXCodeObject::XCConfigurationList);
   cmXCodeObject* buildConfigurations =
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
-  typedef std::vector<std::pair<std::string, cmXCodeObject*>> Configs;
+  using Configs = std::vector<std::pair<std::string, cmXCodeObject*>>;
   Configs configs;
   std::string defaultConfigName;
   for (const auto& name : this->CurrentConfigurationTypes) {

+ 1 - 1
Source/cmIDEOptions.h

@@ -51,7 +51,7 @@ protected:
   // and overwrite or add new values to this map
   class FlagValue : public std::vector<std::string>
   {
-    typedef std::vector<std::string> derived;
+    using derived = std::vector<std::string>;
 
   public:
     FlagValue& operator=(std::string const& r)

+ 1 - 1
Source/cmInstalledFile.h

@@ -37,7 +37,7 @@ public:
     ExpressionVectorType ValueExpressions;
   };
 
-  typedef std::map<std::string, Property> PropertyMapType;
+  using PropertyMapType = std::map<std::string, Property>;
 
   cmInstalledFile();
 

+ 9 - 4
Source/cmListFileLexer.h

@@ -3,6 +3,11 @@
 #ifndef cmListFileLexer_h
 #define cmListFileLexer_h
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef enum cmListFileLexer_Type_e
 {
   cmListFileLexer_Token_None,
@@ -20,6 +25,7 @@ typedef enum cmListFileLexer_Type_e
   cmListFileLexer_Token_BadString
 } cmListFileLexer_Type;
 
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
 struct cmListFileLexer_Token_s
 {
@@ -40,14 +46,13 @@ enum cmListFileLexer_BOM_e
   cmListFileLexer_BOM_UTF32BE,
   cmListFileLexer_BOM_UTF32LE
 };
+
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM;
 
+/* NOLINTNEXTLINE(modernize-use-using) */
 typedef struct cmListFileLexer_s cmListFileLexer;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 cmListFileLexer* cmListFileLexer_New(void);
 int cmListFileLexer_SetFileName(cmListFileLexer*, const char*,
                                 cmListFileLexer_BOM* bom);

+ 2 - 2
Source/cmLocalGenerator.h

@@ -433,8 +433,8 @@ protected:
 
   std::set<std::string> EnvCPATH;
 
-  typedef std::unordered_map<std::string, cmGeneratorTarget*>
-    GeneratorTargetMap;
+  using GeneratorTargetMap =
+    std::unordered_map<std::string, cmGeneratorTarget*>;
   GeneratorTargetMap GeneratorTargetSearchIndex;
   std::vector<cmGeneratorTarget*> GeneratorTargets;
 

+ 2 - 2
Source/cmLocalNinjaGenerator.h

@@ -109,8 +109,8 @@ private:
 
   std::string HomeRelativeOutputPath;
 
-  typedef std::map<cmCustomCommand const*, std::set<cmGeneratorTarget*>>
-    CustomCommandTargetMap;
+  using CustomCommandTargetMap =
+    std::map<cmCustomCommand const*, std::set<cmGeneratorTarget*>>;
   CustomCommandTargetMap CustomCommandTargets;
   std::vector<cmCustomCommand const*> CustomCommands;
 };

+ 1 - 1
Source/cmLocalVisualStudio7Generator.cxx

@@ -30,7 +30,7 @@ public:
     : LocalGenerator(e)
   {
   }
-  typedef cmComputeLinkInformation::ItemVector ItemVector;
+  using ItemVector = cmComputeLinkInformation::ItemVector;
   void OutputLibraries(std::ostream& fout, ItemVector const& libs);
   void OutputObjects(std::ostream& fout, cmGeneratorTarget* t,
                      std::string const& config, const char* isep = 0);

+ 2 - 2
Source/cmLocalVisualStudio7Generator.h

@@ -83,8 +83,8 @@ protected:
   void CreateSingleVCProj(const std::string& lname, cmGeneratorTarget* tgt);
 
 private:
-  typedef cmVS7GeneratorOptions Options;
-  typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
+  using Options = cmVS7GeneratorOptions;
+  using FCInfo = cmLocalVisualStudio7GeneratorFCInfo;
   std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
                                       const std::string& configName);
   void FixGlobalTargets();

+ 3 - 2
Source/cmMakefile.cxx

@@ -2744,12 +2744,13 @@ MessageType cmMakefile::ExpandVariablesInStringOld(
   return mtype;
 }
 
-typedef enum
+enum t_domain
 {
   NORMAL,
   ENVIRONMENT,
   CACHE
-} t_domain;
+};
+
 struct t_lookup
 {
   t_domain domain = NORMAL;

+ 1 - 1
Source/cmMakefileTargetGenerator.h

@@ -223,7 +223,7 @@ protected:
   // Set of extra output files to be driven by the build.
   std::set<std::string> ExtraFiles;
 
-  typedef std::map<std::string, std::string> MultipleOutputPairsType;
+  using MultipleOutputPairsType = std::map<std::string, std::string>;
   MultipleOutputPairsType MultipleOutputPairs;
   bool WriteMakeRule(std::ostream& os, const char* comment,
                      const std::vector<std::string>& outputs,

+ 1 - 1
Source/cmNinjaTypes.h

@@ -19,7 +19,7 @@ enum cmNinjaTargetDepends
 
 using cmNinjaDeps = std::vector<std::string>;
 using cmNinjaOuts = std::set<std::string>;
-typedef std::map<std::string, std::string> cmNinjaVars;
+using cmNinjaVars = std::map<std::string, std::string>;
 
 class cmNinjaRule
 {

+ 2 - 2
Source/cmOrderDirectories.cxx

@@ -412,7 +412,7 @@ void cmOrderDirectories::AddOriginalDirectories(
 
 struct cmOrderDirectoriesCompare
 {
-  typedef std::pair<int, int> ConflictPair;
+  using ConflictPair = std::pair<int, int>;
 
   // The conflict pair is unique based on just the directory
   // (first).  The second element is only used for displaying
@@ -557,7 +557,7 @@ std::string const& cmOrderDirectories::GetRealPath(std::string const& dir)
     this->RealPaths.lower_bound(dir);
   if (i == this->RealPaths.end() ||
       this->RealPaths.key_comp()(dir, i->first)) {
-    typedef std::map<std::string, std::string>::value_type value_type;
+    using value_type = std::map<std::string, std::string>::value_type;
     i = this->RealPaths.insert(
       i, value_type(dir, cmSystemTools::GetRealPath(dir)));
   }

+ 1 - 1
Source/cmOrderDirectories.h

@@ -75,7 +75,7 @@ private:
   // the index of the directory that must come first.  The second
   // element is the index of the runtime library that added the
   // constraint.
-  typedef std::pair<int, int> ConflictPair;
+  using ConflictPair = std::pair<int, int>;
   struct ConflictList : public std::vector<ConflictPair>
   {
   };

+ 4 - 4
Source/cmOutputRequiredFilesCommand.cxx

@@ -446,10 +446,10 @@ protected:
   cmsys::RegularExpression IncludeFileRegularExpression;
   cmsys::RegularExpression ComplainFileRegularExpression;
   std::vector<std::string> IncludeDirectories;
-  typedef std::map<std::string, std::string> FileToPathMapType;
-  typedef std::map<std::string, FileToPathMapType>
-    DirectoryToFileToPathMapType;
-  typedef std::map<std::string, cmDependInformation*> DependInformationMapType;
+  using FileToPathMapType = std::map<std::string, std::string>;
+  using DirectoryToFileToPathMapType =
+    std::map<std::string, FileToPathMapType>;
+  using DependInformationMapType = std::map<std::string, cmDependInformation*>;
   DependInformationMapType DependInformationMap;
   DirectoryToFileToPathMapType DirectoryToFileToPathMap;
 };

+ 1 - 1
Source/cmPropertyMap.cxx

@@ -66,7 +66,7 @@ std::vector<std::string> cmPropertyMap::GetKeys() const
 
 std::vector<std::pair<std::string, std::string>> cmPropertyMap::GetList() const
 {
-  typedef std::pair<std::string, std::string> StringPair;
+  using StringPair = std::pair<std::string, std::string>;
   std::vector<StringPair> kvList;
   kvList.reserve(Map_.size());
   for (auto const& item : Map_) {

+ 1 - 1
Source/cmQtAutoMocUic.cxx

@@ -1237,7 +1237,7 @@ std::pair<std::string, cmFileTime>
 cmQtAutoMocUic::JobGenerateT::MocFindDependency(
   std::string const& sourceDir, std::string const& includeString) const
 {
-  typedef std::pair<std::string, cmFileTime> ResPair;
+  using ResPair = std::pair<std::string, cmFileTime>;
   // Search in vicinity of the source
   {
     ResPair res{ sourceDir + includeString, {} };

+ 3 - 3
Source/cmQtAutoMocUic.h

@@ -107,7 +107,7 @@ public:
       } Uic;
     };
     using FileHandleT = std::shared_ptr<FileT>;
-    typedef std::pair<FileHandleT, bool> GetOrInsertT;
+    using GetOrInsertT = std::pair<FileHandleT, bool>;
 
   public:
     ParseCacheT();
@@ -147,7 +147,7 @@ public:
     bool Uic = false;
   };
   using SourceFileHandleT = std::shared_ptr<SourceFileT>;
-  typedef std::map<std::string, SourceFileHandleT> SourceFileMapT;
+  using SourceFileMapT = std::map<std::string, SourceFileHandleT>;
 
   /**
    * Meta compiler file mapping information
@@ -160,7 +160,7 @@ public:
     std::vector<SourceFileHandleT> IncluderFiles;
   };
   using MappingHandleT = std::shared_ptr<MappingT>;
-  typedef std::map<std::string, MappingHandleT> MappingMapT;
+  using MappingMapT = std::map<std::string, MappingHandleT>;
 
   /**
    * Common settings

+ 1 - 1
Source/cmSourceGroupCommand.h

@@ -40,7 +40,7 @@ public:
                    cmExecutionStatus& status) override;
 
 private:
-  typedef std::map<std::string, std::vector<std::string>> ParsedArguments;
+  using ParsedArguments = std::map<std::string, std::vector<std::string>>;
   using ExpectedOptions = std::vector<std::string>;
 
   ExpectedOptions getExpectedOptions() const;

+ 1 - 1
Source/cmString.hxx

@@ -725,7 +725,7 @@ struct StringAdd
 template <typename L, typename R>
 struct StringAdd<StringOpPlus<L, R>> : std::true_type
 {
-  typedef StringOpPlus<L, R> const& temp_type;
+  using temp_type = StringOpPlus<L, R> const&;
   static temp_type temp(temp_type s) { return s; }
 };
 

+ 1 - 1
Source/cmTarget.h

@@ -107,7 +107,7 @@ public:
   cmSourceFile* AddSource(const std::string& src, bool before = false);
 
   //! how we identify a library, by name and type
-  typedef std::pair<std::string, cmTargetLinkLibraryType> LibraryID;
+  using LibraryID = std::pair<std::string, cmTargetLinkLibraryType>;
   using LinkLibraryVectorType = std::vector<LibraryID>;
   LinkLibraryVectorType const& GetOriginalLinkLibraries() const;
 

+ 1 - 1
Source/cmVariableWatch.h

@@ -77,7 +77,7 @@ protected:
   };
 
   using VectorOfPairs = std::vector<std::shared_ptr<Pair>>;
-  typedef std::map<std::string, VectorOfPairs> StringToVectorOfPairs;
+  using StringToVectorOfPairs = std::map<std::string, VectorOfPairs>;
 
   StringToVectorOfPairs WatchMap;
 };

+ 7 - 7
Source/cmVisualStudio10TargetGenerator.cxx

@@ -121,7 +121,7 @@ struct cmVisualStudio10TargetGenerator::Elem
 class cmVS10GeneratorOptions : public cmVisualStudioGeneratorOptions
 {
 public:
-  typedef cmVisualStudio10TargetGenerator::Elem Elem;
+  using Elem = cmVisualStudio10TargetGenerator::Elem;
   cmVS10GeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
                          cmVS7FlagTable const* table,
                          cmVisualStudio10TargetGenerator* g = nullptr)
@@ -895,7 +895,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags(
   static const std::string refpropPrefix = "VS_DOTNET_REFERENCEPROP_";
   static const std::string refpropInfix = "_TAG_";
   const std::string refPropFullPrefix = refpropPrefix + ref + refpropInfix;
-  typedef std::map<std::string, std::string> CustomTags;
+  using CustomTags = std::map<std::string, std::string>;
   CustomTags tags;
   cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties();
   for (const auto& i : props.GetList()) {
@@ -2400,7 +2400,7 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
   }
   if (this->ProjectType == csproj) {
     std::string f = source->GetFullPath();
-    typedef std::map<std::string, std::string> CsPropMap;
+    using CsPropMap = std::map<std::string, std::string>;
     CsPropMap sourceFileTags;
     // set <Link> tag if necessary
     std::string link;
@@ -3714,7 +3714,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
   }
 
   cmComputeLinkInformation& cli = *pcli;
-  typedef cmComputeLinkInformation::ItemVector ItemVector;
+  using ItemVector = cmComputeLinkInformation::ItemVector;
   const ItemVector& libs = cli.GetItems();
   std::string currentBinDir =
     this->LocalGenerator->GetCurrentBinaryDirectory();
@@ -3759,7 +3759,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
   const cmComputeLinkInformation& cli, std::vector<std::string>& libVec,
   std::vector<std::string>& vsTargetVec, const std::string& config)
 {
-  typedef cmComputeLinkInformation::ItemVector ItemVector;
+  using ItemVector = cmComputeLinkInformation::ItemVector;
   ItemVector const& libs = cli.GetItems();
   std::string currentBinDir =
     this->LocalGenerator->GetCurrentBinaryDirectory();
@@ -3985,8 +3985,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
 {
   cmGlobalGenerator::TargetDependSet const& unordered =
     this->GlobalGenerator->GetTargetDirectDepends(this->GeneratorTarget);
-  typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet
-    OrderedTargetDependSet;
+  using OrderedTargetDependSet =
+    cmGlobalVisualStudioGenerator::OrderedTargetDependSet;
   OrderedTargetDependSet depends(unordered, CMAKE_CHECK_BUILD_SYSTEM_TARGET);
   Elem e1(e0, "ItemGroup");
   e1.SetHasElements();

+ 9 - 9
Source/cmVisualStudio10TargetGenerator.h

@@ -186,8 +186,8 @@ private:
 
 private:
   friend class cmVS10GeneratorOptions;
-  typedef cmVS10GeneratorOptions Options;
-  typedef std::map<std::string, std::unique_ptr<Options>> OptionsMap;
+  using Options = cmVS10GeneratorOptions;
+  using OptionsMap = std::map<std::string, std::unique_ptr<Options>>;
   OptionsMap ClOptions;
   OptionsMap RcOptions;
   OptionsMap CudaOptions;
@@ -224,16 +224,16 @@ private:
   std::string DefaultArtifactDir;
   bool AddedDefaultCertificate = false;
   // managed C++/C# relevant members
-  typedef std::pair<std::string, std::string> DotNetHintReference;
-  typedef std::vector<DotNetHintReference> DotNetHintReferenceList;
-  typedef std::map<std::string, DotNetHintReferenceList>
-    DotNetHintReferenceMap;
+  using DotNetHintReference = std::pair<std::string, std::string>;
+  using DotNetHintReferenceList = std::vector<DotNetHintReference>;
+  using DotNetHintReferenceMap =
+    std::map<std::string, DotNetHintReferenceList>;
   DotNetHintReferenceMap DotNetHintReferences;
-  typedef std::set<std::string> UsingDirectories;
-  typedef std::map<std::string, UsingDirectories> UsingDirectoriesMap;
+  using UsingDirectories = std::set<std::string>;
+  using UsingDirectoriesMap = std::map<std::string, UsingDirectories>;
   UsingDirectoriesMap AdditionalUsingDirectories;
 
-  typedef std::map<std::string, ToolSources> ToolSourceMap;
+  using ToolSourceMap = std::map<std::string, ToolSources>;
   ToolSourceMap Tools;
   std::string GetCMakeFilePath(const char* name) const;
 };

+ 1 - 1
Source/cmVisualStudioGeneratorOptions.h

@@ -14,7 +14,7 @@
 
 class cmLocalVisualStudioGenerator;
 
-typedef cmIDEFlagTable cmVS7FlagTable;
+using cmVS7FlagTable = cmIDEFlagTable;
 
 class cmVisualStudioGeneratorOptions : public cmIDEOptions
 {

+ 2 - 2
Source/cmVisualStudioSlnData.h

@@ -45,9 +45,9 @@ public:
                                 const std::string& projectRelativePath);
 
 private:
-  typedef std::map<std::string, cmSlnProjectEntry> ProjectStorage;
+  using ProjectStorage = std::map<std::string, cmSlnProjectEntry>;
   ProjectStorage ProjectsByGUID;
-  typedef std::map<std::string, ProjectStorage::iterator> ProjectStringIndex;
+  using ProjectStringIndex = std::map<std::string, ProjectStorage::iterator>;
   ProjectStringIndex ProjectNameIndex;
 };
 

+ 1 - 1
Source/cmVisualStudioSlnParser.cxx

@@ -51,7 +51,7 @@ public:
   void CopyVerbatim(const std::string& line) { this->Tag = line; }
 
 private:
-  typedef std::pair<std::string, bool> StringData;
+  using StringData = std::pair<std::string, bool>;
   std::string Tag;
   StringData Arg;
   std::vector<StringData> Values;

+ 1 - 1
Source/cmVisualStudioSlnParser.h

@@ -42,7 +42,7 @@ public:
     DataGroupCount
   };
 
-  typedef std::bitset<DataGroupCount> DataGroupSet;
+  using DataGroupSet = std::bitset<DataGroupCount>;
 
   static const DataGroupSet DataGroupProjects;
   static const DataGroupSet DataGroupProjectDependencies;

+ 1 - 1
Source/cmXCodeScheme.h

@@ -18,7 +18,7 @@
 class cmXCodeScheme
 {
 public:
-  typedef std::vector<const cmXCodeObject*> TestObjects;
+  using TestObjects = std::vector<const cmXCodeObject*>;
 
   cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests,
                 const std::vector<std::string>& configList,

+ 2 - 2
Source/cm_string_view.hxx

@@ -207,8 +207,8 @@ namespace std {
 template <>
 struct hash<cm::string_view>
 {
-  typedef cm::string_view argument_type;
-  typedef size_t result_type;
+  using argument_type = cm::string_view;
+  using result_type = size_t;
   result_type operator()(argument_type const& s) const noexcept;
 };
 }

+ 3 - 3
Source/cm_sys_stat.h

@@ -4,12 +4,12 @@
 #define cm_sys_stat_h
 
 #if defined(_MSC_VER)
-typedef unsigned short mode_t;
+using mode_t = unsigned short;
 #endif
 
 #if defined(WIN32)
-typedef unsigned short uid_t;
-typedef unsigned short gid_t;
+using uid_t = unsigned short;
+using gid_t = unsigned short;
 #endif
 
 #include <sys/types.h>

+ 1 - 1
Source/cmake.cxx

@@ -116,7 +116,7 @@
 namespace {
 
 #if !defined(CMAKE_BOOTSTRAP)
-typedef std::unordered_map<std::string, Json::Value> JsonValueMapType;
+using JsonValueMapType = std::unordered_map<std::string, Json::Value>;
 #endif
 
 } // namespace

+ 1 - 1
Source/cmake.h

@@ -133,7 +133,7 @@ public:
     std::unordered_set<std::string> unordered;
   };
 
-  typedef std::map<std::string, cmInstalledFile> InstalledFilesMap;
+  using InstalledFilesMap = std::map<std::string, cmInstalledFile>;
 
   static const int NO_BUILD_PARALLEL_LEVEL = -1;
   static const int DEFAULT_BUILD_PARALLEL_LEVEL = 0;