From: Alexander Kornienko Date: Wed, 4 Sep 2013 14:09:13 +0000 (+0000) Subject: Handle 'Cpp03' and 'Cpp11' strings in LanguageStandard serialization for X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9321e8700275847458de753933689e30a3412fe2;p=clang Handle 'Cpp03' and 'Cpp11' strings in LanguageStandard serialization for 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 --- diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 76e6faa40c..89960003bc 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -36,7 +36,9 @@ template <> struct ScalarEnumerationTraits { 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); } diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 32226fc501..c398094e39 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -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);