forked from OSchip/llvm-project
Don't insert a break into include lines with trailing comments.
llvm-svn: 182003
This commit is contained in:
parent
efb6172cb3
commit
8bb99e8911
|
@ -777,7 +777,8 @@ private:
|
|||
llvm::OwningPtr<BreakableToken> Token;
|
||||
unsigned StartColumn = State.Column - Current.FormatTok.TokenLength -
|
||||
UnbreakableTailLength;
|
||||
if (Current.is(tok::string_literal)) {
|
||||
if (Current.is(tok::string_literal) &&
|
||||
Current.Type != TT_ImplicitStringLiteral) {
|
||||
// Only break up default narrow strings.
|
||||
const char *LiteralData = SourceMgr.getCharacterData(
|
||||
Current.FormatTok.getStartOfNonWhitespace());
|
||||
|
|
|
@ -2894,6 +2894,7 @@ TEST_F(FormatTest, HandlesIncludeDirectives) {
|
|||
"#include <a-a>\n"
|
||||
"#include < path with space >\n"
|
||||
"#include \"abc.h\" // this is included for ABC\n"
|
||||
"#include \"some long include\" // with a comment\n"
|
||||
"#include \"some very long include paaaaaaaaaaaaaaaaaaaaaaath\"",
|
||||
getLLVMStyleWithColumns(35));
|
||||
|
||||
|
|
Loading…
Reference in New Issue