From 7ff96ed7336b4f0efef05c10fd5ce5143918d4e1 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 6 May 2013 10:24:51 +0000 Subject: Don't break comments after includes. LLVM/Clang basically don't use such comments and for Google-style, include-lines are explicitly exempt from the column limit. Also, for most cases, where the column limit is violated, the "better" solution would be to move the comment to before the include, which clang-format cannot do (yet). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181191 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/Format.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index d251d4f9e6..68626d29ca 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -643,7 +643,9 @@ private: if (!DryRun) BBC->alignLines(Whitespaces); Token.reset(BBC); - } else if (Current.Type == TT_LineComment) { + } else if (Current.Type == TT_LineComment && + (Current.Parent == NULL || + Current.Parent->Type != TT_ImplicitStringLiteral)) { Token.reset(new BreakableLineComment(SourceMgr, Current, StartColumn)); } else { return 0; -- cgit v1.2.3-18-g5258