]> granicus.if.org Git - clang/commitdiff
Handle 'Cpp03' and 'Cpp11' strings in LanguageStandard serialization for
authorAlexander Kornienko <alexfh@google.com>
Wed, 4 Sep 2013 14:09:13 +0000 (14:09 +0000)
committerAlexander Kornienko <alexfh@google.com>
Wed, 4 Sep 2013 14:09:13 +0000 (14:09 +0000)
consistency of serialized form with the actual enum member names without
a prefix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189936 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/Format.cpp
unittests/Format/FormatTest.cpp

index 76e6faa40ca7d72be69610a94a631f2a2305c665..89960003bce66c6718118e03c983f5b6f42d0821 100644 (file)
@@ -36,7 +36,9 @@ template <>
 struct ScalarEnumerationTraits<clang::format::FormatStyle::LanguageStandard> {
   static void enumeration(IO &IO,
                           clang::format::FormatStyle::LanguageStandard &Value) {
+    IO.enumCase(Value, "Cpp03", clang::format::FormatStyle::LS_Cpp03);
     IO.enumCase(Value, "C++03", clang::format::FormatStyle::LS_Cpp03);
+    IO.enumCase(Value, "Cpp11", clang::format::FormatStyle::LS_Cpp11);
     IO.enumCase(Value, "C++11", clang::format::FormatStyle::LS_Cpp11);
     IO.enumCase(Value, "Auto", clang::format::FormatStyle::LS_Auto);
   }
index 32226fc501e3a4f12a8c69d08fee3e27f74d90f6..c398094e399c8ce05e64451706c9b2e9e9a45722 100644 (file)
@@ -6001,6 +6001,8 @@ TEST_F(FormatTest, ParsesConfiguration) {
   CHECK_PARSE("IndentWidth: 32", IndentWidth, 32u);
 
   Style.Standard = FormatStyle::LS_Auto;
+  CHECK_PARSE("Standard: Cpp03", Standard, FormatStyle::LS_Cpp03);
+  CHECK_PARSE("Standard: Cpp11", Standard, FormatStyle::LS_Cpp11);
   CHECK_PARSE("Standard: C++03", Standard, FormatStyle::LS_Cpp03);
   CHECK_PARSE("Standard: C++11", Standard, FormatStyle::LS_Cpp11);
   CHECK_PARSE("Standard: Auto", Standard, FormatStyle::LS_Auto);