r189936 - Handle 'Cpp03' and 'Cpp11' strings in LanguageStandard serialization for

Alexander Kornienko alexfh at google.com
Wed Sep 4 07:09:13 PDT 2013


Author: alexfh
Date: Wed Sep  4 09:09:13 2013
New Revision: 189936

URL: http://llvm.org/viewvc/llvm-project?rev=189936&view=rev
Log:
Handle 'Cpp03' and 'Cpp11' strings in LanguageStandard serialization for
consistency of serialized form with the actual enum member names without
a prefix.

Modified:
    cfe/trunk/lib/Format/Format.cpp
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=189936&r1=189935&r2=189936&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Wed Sep  4 09:09:13 2013
@@ -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);
   }

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=189936&r1=189935&r2=189936&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Sep  4 09:09:13 2013
@@ -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);





More information about the cfe-commits mailing list