From 73a1d422a54fb62c429578429e146081307300bc Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 4 Oct 2023 12:28:28 -0400 Subject: cmStandardLevelResolver: Mark builtin language standards table as const --- Source/cmStandardLevelResolver.cxx | 58 ++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx index de42bc6..50389b5 100644 --- a/Source/cmStandardLevelResolver.cxx +++ b/Source/cmStandardLevelResolver.cxx @@ -476,37 +476,33 @@ struct StandardLevelComputer std::vector LevelsAsStrings; }; -std::unordered_map - StandardComputerMapping = { - { "C", - StandardLevelComputer{ - "C", std::vector{ 90, 99, 11, 17, 23 }, - std::vector{ "90", "99", "11", "17", "23" } } }, - { "CXX", - StandardLevelComputer{ "CXX", - std::vector{ 98, 11, 14, 17, 20, 23, 26 }, - std::vector{ "98", "11", "14", "17", - "20", "23", "26" } } }, - { "CUDA", - StandardLevelComputer{ "CUDA", - std::vector{ 03, 11, 14, 17, 20, 23, 26 }, - std::vector{ "03", "11", "14", "17", - "20", "23", "26" } } }, - { "OBJC", - StandardLevelComputer{ - "OBJC", std::vector{ 90, 99, 11, 17, 23 }, - std::vector{ "90", "99", "11", "17", "23" } } }, - { "OBJCXX", - StandardLevelComputer{ "OBJCXX", - std::vector{ 98, 11, 14, 17, 20, 23, 26 }, - std::vector{ "98", "11", "14", "17", - "20", "23", "26" } } }, - { "HIP", - StandardLevelComputer{ "HIP", - std::vector{ 98, 11, 14, 17, 20, 23, 26 }, - std::vector{ "98", "11", "14", "17", - "20", "23", "26" } } } - }; +std::unordered_map const StandardComputerMapping = { + { "C", + StandardLevelComputer{ + "C", std::vector{ 90, 99, 11, 17, 23 }, + std::vector{ "90", "99", "11", "17", "23" } } }, + { "CXX", + StandardLevelComputer{ + "CXX", std::vector{ 98, 11, 14, 17, 20, 23, 26 }, + std::vector{ "98", "11", "14", "17", "20", "23", "26" } } }, + { "CUDA", + StandardLevelComputer{ + "CUDA", std::vector{ 03, 11, 14, 17, 20, 23, 26 }, + std::vector{ "03", "11", "14", "17", "20", "23", "26" } } }, + { "OBJC", + StandardLevelComputer{ + "OBJC", std::vector{ 90, 99, 11, 17, 23 }, + std::vector{ "90", "99", "11", "17", "23" } } }, + { "OBJCXX", + StandardLevelComputer{ + "OBJCXX", std::vector{ 98, 11, 14, 17, 20, 23, 26 }, + std::vector{ "98", "11", "14", "17", "20", "23", "26" } } }, + { "HIP", + StandardLevelComputer{ + "HIP", std::vector{ 98, 11, 14, 17, 20, 23, 26 }, + std::vector{ "98", "11", "14", "17", "20", "23", "26" } } } +}; } std::string cmStandardLevelResolver::GetCompileOptionDef( -- cgit v0.12