r206263 - clang-format: Basic support for C++1y.
Daniel Jasper
djasper at google.com
Tue Apr 15 01:49:21 PDT 2014
Author: djasper
Date: Tue Apr 15 03:49:21 2014
New Revision: 206263
URL: http://llvm.org/viewvc/llvm-project?rev=206263&view=rev
Log:
clang-format: Basic support for C++1y.
Before:
int bi{1 '000' 000};
After:
int bi{1'000'000};
This fixes llvm.org/PR19342.
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=206263&r1=206262&r2=206263&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Tue Apr 15 03:49:21 2014
@@ -1848,6 +1848,7 @@ LangOptions getFormattingLangOpts(Format
LangOptions LangOpts;
LangOpts.CPlusPlus = 1;
LangOpts.CPlusPlus11 = Standard == FormatStyle::LS_Cpp03 ? 0 : 1;
+ LangOpts.CPlusPlus1y = Standard == FormatStyle::LS_Cpp03 ? 0 : 1;
LangOpts.LineComment = 1;
LangOpts.Bool = 1;
LangOpts.ObjC1 = 1;
Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=206263&r1=206262&r2=206263&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Tue Apr 15 03:49:21 2014
@@ -6663,6 +6663,10 @@ TEST_F(FormatTest, DoesNotTryToParseUDLi
format("#define x(_a) printf(\"foo\"_a);", Style));
}
+TEST_F(FormatTest, UnderstandsCpp1y) {
+ verifyFormat("int bi{1'000'000};");
+}
+
TEST_F(FormatTest, BreakStringLiteralsBeforeUnbreakableTokenSequence) {
EXPECT_EQ("someFunction(\"aaabbbcccd\"\n"
" \"ddeeefff\");",
More information about the cfe-commits
mailing list